diff --git a/gulliver/js/grid/core/grid.js b/gulliver/js/grid/core/grid.js
index 114feb6f5..478779584 100755
--- a/gulliver/js/grid/core/grid.js
+++ b/gulliver/js/grid/core/grid.js
@@ -464,6 +464,9 @@ var G_Grid = function(oForm, sGridName){
eval('aObjects[n].onclick = ' + onclickevn.replace(/\[1\]/g, '\[' + currentRow + '\]') + ';');
}
break;
+ case "file":
+ aObjects[n].value = "";
+ break;
}
}
}
@@ -718,6 +721,10 @@ var G_Grid = function(oForm, sGridName){
var iRow = Number(sRow);
var iRowAux = iRow + 1;
var lastItem = oObj.oGrid.rows.length - 2;
+ var elem2ParentNode;
+ var elem2Id = "";
+ var elem2Name = "";
+ var elemAux;
deleteRowOnDynaform(oObj, iRow);
@@ -725,16 +732,40 @@ var G_Grid = function(oForm, sGridName){
for (i = 1; i < oObj.oGrid.rows[iRowAux - 1].cells.length; i++) {
var oCell1 = oObj.oGrid.rows[iRowAux - 1].cells[i];
var oCell2 = oObj.oGrid.rows[iRowAux].cells[i];
+
switch (oCell1.innerHTML.replace(/^\s+|\s+$/g, '').substr(0, 6).toLowerCase()){
case 'type){
case 'radiogroup':
$values[$k] = $newValues[$k];
- $values["{$k}_label"] = $newValues["{$k}_label"] = $v->options[$newValues[$k]];
+ $values[$k . "_label"] = $newValues[$k . "_label"] = $v->options[$newValues[$k]];
break;
case 'suggest':
$values[$k] = $newValues[$k];
- $values["{$k}_label"] = $newValues["{$k}_label"];
+ $values[$k . "_label"] = $newValues[$k . "_label"];
break;
case 'checkgroup':
case 'listbox':
if ( is_array($newValues[$k]) ) {
- $values[$k] = $values["{$k}_label"] = '';
+ $values[$k] = $values[$k . "_label"] = null;
foreach ($newValues[$k] as $i => $value) {
//if $value is empty continue with the next loop, because this is a not selected/checked item
if (trim($value) == '') {
continue;
}
- $values[$k] .= ($i != 0 ? '|': '') . $value;
+ $values[$k] .= (($i != 0)? "|" : null) . $value;
if (isset($v->options[$value])){
- $values["{$k}_label"] .= ($i != 0 ? '|': '') . $v->options[$value];
+ $values[$k . "_label"] .= (($i != 0)? "|" : null) . $v->options[$value];
}
else { // if hasn't options try execute a sql sentence
$query = G::replaceDataField($this->fields[$k]->sql,$newValues);
@@ -346,18 +346,19 @@ class Form extends XmlForm
list($rowId, $rowContent) = array_values($rs->getRow());//This to be sure that the array is numeric. Some cases when is DBArray result it returns an associative. By JHL
if ($value == $rowId){
- $values["{$k}_label"] .= ($i != 0 ? '|': '') . $rowContent;
- break;
+ $values[$k . "_label"] .= (($i != 0)? "|" : null) . $rowContent;
+ break;
}
}
}
}
}
- $newValues["{$k}_label"] = isset($values["{$k}_label"]) ? $values["{$k}_label"] : '';
+
+ $newValues[$k . "_label"] = (isset($values[$k . "_label"]))? $values[$k . "_label"] : null;
} else {
- $values[$k] = $newValues[$k];
- $values["{$k}_label"] = isset($newValues["{$k}_label"]) ? $newValues["{$k}_label"] : '';
+ $values[$k] = $newValues[$k];
+ $values[$k . "_label"] = (isset($newValues[$k . "_label"]))? $newValues[$k . "_label"] : null;
}
break;
@@ -365,7 +366,7 @@ class Form extends XmlForm
$values[$k] = $newValues[$k];
if (isset($v->options[$newValues[$k]])){
- $values["{$k}_label"] = $newValues["{$k}_label"] = $v->options[$newValues[$k]];
+ $values[$k . "_label"] = $newValues[$k . "_label"] = $v->options[$newValues[$k]];
}
else {
$query = G::replaceDataField($this->fields[$k]->sql,$newValues);
@@ -382,8 +383,8 @@ class Form extends XmlForm
while ($rs->next()) {
list($rowId, $rowContent) = $rs->getRow();
if ($newValues[$k]==$rowId){
- $values["{$k}_label"] = $rowContent;
- break;
+ $values[$k . "_label"] = $rowContent;
+ break;
}
}
}
@@ -392,47 +393,62 @@ class Form extends XmlForm
case 'grid':
foreach( $newValues[$k] as $j => $item ) {
if(is_array($item)){
- $i=0;
$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
- foreach($item as $kk => $vv){
+ foreach ($item as $kk => $vv) {
+ if ($this->fields[$k]->fields[$kk]->type != "file") {
+ switch ($this->fields[$k]->fields[$kk]->type) {
+ case "dropdown":
+ //We need to know which fields are dropdowns
+ $values[$k][$j] = $newValues[$k][$j];
- //we need to know which fields are dropdowns
- if($this->fields[$k]->fields[$kk]->type == 'dropdown') {
- $values[$k][$j] = $newValues[$k][$j];
+ if ($this->fields[$k]->validateValue($newValues[$k][$j], $this)) {
+ //If the dropdown has otions
+ if (isset($this->fields[$k]->fields[$kk]->options[$vv])) {
+ $values[$k][$j][$kk . "_label"] = $newValues[$k][$j][$kk . "_label"] = $this->fields[$k]->fields[$kk]->options[$vv];
+ } else {
+ //If hasn't options try execute a sql sentence
+ $query = G::replaceDataField($this->fields[$k]->fields[$kk]->sql,$values[$k][$j]);
+ $con = Propel::getConnection((!empty($this->fields[$k]->fields[$kk]->sqlConnection))? $this->fields[$k]->fields[$kk]->sqlConnection : "workflow");
+ $stmt = $con->prepareStatement($query);
- if ($this->fields[$k]->validateValue($newValues[$k][$j], $this )){
- // if the dropdown has otions
+ //Execute just if a query was set, it should be not empty
+ if (trim($query) == "") {
+ //if it is empty string skip it
+ continue;
+ }
- if (isset($this->fields[$k]->fields[$kk]->options[$vv])){
- $values[$k][$j]["{$kk}_label"] = $newValues[$k][$j][$kk . '_label'] = $this->fields[$k]->fields[$kk]->options[$vv];
- } else { // if hasn't options try execute a sql sentence
- $query = G::replaceDataField($this->fields[$k]->fields[$kk]->sql,$values[$k][$j]);
- $con = Propel::getConnection($this->fields[$k]->fields[$kk]->sqlConnection!=""?$this->fields[$k]->fields[$kk]->sqlConnection:"workflow");
- $stmt = $con->prepareStatement($query);
+ $rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
- // execute just if a query was set, it should be not empty
- if(trim($query) == '') {
- continue; //if it is empty string skip it
+ while ($rs->next()) {
+ //From the query executed we only need certain elements
+ //note added by krlos pacha carlos[at]colosa[dot]com
+ //the following line has the correct values because the query return an associative array. Related 7945 bug
+ list($rowId, $rowContent) = explode(",", implode(",", $rs->getRow()));
+
+ if ($vv == $rowId) {
+ $values[$k][$j][$kk . "_label"] = $newValues[$k][$j][$kk. "_label"] = $rowContent;
+ break;
+ }
+ }
+ }
+ }
+ break;
+ default:
+ //If there are no dropdowns previously setted and the evaluated field is not a dropdown
+ //only then rewritte the $values
+ $values[$k][$j] = $this->fields[$k]->maskValue($newValues[$k][$j], $this);
+ break;
+ }
+ } else {
+ if (isset($_FILES["form"]["name"][$k][$j][$kk])) {
+ $values[$k][$j][$kk] = $_FILES["form"]["name"][$k][$j][$kk];
+ }
+
+ if (isset($this->fields[$k]->fields[$kk]->input) && !empty($this->fields[$k]->fields[$kk]->input)) {
+ //$_POST["INPUTS"][$k][$j][$kk] = $this->fields[$k]->fields[$kk]->input;
+ $_POST["INPUTS"][$k][$kk] = $this->fields[$k]->fields[$kk]->input;
}
- $rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
- while ($rs->next()){
- // from the query executed we only need certain elements
- // note added by krlos pacha carlos[at]colosa[dot]com
- // the following line has the correct values because the query return an associative array. Related 7945 bug
- list($rowId, $rowContent) = explode(',',implode(',',$rs->getRow()));
- if ($vv==$rowId){
- $values[$k][$j]["{$kk}_label"] = $newValues[$k][$j][$kk. '_label'] = $rowContent;
- break;
- }
- }//end $rw->next() while
- }
}
- } else {
- // if there are no dropdowns previously setted and the evaluated field is not a dropdown
- // only then rewritte the $values
- $values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
- }
- $i++;
}
} else {
$values[$k][$j] = $this->fields[$k]->maskValue( $newValues[$k][$j], $this );
@@ -447,20 +463,14 @@ class Form extends XmlForm
}
}
- }
- else {
- if (isset($_FILES['form']['name'][$k])) {
- $values[$k] = $_FILES['form']['name'][$k];
- }
- /**
- * FIXED for multiple inputs documents related to file type field
- * By Erik Amaru Ortiz
- * Nov 24th, 2009
- */
- if ( isset($v->input) && $v->input != ''){
- $_POST['INPUTS'][$k] = $v->input;
- }
- /**/
+ } else {
+ if (isset($_FILES["form"]["name"][$k])) {
+ $values[$k] = $_FILES["form"]["name"][$k];
+ }
+
+ if (isset($v->input) && !empty($v->input)) {
+ $_POST["INPUTS"][$k] = $v->input;
+ }
}
}
}
@@ -470,6 +480,7 @@ class Form extends XmlForm
$values[$k] = $v;
}
}
+
return $values;
}
@@ -570,32 +581,40 @@ class Form extends XmlForm
return count($notPassedFields) > 0 ? $notPassedFields : false;
}
- function validateFields($data) {
- $values = array();
- $excludeTypes = array('submit', 'file');
- foreach($this->fields as $k => $v) {
- if (!in_array($v->type, $excludeTypes)) {
- switch($v->type) {
- case 'checkbox':
- $data[$v->name] = isset($data[$v->name])? $data[$v->name] : $v->falseValue;
- break;
- case 'grid':
- $i = 0 ;
- foreach ($data[$v->name] as $dataGrid) {
- $i++;
- foreach ($v->fields as $dataGridInt) {
- switch($dataGridInt->type) {
- case 'checkbox':
- $data[$v->name][$i][$dataGridInt->name] = isset($data[$v->name][$i][$dataGridInt->name])? $data[$v->name][$i][$dataGridInt->name] : $dataGridInt->falseValue;
- break;
- }
- }
- }
- break;
- default:
+ public function validateFields($data)
+ {
+ $excludeTypes = array("submit", "file");
+
+ foreach ($this->fields as $k => $v) {
+ if (!in_array($v->type, $excludeTypes)) {
+ switch ($v->type) {
+ case "checkbox":
+ $data[$v->name] = (isset($data[$v->name]))? $data[$v->name] : ((isset($v->falseValue))? $v->falseValue : null);
+ break;
+ case "grid":
+ $i = 0;
+
+ foreach ($data[$v->name] as $dataGrid) {
+ $i = $i + 1;
+
+ foreach ($v->fields as $gridField) {
+ switch ($gridField->type) {
+ case "file":
+ $data[$v->name][$i][$gridField->name] = (isset($_FILES["form"]["name"][$v->name][$i][$gridField->name]))? $_FILES["form"]["name"][$v->name][$i][$gridField->name] : ((isset($gridField->falseValue))? $gridField->falseValue : null);
+ break;
+ case "checkbox":
+ $data[$v->name][$i][$gridField->name] = (isset($data[$v->name][$i][$gridField->name]))? $data[$v->name][$i][$gridField->name] : ((isset($gridField->falseValue))? $gridField->falseValue : null);
+ break;
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
}
- }
+
+ return $data;
}
- return $data;
- }
}
diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php
index 29b68d7e7..807ae1b18 100755
--- a/gulliver/system/class.xmlform.php
+++ b/gulliver/system/class.xmlform.php
@@ -2324,76 +2324,111 @@ class XmlForm_Field_Link extends XmlForm_Field {
* @package gulliver.system
* @access public
*/
-class XmlForm_Field_File extends XmlForm_Field {
- var $required = false;
- var $input = '';
- /**
- * Function render
- * @author David S. Callizaya S.
- * @access public
- * @param string value
- * @return string
- */
- function render($value = NULL) {
- $permission = false;
- $url = '';
- if (isset($_SESSION['APPLICATION']) && isset($_SESSION['USER_LOGGED']) && isset($_SESSION['TASK']) && $this->mode == 'view') {
- require_once ("classes/model/AppDocument.php");
- G::LoadClass('case');
- $case = new Cases();
- $fields = $case->loadCase($_SESSION['APPLICATION']);
- $sProcessUID = $fields['PRO_UID'];
- $permissions = $case->getAllObjects($sProcessUID, $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED']);
+class XmlForm_Field_File extends XmlForm_Field
+{
+ public $required = false;
+ public $input = null;
- $criteria = new Criteria();
- $criteria->add(AppDocumentPeer::APP_DOC_UID, $permissions['INPUT_DOCUMENTS'], Criteria::IN);
- $criteria->addDescendingOrderByColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
- $dataset = AppDocumentPeer::doSelectRS($criteria);
- $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
- $dataset->next();
- $sw = 0;
- while (($aRow = $dataset->getRow()) && $sw == 0) {
- if ($aRow['DOC_UID'] == $this->input) {
- $sw = 1;
- $permission = true;
- $url = (G::is_https() ? 'https://' : 'http://') .
- $_SERVER['HTTP_HOST'].dirname($_SERVER['REQUEST_URI']).'/cases_ShowDocument?a='.
- $aRow['APP_DOC_UID'].'&v='.$aRow['DOC_VERSION'];
+ /**
+ * Function render
+ * @author David S. Callizaya S.
+ * @access public
+ * @param string value
+ * @return string
+ */
+ public function render($value=null, $owner=null, $rowId=null, $row=-1, $therow=-1)
+ {
+ $permission = false;
+ $url = null;
+
+ if (isset($_SESSION["APPLICATION"]) &&
+ isset($_SESSION["USER_LOGGED"]) &&
+ isset($_SESSION["TASK"]) &&
+ isset($this->input) && $this->input != null &&
+ $this->mode == "view"
+ ) {
+ require_once ("classes/model/AppDocument.php");
+ G::LoadClass("case");
+
+ $case = new Cases();
+ $arrayField = $case->loadCase($_SESSION["APPLICATION"]);
+ $arrayPermission = $case->getAllObjects($arrayField["PRO_UID"], $_SESSION["APPLICATION"], $_SESSION["TASK"], $_SESSION["USER_LOGGED"]);
+
+ $criteria = new Criteria();
+ $criteria->add(AppDocumentPeer::APP_DOC_UID, $arrayPermission["INPUT_DOCUMENTS"], Criteria::IN);
+
+ switch ($owner->type) {
+ case "xmlform":
+ break;
+ case "grid":
+ $criteria->add(AppDocumentPeer::APP_DOC_FIELDNAME, $owner->name . "_" . $row . "_" . $this->name);
+ break;
+ }
+
+ $criteria->addDescendingOrderByColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
+ $rsCriteria = AppDocumentPeer::doSelectRS($criteria);
+ $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
+ $sw = 0;
+
+ while (($rsCriteria->next()) && $sw == 0) {
+ $row = $rsCriteria->getRow();
+
+ if ($row["DOC_UID"] == $this->input) {
+ $permission = true;
+ $url = ((G::is_https())? "https://" : "http://") . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]) . "/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
+ $sw = 1;
+ }
}
- $dataset->next();
}
+
+ $html1 = null;
+ $html2 = null;
+ $mode = ($this->mode == "view")? " disabled=\"disabled\"" : null;
+ $styleDisplay = null;
+
+ if ($this->mode == "view") {
+ if ($permission) {
+ $html1 = "type == "grid")? " class=\"tableOption\" style=\"color: #006699; text-decoration: none; font-weight: normal;\"" : null) . ">";
+ $html2 = "";
+ }
+
+ $html1 = $html1 . $value;
+ $styleDisplay = "display: none;";
+ }
+
+ $html = $html1 . "name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " />" . $html2;
+
+ if (isset($this->input) && $this->input != null) {
+ require_once ("classes/model/InputDocument.php");
+
+ try {
+ $indoc = new InputDocument();
+ $aDoc = $indoc->load($this->input);
+ $aDoc["INP_DOC_TITLE"] = (isset($aDoc["INP_DOC_TITLE"]))? $aDoc["INP_DOC_TITLE"] : null;
+ $html = $html . "";
+ } catch (Exception $e) {
+ //Then the input document doesn"t exits, id referencial broken
+ $html = $html . " (" . G::loadTranslation("ID_INPUT_DOC_DOESNT_EXIST") . ")";
+ }
+ }
+
+ $html = $html . $this->renderHint();
+
+ return $html;
}
- $mode = ($this->mode == 'view') ? ' disabled="disabled"' : '';
- if($this->mode == 'view'){
- $displayStyle = 'display:none;';
- if ($permission) {
- $html = ''.$value.'';
- } else {
- $html = $value.'';
- }
- }
- else{
- $html = 'name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\'/>';
- }
+ public function renderGrid($value=array(), $owner=null, $therow=-1)
+ {
+ $arrayResult = array();
+ $r = 1;
- if( isset($this->input) && $this->input != '') {
- require_once 'classes/model/InputDocument.php';
- $oiDoc = new InputDocument;
+ foreach ($value as $v) {
+ $arrayResult[] = $this->render($v, $owner, "[" . $owner->name . "][" . $r . "]", $r, $therow);
+ $r = $r + 1;
+ }
- try {
- $aDoc = $oiDoc->load($this->input);
- $aDoc['INP_DOC_TITLE'] = isset($aDoc['INP_DOC_TITLE'])? $aDoc['INP_DOC_TITLE']: '';
- $html .= '';
- }
- catch (Exception $e) {
- // then the input document doesn't exits, id referencial broken
- $html .= ' ('.G::loadTranslation('ID_INPUT_DOC_DOESNT_EXIST').')';
- }
+ return $arrayResult;
}
- $html .= $this->renderHint();
- return $html;
- }
}
/**
@@ -3296,11 +3331,11 @@ class XmlForm_Field_Grid extends XmlForm_Field
$fieldsSize += $size;
$emptyRow [$key] = array ($emptyValue);
}
-
+
if (isset($owner->adjustgridswidth) && $owner->adjustgridswidth == '1') {
// 400w -> 34s to Firefox
// 400w -> 43s to Chrome
-
+
$baseWidth = 400;
$minusWidth = 30;
if (eregi('chrome', $_SERVER['HTTP_USER_AGENT'])) {
@@ -3322,7 +3357,7 @@ class XmlForm_Field_Grid extends XmlForm_Field
}
} else {
if($fieldsSize>100)
- $owner->width = '100%';
+ $owner->width = '100%';
}
// else
// $owner->width = $fieldsSize . 'em';
@@ -4781,14 +4816,20 @@ class xmlformTemplate extends Smarty
}
}*/
- if ($v->type == 'grid') {
- $result ['form'] [$k] = $form->fields [$k]->renderGrid ( $value, $form, $therow );
+ if ($v->type == "grid") {
+ $result["form"][$k] = $form->fields[$k]->renderGrid($value, $form, $therow);
} else {
- if ($v->type == 'dropdown') {
- $result ['form'] [$k] = $form->fields [$k]->renderGrid ( $value, $form, false, $therow );
- } else {
- $result ['form'] [$k] = $form->fields [$k]->renderGrid ( $value, $form );
- }
+ switch ($v->type) {
+ case "dropdown":
+ $result["form"][$k] = $form->fields[$k]->renderGrid($value, $form, false, $therow);
+ break;
+ case "file":
+ $result["form"][$k] = $form->fields[$k]->renderGrid($value, $form, $therow);
+ break;
+ default:
+ $result["form"][$k] = $form->fields[$k]->renderGrid($value, $form);
+ break;
+ }
}
}
}
diff --git a/workflow/engine/classes/model/map/AdditionalTablesMapBuilder.php b/workflow/engine/classes/model/map/AdditionalTablesMapBuilder.php
index d93ae322f..10e79dff7 100755
--- a/workflow/engine/classes/model/map/AdditionalTablesMapBuilder.php
+++ b/workflow/engine/classes/model/map/AdditionalTablesMapBuilder.php
@@ -16,86 +16,87 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AdditionalTablesMapBuilder {
+class AdditionalTablesMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AdditionalTablesMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AdditionalTablesMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('ADDITIONAL_TABLES');
- $tMap->setPhpName('AdditionalTables');
+ $tMap = $this->dbMap->addTable('ADDITIONAL_TABLES');
+ $tMap->setPhpName('AdditionalTables');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('ADD_TAB_UID', 'AddTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('ADD_TAB_UID', 'AddTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('ADD_TAB_NAME', 'AddTabName', 'string', CreoleTypes::VARCHAR, true, 60);
+ $tMap->addColumn('ADD_TAB_NAME', 'AddTabName', 'string', CreoleTypes::VARCHAR, true, 60);
- $tMap->addColumn('ADD_TAB_CLASS_NAME', 'AddTabClassName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('ADD_TAB_CLASS_NAME', 'AddTabClassName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('ADD_TAB_DESCRIPTION', 'AddTabDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('ADD_TAB_DESCRIPTION', 'AddTabDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('ADD_TAB_SDW_LOG_INSERT', 'AddTabSdwLogInsert', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('ADD_TAB_SDW_LOG_INSERT', 'AddTabSdwLogInsert', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('ADD_TAB_SDW_LOG_UPDATE', 'AddTabSdwLogUpdate', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('ADD_TAB_SDW_LOG_UPDATE', 'AddTabSdwLogUpdate', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('ADD_TAB_SDW_LOG_DELETE', 'AddTabSdwLogDelete', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('ADD_TAB_SDW_LOG_DELETE', 'AddTabSdwLogDelete', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('ADD_TAB_SDW_LOG_SELECT', 'AddTabSdwLogSelect', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('ADD_TAB_SDW_LOG_SELECT', 'AddTabSdwLogSelect', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('ADD_TAB_SDW_MAX_LENGTH', 'AddTabSdwMaxLength', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('ADD_TAB_SDW_MAX_LENGTH', 'AddTabSdwMaxLength', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('ADD_TAB_SDW_AUTO_DELETE', 'AddTabSdwAutoDelete', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('ADD_TAB_SDW_AUTO_DELETE', 'AddTabSdwAutoDelete', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('ADD_TAB_PLG_UID', 'AddTabPlgUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('ADD_TAB_PLG_UID', 'AddTabPlgUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('DBS_UID', 'DbsUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('DBS_UID', 'DbsUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('ADD_TAB_TYPE', 'AddTabType', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('ADD_TAB_TYPE', 'AddTabType', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('ADD_TAB_GRID', 'AddTabGrid', 'string', CreoleTypes::VARCHAR, false, 256);
+ $tMap->addColumn('ADD_TAB_GRID', 'AddTabGrid', 'string', CreoleTypes::VARCHAR, false, 256);
- $tMap->addColumn('ADD_TAB_TAG', 'AddTabTag', 'string', CreoleTypes::VARCHAR, false, 256);
+ $tMap->addColumn('ADD_TAB_TAG', 'AddTabTag', 'string', CreoleTypes::VARCHAR, false, 256);
- } // doBuild()
+ } // doBuild()
} // AdditionalTablesMapBuilder
diff --git a/workflow/engine/classes/model/map/AppCacheViewMapBuilder.php b/workflow/engine/classes/model/map/AppCacheViewMapBuilder.php
index 414bacf0b..7da73dfe4 100755
--- a/workflow/engine/classes/model/map/AppCacheViewMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppCacheViewMapBuilder.php
@@ -16,114 +16,115 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppCacheViewMapBuilder {
+class AppCacheViewMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppCacheViewMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppCacheViewMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_CACHE_VIEW');
- $tMap->setPhpName('AppCacheView');
+ $tMap = $this->dbMap->addTable('APP_CACHE_VIEW');
+ $tMap->setPhpName('AppCacheView');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PREVIOUS_USR_UID', 'PreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('PREVIOUS_USR_UID', 'PreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DEL_TASK_DUE_DATE', 'DelTaskDueDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DEL_TASK_DUE_DATE', 'DelTaskDueDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DEL_FINISH_DATE', 'DelFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DEL_FINISH_DATE', 'DelFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DEL_THREAD_STATUS', 'DelThreadStatus', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('DEL_THREAD_STATUS', 'DelThreadStatus', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('APP_THREAD_STATUS', 'AppThreadStatus', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('APP_THREAD_STATUS', 'AppThreadStatus', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('APP_TITLE', 'AppTitle', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('APP_TITLE', 'AppTitle', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('APP_PRO_TITLE', 'AppProTitle', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('APP_PRO_TITLE', 'AppProTitle', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('APP_CURRENT_USER', 'AppCurrentUser', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('APP_CURRENT_USER', 'AppCurrentUser', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addColumn('APP_DEL_PREVIOUS_USER', 'AppDelPreviousUser', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('APP_DEL_PREVIOUS_USER', 'AppDelPreviousUser', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_DURATION', 'DelDuration', 'double', CreoleTypes::DOUBLE, false, null);
+ $tMap->addColumn('DEL_DURATION', 'DelDuration', 'double', CreoleTypes::DOUBLE, false, null);
- $tMap->addColumn('DEL_QUEUE_DURATION', 'DelQueueDuration', 'double', CreoleTypes::DOUBLE, false, null);
+ $tMap->addColumn('DEL_QUEUE_DURATION', 'DelQueueDuration', 'double', CreoleTypes::DOUBLE, false, null);
- $tMap->addColumn('DEL_DELAY_DURATION', 'DelDelayDuration', 'double', CreoleTypes::DOUBLE, false, null);
+ $tMap->addColumn('DEL_DELAY_DURATION', 'DelDelayDuration', 'double', CreoleTypes::DOUBLE, false, null);
- $tMap->addColumn('DEL_STARTED', 'DelStarted', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('DEL_STARTED', 'DelStarted', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('DEL_FINISHED', 'DelFinished', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('DEL_FINISHED', 'DelFinished', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('DEL_DELAYED', 'DelDelayed', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('DEL_DELAYED', 'DelDelayed', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_OVERDUE_PERCENTAGE', 'AppOverduePercentage', 'double', CreoleTypes::DOUBLE, true, null);
+ $tMap->addColumn('APP_OVERDUE_PERCENTAGE', 'AppOverduePercentage', 'double', CreoleTypes::DOUBLE, true, null);
- } // doBuild()
+ } // doBuild()
} // AppCacheViewMapBuilder
diff --git a/workflow/engine/classes/model/map/AppDelayMapBuilder.php b/workflow/engine/classes/model/map/AppDelayMapBuilder.php
index feae37389..a30b96bcf 100755
--- a/workflow/engine/classes/model/map/AppDelayMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppDelayMapBuilder.php
@@ -16,82 +16,83 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppDelayMapBuilder {
+class AppDelayMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppDelayMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppDelayMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_DELAY');
- $tMap->setPhpName('AppDelay');
+ $tMap = $this->dbMap->addTable('APP_DELAY');
+ $tMap->setPhpName('AppDelay');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_DELAY_UID', 'AppDelayUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_DELAY_UID', 'AppDelayUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_THREAD_INDEX', 'AppThreadIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('APP_THREAD_INDEX', 'AppThreadIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_DEL_INDEX', 'AppDelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('APP_DEL_INDEX', 'AppDelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_TYPE', 'AppType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('APP_TYPE', 'AppType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('APP_NEXT_TASK', 'AppNextTask', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('APP_NEXT_TASK', 'AppNextTask', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('APP_DELEGATION_USER', 'AppDelegationUser', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('APP_DELEGATION_USER', 'AppDelegationUser', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('APP_ENABLE_ACTION_USER', 'AppEnableActionUser', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_ENABLE_ACTION_USER', 'AppEnableActionUser', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_ENABLE_ACTION_DATE', 'AppEnableActionDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_ENABLE_ACTION_DATE', 'AppEnableActionDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_DISABLE_ACTION_USER', 'AppDisableActionUser', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('APP_DISABLE_ACTION_USER', 'AppDisableActionUser', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('APP_DISABLE_ACTION_DATE', 'AppDisableActionDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('APP_DISABLE_ACTION_DATE', 'AppDisableActionDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('APP_AUTOMATIC_DISABLED_DATE', 'AppAutomaticDisabledDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('APP_AUTOMATIC_DISABLED_DATE', 'AppAutomaticDisabledDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- } // doBuild()
+ } // doBuild()
} // AppDelayMapBuilder
diff --git a/workflow/engine/classes/model/map/AppDelegationMapBuilder.php b/workflow/engine/classes/model/map/AppDelegationMapBuilder.php
index c24a2446d..8b7e39e0e 100755
--- a/workflow/engine/classes/model/map/AppDelegationMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppDelegationMapBuilder.php
@@ -16,104 +16,105 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppDelegationMapBuilder {
+class AppDelegationMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppDelegationMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppDelegationMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_DELEGATION');
- $tMap->setPhpName('AppDelegation');
+ $tMap = $this->dbMap->addTable('APP_DELEGATION');
+ $tMap->setPhpName('AppDelegation');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('DEL_PREVIOUS', 'DelPrevious', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('DEL_PREVIOUS', 'DelPrevious', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_TYPE', 'DelType', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DEL_TYPE', 'DelType', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_THREAD', 'DelThread', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('DEL_THREAD', 'DelThread', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('DEL_THREAD_STATUS', 'DelThreadStatus', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DEL_THREAD_STATUS', 'DelThreadStatus', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DEL_TASK_DUE_DATE', 'DelTaskDueDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DEL_TASK_DUE_DATE', 'DelTaskDueDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DEL_FINISH_DATE', 'DelFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DEL_FINISH_DATE', 'DelFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DEL_DURATION', 'DelDuration', 'double', CreoleTypes::DOUBLE, false, null);
+ $tMap->addColumn('DEL_DURATION', 'DelDuration', 'double', CreoleTypes::DOUBLE, false, null);
- $tMap->addColumn('DEL_QUEUE_DURATION', 'DelQueueDuration', 'double', CreoleTypes::DOUBLE, false, null);
+ $tMap->addColumn('DEL_QUEUE_DURATION', 'DelQueueDuration', 'double', CreoleTypes::DOUBLE, false, null);
- $tMap->addColumn('DEL_DELAY_DURATION', 'DelDelayDuration', 'double', CreoleTypes::DOUBLE, false, null);
+ $tMap->addColumn('DEL_DELAY_DURATION', 'DelDelayDuration', 'double', CreoleTypes::DOUBLE, false, null);
- $tMap->addColumn('DEL_STARTED', 'DelStarted', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('DEL_STARTED', 'DelStarted', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('DEL_FINISHED', 'DelFinished', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('DEL_FINISHED', 'DelFinished', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('DEL_DELAYED', 'DelDelayed', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('DEL_DELAYED', 'DelDelayed', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('DEL_DATA', 'DelData', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('DEL_DATA', 'DelData', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('APP_OVERDUE_PERCENTAGE', 'AppOverduePercentage', 'double', CreoleTypes::DOUBLE, true, null);
+ $tMap->addColumn('APP_OVERDUE_PERCENTAGE', 'AppOverduePercentage', 'double', CreoleTypes::DOUBLE, true, null);
- $tMap->addValidator('DEL_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|PARALLEL', 'Please select a valid status.');
+ $tMap->addValidator('DEL_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|PARALLEL', 'Please select a valid status.');
- $tMap->addValidator('DEL_PRIORITY', 'validValues', 'propel.validator.ValidValuesValidator', '1|2|3|4|5', 'Please select a valid Priority.');
+ $tMap->addValidator('DEL_PRIORITY', 'validValues', 'propel.validator.ValidValuesValidator', '1|2|3|4|5', 'Please select a valid Priority.');
- $tMap->addValidator('DEL_THREAD_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'CLOSED|OPEN|PAUSED', 'Please select a valid status.');
+ $tMap->addValidator('DEL_THREAD_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'CLOSED|OPEN|PAUSED', 'Please select a valid status.');
- } // doBuild()
+ } // doBuild()
} // AppDelegationMapBuilder
diff --git a/workflow/engine/classes/model/map/AppDocumentMapBuilder.php b/workflow/engine/classes/model/map/AppDocumentMapBuilder.php
index a06e47381..30df8e79c 100755
--- a/workflow/engine/classes/model/map/AppDocumentMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppDocumentMapBuilder.php
@@ -16,112 +16,115 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppDocumentMapBuilder {
+class AppDocumentMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppDocumentMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppDocumentMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_DOCUMENT');
- $tMap->setPhpName('AppDocument');
+ $tMap = $this->dbMap->addTable('APP_DOCUMENT');
+ $tMap->setPhpName('AppDocument');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_DOC_UID', 'AppDocUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_DOC_UID', 'AppDocUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('DOC_VERSION', 'DocVersion', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('DOC_VERSION', 'DocVersion', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('DOC_UID', 'DocUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DOC_UID', 'DocUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_DOC_TYPE', 'AppDocType', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_DOC_TYPE', 'AppDocType', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_DOC_CREATE_DATE', 'AppDocCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_DOC_CREATE_DATE', 'AppDocCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_DOC_INDEX', 'AppDocIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('APP_DOC_INDEX', 'AppDocIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('FOLDER_UID', 'FolderUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('FOLDER_UID', 'FolderUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('APP_DOC_PLUGIN', 'AppDocPlugin', 'string', CreoleTypes::VARCHAR, false, 150);
+ $tMap->addColumn('APP_DOC_PLUGIN', 'AppDocPlugin', 'string', CreoleTypes::VARCHAR, false, 150);
- $tMap->addColumn('APP_DOC_TAGS', 'AppDocTags', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('APP_DOC_TAGS', 'AppDocTags', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('APP_DOC_STATUS', 'AppDocStatus', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_DOC_STATUS', 'AppDocStatus', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_DOC_STATUS_DATE', 'AppDocStatusDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('APP_DOC_STATUS_DATE', 'AppDocStatusDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addValidator('APP_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Application Document UID can be no larger than 32 in size');
+ $tMap->addColumn('APP_DOC_FIELDNAME', 'AppDocFieldname', 'string', CreoleTypes::VARCHAR, false, 150);
- $tMap->addValidator('APP_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Application Document UID is required.');
+ $tMap->addValidator('APP_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Application Document UID can be no larger than 32 in size');
- $tMap->addValidator('APP_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Application UID can be no larger than 32 in size');
+ $tMap->addValidator('APP_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Application Document UID is required.');
- $tMap->addValidator('APP_UID', 'required', 'propel.validator.RequiredValidator', '', 'Application UID is required.');
+ $tMap->addValidator('APP_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Application UID can be no larger than 32 in size');
- $tMap->addValidator('DEL_INDEX', 'minValue', 'propel.validator.MinValueValidator', '1', 'Delegation Index must be greater than 0');
+ $tMap->addValidator('APP_UID', 'required', 'propel.validator.RequiredValidator', '', 'Application UID is required.');
- $tMap->addValidator('DEL_INDEX', 'required', 'propel.validator.RequiredValidator', '', 'Delegation Index is required.');
+ $tMap->addValidator('DEL_INDEX', 'minValue', 'propel.validator.MinValueValidator', '1', 'Delegation Index must be greater than 0');
- $tMap->addValidator('DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Document UID can be no larger than 32 in size');
+ $tMap->addValidator('DEL_INDEX', 'required', 'propel.validator.RequiredValidator', '', 'Delegation Index is required.');
- $tMap->addValidator('DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Document UID (building block) is required.');
+ $tMap->addValidator('DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Document UID can be no larger than 32 in size');
- $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
+ $tMap->addValidator('DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Document UID (building block) is required.');
- $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
+ $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
- $tMap->addValidator('APP_DOC_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'INPUT|OUTPUT|ATTACHED', 'Please select a valid document type.');
+ $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
- $tMap->addValidator('APP_DOC_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Application Document Type is required.');
+ $tMap->addValidator('APP_DOC_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'INPUT|OUTPUT|ATTACHED', 'Please select a valid document type.');
- $tMap->addValidator('APP_DOC_CREATE_DATE', 'required', 'propel.validator.RequiredValidator', '', 'Application Document Creation Date is required.');
+ $tMap->addValidator('APP_DOC_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Application Document Type is required.');
- $tMap->addValidator('APP_DOC_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|DELETED', 'Please select a valid document status (ACTIVE|DELETED).');
+ $tMap->addValidator('APP_DOC_CREATE_DATE', 'required', 'propel.validator.RequiredValidator', '', 'Application Document Creation Date is required.');
- $tMap->addValidator('APP_DOC_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Application Document Status is required.');
+ $tMap->addValidator('APP_DOC_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|DELETED', 'Please select a valid document status (ACTIVE|DELETED).');
- } // doBuild()
+ $tMap->addValidator('APP_DOC_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Application Document Status is required.');
+
+ } // doBuild()
} // AppDocumentMapBuilder
diff --git a/workflow/engine/classes/model/map/AppEventMapBuilder.php b/workflow/engine/classes/model/map/AppEventMapBuilder.php
index 2688ad9cf..bef35060c 100755
--- a/workflow/engine/classes/model/map/AppEventMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppEventMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppEventMapBuilder {
+class AppEventMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppEventMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppEventMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_EVENT');
- $tMap->setPhpName('AppEvent');
+ $tMap = $this->dbMap->addTable('APP_EVENT');
+ $tMap->setPhpName('AppEvent');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addPrimaryKey('EVN_UID', 'EvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('EVN_UID', 'EvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_EVN_ACTION_DATE', 'AppEvnActionDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_EVN_ACTION_DATE', 'AppEvnActionDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_EVN_ATTEMPTS', 'AppEvnAttempts', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('APP_EVN_ATTEMPTS', 'AppEvnAttempts', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('APP_EVN_LAST_EXECUTION_DATE', 'AppEvnLastExecutionDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('APP_EVN_LAST_EXECUTION_DATE', 'AppEvnLastExecutionDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('APP_EVN_STATUS', 'AppEvnStatus', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_EVN_STATUS', 'AppEvnStatus', 'string', CreoleTypes::VARCHAR, true, 32);
- } // doBuild()
+ } // doBuild()
} // AppEventMapBuilder
diff --git a/workflow/engine/classes/model/map/AppFolderMapBuilder.php b/workflow/engine/classes/model/map/AppFolderMapBuilder.php
index 0d6b557de..ef09bf21c 100755
--- a/workflow/engine/classes/model/map/AppFolderMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppFolderMapBuilder.php
@@ -16,64 +16,65 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppFolderMapBuilder {
+class AppFolderMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppFolderMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppFolderMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_FOLDER');
- $tMap->setPhpName('AppFolder');
+ $tMap = $this->dbMap->addTable('APP_FOLDER');
+ $tMap->setPhpName('AppFolder');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('FOLDER_UID', 'FolderUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('FOLDER_UID', 'FolderUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('FOLDER_PARENT_UID', 'FolderParentUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('FOLDER_PARENT_UID', 'FolderParentUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('FOLDER_NAME', 'FolderName', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('FOLDER_NAME', 'FolderName', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('FOLDER_CREATE_DATE', 'FolderCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('FOLDER_CREATE_DATE', 'FolderCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('FOLDER_UPDATE_DATE', 'FolderUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('FOLDER_UPDATE_DATE', 'FolderUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- } // doBuild()
+ } // doBuild()
} // AppFolderMapBuilder
diff --git a/workflow/engine/classes/model/map/AppHistoryMapBuilder.php b/workflow/engine/classes/model/map/AppHistoryMapBuilder.php
index 0845ecd3e..cd95ab885 100755
--- a/workflow/engine/classes/model/map/AppHistoryMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppHistoryMapBuilder.php
@@ -16,72 +16,73 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppHistoryMapBuilder {
+class AppHistoryMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppHistoryMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppHistoryMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_HISTORY');
- $tMap->setPhpName('AppHistory');
+ $tMap = $this->dbMap->addTable('APP_HISTORY');
+ $tMap->setPhpName('AppHistory');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('HISTORY_DATE', 'HistoryDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('HISTORY_DATE', 'HistoryDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('HISTORY_DATA', 'HistoryData', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('HISTORY_DATA', 'HistoryData', 'string', CreoleTypes::LONGVARCHAR, true, null);
- } // doBuild()
+ } // doBuild()
} // AppHistoryMapBuilder
diff --git a/workflow/engine/classes/model/map/AppMessageMapBuilder.php b/workflow/engine/classes/model/map/AppMessageMapBuilder.php
index a1e5af57b..53c29ff2f 100755
--- a/workflow/engine/classes/model/map/AppMessageMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppMessageMapBuilder.php
@@ -16,86 +16,87 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppMessageMapBuilder {
+class AppMessageMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppMessageMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppMessageMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_MESSAGE');
- $tMap->setPhpName('AppMessage');
+ $tMap = $this->dbMap->addTable('APP_MESSAGE');
+ $tMap->setPhpName('AppMessage');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_MSG_UID', 'AppMsgUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_MSG_UID', 'AppMsgUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('MSG_UID', 'MsgUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('MSG_UID', 'MsgUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_MSG_TYPE', 'AppMsgType', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('APP_MSG_TYPE', 'AppMsgType', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('APP_MSG_SUBJECT', 'AppMsgSubject', 'string', CreoleTypes::VARCHAR, true, 150);
+ $tMap->addColumn('APP_MSG_SUBJECT', 'AppMsgSubject', 'string', CreoleTypes::VARCHAR, true, 150);
- $tMap->addColumn('APP_MSG_FROM', 'AppMsgFrom', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('APP_MSG_FROM', 'AppMsgFrom', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('APP_MSG_TO', 'AppMsgTo', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('APP_MSG_TO', 'AppMsgTo', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('APP_MSG_BODY', 'AppMsgBody', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('APP_MSG_BODY', 'AppMsgBody', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('APP_MSG_DATE', 'AppMsgDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_MSG_DATE', 'AppMsgDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_MSG_CC', 'AppMsgCc', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('APP_MSG_CC', 'AppMsgCc', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('APP_MSG_BCC', 'AppMsgBcc', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('APP_MSG_BCC', 'AppMsgBcc', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('APP_MSG_TEMPLATE', 'AppMsgTemplate', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('APP_MSG_TEMPLATE', 'AppMsgTemplate', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('APP_MSG_STATUS', 'AppMsgStatus', 'string', CreoleTypes::VARCHAR, false, 20);
+ $tMap->addColumn('APP_MSG_STATUS', 'AppMsgStatus', 'string', CreoleTypes::VARCHAR, false, 20);
- $tMap->addColumn('APP_MSG_ATTACH', 'AppMsgAttach', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('APP_MSG_ATTACH', 'AppMsgAttach', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('APP_MSG_SEND_DATE', 'AppMsgSendDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_MSG_SEND_DATE', 'AppMsgSendDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- } // doBuild()
+ } // doBuild()
} // AppMessageMapBuilder
diff --git a/workflow/engine/classes/model/map/AppNotesMapBuilder.php b/workflow/engine/classes/model/map/AppNotesMapBuilder.php
index 917aacf65..469e66cda 100755
--- a/workflow/engine/classes/model/map/AppNotesMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppNotesMapBuilder.php
@@ -16,74 +16,75 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppNotesMapBuilder {
+class AppNotesMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppNotesMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppNotesMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_NOTES');
- $tMap->setPhpName('AppNotes');
+ $tMap = $this->dbMap->addTable('APP_NOTES');
+ $tMap->setPhpName('AppNotes');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('NOTE_DATE', 'NoteDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('NOTE_DATE', 'NoteDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('NOTE_CONTENT', 'NoteContent', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('NOTE_CONTENT', 'NoteContent', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('NOTE_TYPE', 'NoteType', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('NOTE_TYPE', 'NoteType', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('NOTE_AVAILABILITY', 'NoteAvailability', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('NOTE_AVAILABILITY', 'NoteAvailability', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('NOTE_ORIGIN_OBJ', 'NoteOriginObj', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('NOTE_ORIGIN_OBJ', 'NoteOriginObj', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('NOTE_AFFECTED_OBJ1', 'NoteAffectedObj1', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('NOTE_AFFECTED_OBJ1', 'NoteAffectedObj1', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('NOTE_AFFECTED_OBJ2', 'NoteAffectedObj2', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('NOTE_AFFECTED_OBJ2', 'NoteAffectedObj2', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('NOTE_RECIPIENTS', 'NoteRecipients', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('NOTE_RECIPIENTS', 'NoteRecipients', 'string', CreoleTypes::LONGVARCHAR, false, null);
- } // doBuild()
+ } // doBuild()
} // AppNotesMapBuilder
diff --git a/workflow/engine/classes/model/map/AppOwnerMapBuilder.php b/workflow/engine/classes/model/map/AppOwnerMapBuilder.php
index 0f345ad37..c6e8ec825 100755
--- a/workflow/engine/classes/model/map/AppOwnerMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppOwnerMapBuilder.php
@@ -16,60 +16,61 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppOwnerMapBuilder {
+class AppOwnerMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppOwnerMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppOwnerMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_OWNER');
- $tMap->setPhpName('AppOwner');
+ $tMap = $this->dbMap->addTable('APP_OWNER');
+ $tMap->setPhpName('AppOwner');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('OWN_UID', 'OwnUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('OWN_UID', 'OwnUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- } // doBuild()
+ } // doBuild()
} // AppOwnerMapBuilder
diff --git a/workflow/engine/classes/model/map/AppSolrQueueMapBuilder.php b/workflow/engine/classes/model/map/AppSolrQueueMapBuilder.php
index a29535d6f..9a7f9f2e7 100644
--- a/workflow/engine/classes/model/map/AppSolrQueueMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppSolrQueueMapBuilder.php
@@ -16,58 +16,59 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppSolrQueueMapBuilder {
+class AppSolrQueueMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppSolrQueueMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppSolrQueueMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_SOLR_QUEUE');
- $tMap->setPhpName('AppSolrQueue');
+ $tMap = $this->dbMap->addTable('APP_SOLR_QUEUE');
+ $tMap->setPhpName('AppSolrQueue');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_UPDATED', 'AppUpdated', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('APP_UPDATED', 'AppUpdated', 'int', CreoleTypes::TINYINT, true, null);
- } // doBuild()
+ } // doBuild()
} // AppSolrQueueMapBuilder
diff --git a/workflow/engine/classes/model/map/AppThreadMapBuilder.php b/workflow/engine/classes/model/map/AppThreadMapBuilder.php
index 97ea91ba4..b81e2d0ae 100755
--- a/workflow/engine/classes/model/map/AppThreadMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppThreadMapBuilder.php
@@ -16,66 +16,67 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class AppThreadMapBuilder {
+class AppThreadMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.AppThreadMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.AppThreadMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APP_THREAD');
- $tMap->setPhpName('AppThread');
+ $tMap = $this->dbMap->addTable('APP_THREAD');
+ $tMap->setPhpName('AppThread');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('APP_THREAD_INDEX', 'AppThreadIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('APP_THREAD_INDEX', 'AppThreadIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_THREAD_PARENT', 'AppThreadParent', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('APP_THREAD_PARENT', 'AppThreadParent', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_THREAD_STATUS', 'AppThreadStatus', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_THREAD_STATUS', 'AppThreadStatus', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addValidator('APP_THREAD_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'CLOSED|OPEN', 'Please select a valid status.');
+ $tMap->addValidator('APP_THREAD_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'CLOSED|OPEN', 'Please select a valid status.');
- } // doBuild()
+ } // doBuild()
} // AppThreadMapBuilder
diff --git a/workflow/engine/classes/model/map/ApplicationMapBuilder.php b/workflow/engine/classes/model/map/ApplicationMapBuilder.php
index 4000ace4e..bc0943397 100755
--- a/workflow/engine/classes/model/map/ApplicationMapBuilder.php
+++ b/workflow/engine/classes/model/map/ApplicationMapBuilder.php
@@ -16,88 +16,89 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ApplicationMapBuilder {
+class ApplicationMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ApplicationMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ApplicationMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('APPLICATION');
- $tMap->setPhpName('Application');
+ $tMap = $this->dbMap->addTable('APPLICATION');
+ $tMap->setPhpName('Application');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_PROC_STATUS', 'AppProcStatus', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('APP_PROC_STATUS', 'AppProcStatus', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('APP_PROC_CODE', 'AppProcCode', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('APP_PROC_CODE', 'AppProcCode', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('APP_PARALLEL', 'AppParallel', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_PARALLEL', 'AppParallel', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_INIT_USER', 'AppInitUser', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_INIT_USER', 'AppInitUser', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_CUR_USER', 'AppCurUser', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_CUR_USER', 'AppCurUser', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_INIT_DATE', 'AppInitDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_INIT_DATE', 'AppInitDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('APP_DATA', 'AppData', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('APP_DATA', 'AppData', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('APP_PIN', 'AppPin', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_PIN', 'AppPin', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addValidator('APP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'DRAFT|TO_DO|PAUSED|COMPLETED|CANCELLED', 'Please select a valid status.');
+ $tMap->addValidator('APP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'DRAFT|TO_DO|PAUSED|COMPLETED|CANCELLED', 'Please select a valid status.');
- } // doBuild()
+ } // doBuild()
} // ApplicationMapBuilder
diff --git a/workflow/engine/classes/model/map/CalendarAssignmentsMapBuilder.php b/workflow/engine/classes/model/map/CalendarAssignmentsMapBuilder.php
index 3b9b60e32..6081021ff 100755
--- a/workflow/engine/classes/model/map/CalendarAssignmentsMapBuilder.php
+++ b/workflow/engine/classes/model/map/CalendarAssignmentsMapBuilder.php
@@ -16,60 +16,61 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class CalendarAssignmentsMapBuilder {
+class CalendarAssignmentsMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.CalendarAssignmentsMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.CalendarAssignmentsMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CALENDAR_ASSIGNMENTS');
- $tMap->setPhpName('CalendarAssignments');
+ $tMap = $this->dbMap->addTable('CALENDAR_ASSIGNMENTS');
+ $tMap->setPhpName('CalendarAssignments');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('OBJECT_UID', 'ObjectUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('OBJECT_UID', 'ObjectUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('OBJECT_TYPE', 'ObjectType', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('OBJECT_TYPE', 'ObjectType', 'string', CreoleTypes::VARCHAR, true, 100);
- } // doBuild()
+ } // doBuild()
} // CalendarAssignmentsMapBuilder
diff --git a/workflow/engine/classes/model/map/CalendarBusinessHoursMapBuilder.php b/workflow/engine/classes/model/map/CalendarBusinessHoursMapBuilder.php
index a79d53d65..579467dd2 100755
--- a/workflow/engine/classes/model/map/CalendarBusinessHoursMapBuilder.php
+++ b/workflow/engine/classes/model/map/CalendarBusinessHoursMapBuilder.php
@@ -16,64 +16,65 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class CalendarBusinessHoursMapBuilder {
+class CalendarBusinessHoursMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.CalendarBusinessHoursMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.CalendarBusinessHoursMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CALENDAR_BUSINESS_HOURS');
- $tMap->setPhpName('CalendarBusinessHours');
+ $tMap = $this->dbMap->addTable('CALENDAR_BUSINESS_HOURS');
+ $tMap->setPhpName('CalendarBusinessHours');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('CALENDAR_BUSINESS_DAY', 'CalendarBusinessDay', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addPrimaryKey('CALENDAR_BUSINESS_DAY', 'CalendarBusinessDay', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addPrimaryKey('CALENDAR_BUSINESS_START', 'CalendarBusinessStart', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addPrimaryKey('CALENDAR_BUSINESS_START', 'CalendarBusinessStart', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addPrimaryKey('CALENDAR_BUSINESS_END', 'CalendarBusinessEnd', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addPrimaryKey('CALENDAR_BUSINESS_END', 'CalendarBusinessEnd', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addValidator('CALENDAR_BUSINESS_DAY', 'validValues', 'propel.validator.ValidValuesValidator', '0|1|2|3|4|5|6|7', 'Please select a valid Day.');
+ $tMap->addValidator('CALENDAR_BUSINESS_DAY', 'validValues', 'propel.validator.ValidValuesValidator', '0|1|2|3|4|5|6|7', 'Please select a valid Day.');
- } // doBuild()
+ } // doBuild()
} // CalendarBusinessHoursMapBuilder
diff --git a/workflow/engine/classes/model/map/CalendarDefinitionMapBuilder.php b/workflow/engine/classes/model/map/CalendarDefinitionMapBuilder.php
index 9945b7773..44b779cfc 100755
--- a/workflow/engine/classes/model/map/CalendarDefinitionMapBuilder.php
+++ b/workflow/engine/classes/model/map/CalendarDefinitionMapBuilder.php
@@ -16,70 +16,71 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class CalendarDefinitionMapBuilder {
+class CalendarDefinitionMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.CalendarDefinitionMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.CalendarDefinitionMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CALENDAR_DEFINITION');
- $tMap->setPhpName('CalendarDefinition');
+ $tMap = $this->dbMap->addTable('CALENDAR_DEFINITION');
+ $tMap->setPhpName('CalendarDefinition');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('CALENDAR_NAME', 'CalendarName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('CALENDAR_NAME', 'CalendarName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('CALENDAR_CREATE_DATE', 'CalendarCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('CALENDAR_CREATE_DATE', 'CalendarCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('CALENDAR_UPDATE_DATE', 'CalendarUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('CALENDAR_UPDATE_DATE', 'CalendarUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('CALENDAR_WORK_DAYS', 'CalendarWorkDays', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('CALENDAR_WORK_DAYS', 'CalendarWorkDays', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('CALENDAR_DESCRIPTION', 'CalendarDescription', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('CALENDAR_DESCRIPTION', 'CalendarDescription', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('CALENDAR_STATUS', 'CalendarStatus', 'string', CreoleTypes::VARCHAR, true, 8);
+ $tMap->addColumn('CALENDAR_STATUS', 'CalendarStatus', 'string', CreoleTypes::VARCHAR, true, 8);
- $tMap->addValidator('CALENDAR_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|DELETED', 'Please select a valid Calendar Status.');
+ $tMap->addValidator('CALENDAR_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|DELETED', 'Please select a valid Calendar Status.');
- } // doBuild()
+ } // doBuild()
} // CalendarDefinitionMapBuilder
diff --git a/workflow/engine/classes/model/map/CalendarHolidaysMapBuilder.php b/workflow/engine/classes/model/map/CalendarHolidaysMapBuilder.php
index a2b374ca6..a2e536057 100755
--- a/workflow/engine/classes/model/map/CalendarHolidaysMapBuilder.php
+++ b/workflow/engine/classes/model/map/CalendarHolidaysMapBuilder.php
@@ -16,62 +16,63 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class CalendarHolidaysMapBuilder {
+class CalendarHolidaysMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.CalendarHolidaysMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.CalendarHolidaysMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CALENDAR_HOLIDAYS');
- $tMap->setPhpName('CalendarHolidays');
+ $tMap = $this->dbMap->addTable('CALENDAR_HOLIDAYS');
+ $tMap->setPhpName('CalendarHolidays');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('CALENDAR_UID', 'CalendarUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('CALENDAR_HOLIDAY_NAME', 'CalendarHolidayName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addPrimaryKey('CALENDAR_HOLIDAY_NAME', 'CalendarHolidayName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('CALENDAR_HOLIDAY_START', 'CalendarHolidayStart', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('CALENDAR_HOLIDAY_START', 'CalendarHolidayStart', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('CALENDAR_HOLIDAY_END', 'CalendarHolidayEnd', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('CALENDAR_HOLIDAY_END', 'CalendarHolidayEnd', 'int', CreoleTypes::TIMESTAMP, true, null);
- } // doBuild()
+ } // doBuild()
} // CalendarHolidaysMapBuilder
diff --git a/workflow/engine/classes/model/map/CaseSchedulerMapBuilder.php b/workflow/engine/classes/model/map/CaseSchedulerMapBuilder.php
index b975c660f..86451a832 100755
--- a/workflow/engine/classes/model/map/CaseSchedulerMapBuilder.php
+++ b/workflow/engine/classes/model/map/CaseSchedulerMapBuilder.php
@@ -16,104 +16,105 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class CaseSchedulerMapBuilder {
+class CaseSchedulerMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.CaseSchedulerMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.CaseSchedulerMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CASE_SCHEDULER');
- $tMap->setPhpName('CaseScheduler');
+ $tMap = $this->dbMap->addTable('CASE_SCHEDULER');
+ $tMap->setPhpName('CaseScheduler');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('SCH_UID', 'SchUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('SCH_UID', 'SchUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SCH_DEL_USER_NAME', 'SchDelUserName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('SCH_DEL_USER_NAME', 'SchDelUserName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('SCH_DEL_USER_PASS', 'SchDelUserPass', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('SCH_DEL_USER_PASS', 'SchDelUserPass', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('SCH_DEL_USER_UID', 'SchDelUserUid', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('SCH_DEL_USER_UID', 'SchDelUserUid', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('SCH_NAME', 'SchName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('SCH_NAME', 'SchName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SCH_TIME_NEXT_RUN', 'SchTimeNextRun', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('SCH_TIME_NEXT_RUN', 'SchTimeNextRun', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('SCH_LAST_RUN_TIME', 'SchLastRunTime', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('SCH_LAST_RUN_TIME', 'SchLastRunTime', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('SCH_STATE', 'SchState', 'string', CreoleTypes::VARCHAR, true, 15);
+ $tMap->addColumn('SCH_STATE', 'SchState', 'string', CreoleTypes::VARCHAR, true, 15);
- $tMap->addColumn('SCH_LAST_STATE', 'SchLastState', 'string', CreoleTypes::VARCHAR, true, 60);
+ $tMap->addColumn('SCH_LAST_STATE', 'SchLastState', 'string', CreoleTypes::VARCHAR, true, 60);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SCH_OPTION', 'SchOption', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('SCH_OPTION', 'SchOption', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('SCH_START_TIME', 'SchStartTime', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('SCH_START_TIME', 'SchStartTime', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('SCH_START_DATE', 'SchStartDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('SCH_START_DATE', 'SchStartDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('SCH_DAYS_PERFORM_TASK', 'SchDaysPerformTask', 'string', CreoleTypes::CHAR, true, 5);
+ $tMap->addColumn('SCH_DAYS_PERFORM_TASK', 'SchDaysPerformTask', 'string', CreoleTypes::CHAR, true, 5);
- $tMap->addColumn('SCH_EVERY_DAYS', 'SchEveryDays', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('SCH_EVERY_DAYS', 'SchEveryDays', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('SCH_WEEK_DAYS', 'SchWeekDays', 'string', CreoleTypes::CHAR, true, 14);
+ $tMap->addColumn('SCH_WEEK_DAYS', 'SchWeekDays', 'string', CreoleTypes::CHAR, true, 14);
- $tMap->addColumn('SCH_START_DAY', 'SchStartDay', 'string', CreoleTypes::CHAR, true, 6);
+ $tMap->addColumn('SCH_START_DAY', 'SchStartDay', 'string', CreoleTypes::CHAR, true, 6);
- $tMap->addColumn('SCH_MONTHS', 'SchMonths', 'string', CreoleTypes::CHAR, true, 24);
+ $tMap->addColumn('SCH_MONTHS', 'SchMonths', 'string', CreoleTypes::CHAR, true, 24);
- $tMap->addColumn('SCH_END_DATE', 'SchEndDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('SCH_END_DATE', 'SchEndDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('SCH_REPEAT_EVERY', 'SchRepeatEvery', 'string', CreoleTypes::VARCHAR, true, 15);
+ $tMap->addColumn('SCH_REPEAT_EVERY', 'SchRepeatEvery', 'string', CreoleTypes::VARCHAR, true, 15);
- $tMap->addColumn('SCH_REPEAT_UNTIL', 'SchRepeatUntil', 'string', CreoleTypes::VARCHAR, true, 15);
+ $tMap->addColumn('SCH_REPEAT_UNTIL', 'SchRepeatUntil', 'string', CreoleTypes::VARCHAR, true, 15);
- $tMap->addColumn('SCH_REPEAT_STOP_IF_RUNNING', 'SchRepeatStopIfRunning', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('SCH_REPEAT_STOP_IF_RUNNING', 'SchRepeatStopIfRunning', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('CASE_SH_PLUGIN_UID', 'CaseShPluginUid', 'string', CreoleTypes::VARCHAR, false, 100);
+ $tMap->addColumn('CASE_SH_PLUGIN_UID', 'CaseShPluginUid', 'string', CreoleTypes::VARCHAR, false, 100);
- } // doBuild()
+ } // doBuild()
} // CaseSchedulerMapBuilder
diff --git a/workflow/engine/classes/model/map/CaseTrackerMapBuilder.php b/workflow/engine/classes/model/map/CaseTrackerMapBuilder.php
index c3b20b60e..a56cab43c 100755
--- a/workflow/engine/classes/model/map/CaseTrackerMapBuilder.php
+++ b/workflow/engine/classes/model/map/CaseTrackerMapBuilder.php
@@ -16,78 +16,79 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class CaseTrackerMapBuilder {
+class CaseTrackerMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.CaseTrackerMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.CaseTrackerMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CASE_TRACKER');
- $tMap->setPhpName('CaseTracker');
+ $tMap = $this->dbMap->addTable('CASE_TRACKER');
+ $tMap->setPhpName('CaseTracker');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('CT_MAP_TYPE', 'CtMapType', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('CT_MAP_TYPE', 'CtMapType', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('CT_DERIVATION_HISTORY', 'CtDerivationHistory', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('CT_DERIVATION_HISTORY', 'CtDerivationHistory', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('CT_MESSAGE_HISTORY', 'CtMessageHistory', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('CT_MESSAGE_HISTORY', 'CtMessageHistory', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('CT_MAP_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NONE|PROCESSMAP|STAGES', 'Please select a valid map type.');
+ $tMap->addValidator('CT_MAP_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NONE|PROCESSMAP|STAGES', 'Please select a valid map type.');
- $tMap->addValidator('CT_MAP_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Map type is required.');
+ $tMap->addValidator('CT_MAP_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Map type is required.');
- $tMap->addValidator('CT_DERIVATION_HISTORY', 'validValues', 'propel.validator.ValidValuesValidator', '0|1', 'Please select a valid derivation history status.');
+ $tMap->addValidator('CT_DERIVATION_HISTORY', 'validValues', 'propel.validator.ValidValuesValidator', '0|1', 'Please select a valid derivation history status.');
- $tMap->addValidator('CT_DERIVATION_HISTORY', 'required', 'propel.validator.RequiredValidator', '', 'Derivation history status is required.');
+ $tMap->addValidator('CT_DERIVATION_HISTORY', 'required', 'propel.validator.RequiredValidator', '', 'Derivation history status is required.');
- $tMap->addValidator('CT_MESSAGE_HISTORY', 'validValues', 'propel.validator.ValidValuesValidator', '0|1', 'Please select a valid message history status.');
+ $tMap->addValidator('CT_MESSAGE_HISTORY', 'validValues', 'propel.validator.ValidValuesValidator', '0|1', 'Please select a valid message history status.');
- $tMap->addValidator('CT_MESSAGE_HISTORY', 'required', 'propel.validator.RequiredValidator', '', 'Message history status is required.');
+ $tMap->addValidator('CT_MESSAGE_HISTORY', 'required', 'propel.validator.RequiredValidator', '', 'Message history status is required.');
- } // doBuild()
+ } // doBuild()
} // CaseTrackerMapBuilder
diff --git a/workflow/engine/classes/model/map/CaseTrackerObjectMapBuilder.php b/workflow/engine/classes/model/map/CaseTrackerObjectMapBuilder.php
index 5f5bb5217..894b0efc2 100755
--- a/workflow/engine/classes/model/map/CaseTrackerObjectMapBuilder.php
+++ b/workflow/engine/classes/model/map/CaseTrackerObjectMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class CaseTrackerObjectMapBuilder {
+class CaseTrackerObjectMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.CaseTrackerObjectMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.CaseTrackerObjectMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CASE_TRACKER_OBJECT');
- $tMap->setPhpName('CaseTrackerObject');
+ $tMap = $this->dbMap->addTable('CASE_TRACKER_OBJECT');
+ $tMap->setPhpName('CaseTrackerObject');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('CTO_UID', 'CtoUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('CTO_UID', 'CtoUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('CTO_TYPE_OBJ', 'CtoTypeObj', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('CTO_TYPE_OBJ', 'CtoTypeObj', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('CTO_UID_OBJ', 'CtoUidObj', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('CTO_UID_OBJ', 'CtoUidObj', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('CTO_CONDITION', 'CtoCondition', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('CTO_CONDITION', 'CtoCondition', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('CTO_POSITION', 'CtoPosition', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('CTO_POSITION', 'CtoPosition', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addValidator('CTO_TYPE_OBJ', 'validValues', 'propel.validator.ValidValuesValidator', 'DYNAFORM|INPUT_DOCUMENT|OUTPUT_DOCUMENT|MESSAGE|EXTERNAL', 'Please select a valid value for CTO_TYPE_OBJ.');
+ $tMap->addValidator('CTO_TYPE_OBJ', 'validValues', 'propel.validator.ValidValuesValidator', 'DYNAFORM|INPUT_DOCUMENT|OUTPUT_DOCUMENT|MESSAGE|EXTERNAL', 'Please select a valid value for CTO_TYPE_OBJ.');
- } // doBuild()
+ } // doBuild()
} // CaseTrackerObjectMapBuilder
diff --git a/workflow/engine/classes/model/map/ConfigurationMapBuilder.php b/workflow/engine/classes/model/map/ConfigurationMapBuilder.php
index f2495cd3d..4a9facc62 100755
--- a/workflow/engine/classes/model/map/ConfigurationMapBuilder.php
+++ b/workflow/engine/classes/model/map/ConfigurationMapBuilder.php
@@ -16,66 +16,67 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ConfigurationMapBuilder {
+class ConfigurationMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ConfigurationMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ConfigurationMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CONFIGURATION');
- $tMap->setPhpName('Configuration');
+ $tMap = $this->dbMap->addTable('CONFIGURATION');
+ $tMap->setPhpName('Configuration');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('CFG_UID', 'CfgUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('CFG_UID', 'CfgUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('OBJ_UID', 'ObjUid', 'string', CreoleTypes::VARCHAR, true, 128);
+ $tMap->addPrimaryKey('OBJ_UID', 'ObjUid', 'string', CreoleTypes::VARCHAR, true, 128);
- $tMap->addColumn('CFG_VALUE', 'CfgValue', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('CFG_VALUE', 'CfgValue', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- } // doBuild()
+ } // doBuild()
} // ConfigurationMapBuilder
diff --git a/workflow/engine/classes/model/map/ContentMapBuilder.php b/workflow/engine/classes/model/map/ContentMapBuilder.php
index 218e253d9..87bd430fe 100755
--- a/workflow/engine/classes/model/map/ContentMapBuilder.php
+++ b/workflow/engine/classes/model/map/ContentMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ContentMapBuilder {
+class ContentMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ContentMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ContentMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('CONTENT');
- $tMap->setPhpName('Content');
+ $tMap = $this->dbMap->addTable('CONTENT');
+ $tMap->setPhpName('Content');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('CON_CATEGORY', 'ConCategory', 'string', CreoleTypes::VARCHAR, true, 30);
+ $tMap->addPrimaryKey('CON_CATEGORY', 'ConCategory', 'string', CreoleTypes::VARCHAR, true, 30);
- $tMap->addPrimaryKey('CON_PARENT', 'ConParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('CON_PARENT', 'ConParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('CON_ID', 'ConId', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addPrimaryKey('CON_ID', 'ConId', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addPrimaryKey('CON_LANG', 'ConLang', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addPrimaryKey('CON_LANG', 'ConLang', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('CON_VALUE', 'ConValue', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('CON_VALUE', 'ConValue', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addValidator('CON_LANG', 'maxLength', 'propel.validator.MaxLengthValidator', '5', 'Language can be no larger than 5 in size');
+ $tMap->addValidator('CON_LANG', 'maxLength', 'propel.validator.MaxLengthValidator', '5', 'Language can be no larger than 5 in size');
- $tMap->addValidator('CON_LANG', 'required', 'propel.validator.RequiredValidator', '', 'Language is required.');
+ $tMap->addValidator('CON_LANG', 'required', 'propel.validator.RequiredValidator', '', 'Language is required.');
- } // doBuild()
+ } // doBuild()
} // ContentMapBuilder
diff --git a/workflow/engine/classes/model/map/DashletInstanceMapBuilder.php b/workflow/engine/classes/model/map/DashletInstanceMapBuilder.php
index 22ff46ab8..8b0a282d8 100644
--- a/workflow/engine/classes/model/map/DashletInstanceMapBuilder.php
+++ b/workflow/engine/classes/model/map/DashletInstanceMapBuilder.php
@@ -16,70 +16,71 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class DashletInstanceMapBuilder {
+class DashletInstanceMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.DashletInstanceMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.DashletInstanceMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('DASHLET_INSTANCE');
- $tMap->setPhpName('DashletInstance');
+ $tMap = $this->dbMap->addTable('DASHLET_INSTANCE');
+ $tMap->setPhpName('DashletInstance');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('DAS_INS_UID', 'DasInsUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('DAS_INS_UID', 'DasInsUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DAS_INS_OWNER_TYPE', 'DasInsOwnerType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('DAS_INS_OWNER_TYPE', 'DasInsOwnerType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('DAS_INS_OWNER_UID', 'DasInsOwnerUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('DAS_INS_OWNER_UID', 'DasInsOwnerUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('DAS_INS_ADDITIONAL_PROPERTIES', 'DasInsAdditionalProperties', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('DAS_INS_ADDITIONAL_PROPERTIES', 'DasInsAdditionalProperties', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('DAS_INS_CREATE_DATE', 'DasInsCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('DAS_INS_CREATE_DATE', 'DasInsCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('DAS_INS_UPDATE_DATE', 'DasInsUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DAS_INS_UPDATE_DATE', 'DasInsUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DAS_INS_STATUS', 'DasInsStatus', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('DAS_INS_STATUS', 'DasInsStatus', 'int', CreoleTypes::TINYINT, true, null);
- } // doBuild()
+ } // doBuild()
} // DashletInstanceMapBuilder
diff --git a/workflow/engine/classes/model/map/DashletMapBuilder.php b/workflow/engine/classes/model/map/DashletMapBuilder.php
index fd8f0cefd..b9f6c03d6 100644
--- a/workflow/engine/classes/model/map/DashletMapBuilder.php
+++ b/workflow/engine/classes/model/map/DashletMapBuilder.php
@@ -16,70 +16,71 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class DashletMapBuilder {
+class DashletMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.DashletMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.DashletMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('DASHLET');
- $tMap->setPhpName('Dashlet');
+ $tMap = $this->dbMap->addTable('DASHLET');
+ $tMap->setPhpName('Dashlet');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DAS_CLASS', 'DasClass', 'string', CreoleTypes::VARCHAR, true, 50);
+ $tMap->addColumn('DAS_CLASS', 'DasClass', 'string', CreoleTypes::VARCHAR, true, 50);
- $tMap->addColumn('DAS_TITLE', 'DasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('DAS_TITLE', 'DasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('DAS_DESCRIPTION', 'DasDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('DAS_DESCRIPTION', 'DasDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('DAS_VERSION', 'DasVersion', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('DAS_VERSION', 'DasVersion', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('DAS_CREATE_DATE', 'DasCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('DAS_CREATE_DATE', 'DasCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('DAS_UPDATE_DATE', 'DasUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('DAS_UPDATE_DATE', 'DasUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('DAS_STATUS', 'DasStatus', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('DAS_STATUS', 'DasStatus', 'int', CreoleTypes::TINYINT, true, null);
- } // doBuild()
+ } // doBuild()
} // DashletMapBuilder
diff --git a/workflow/engine/classes/model/map/DbSourceMapBuilder.php b/workflow/engine/classes/model/map/DbSourceMapBuilder.php
index e4ddee784..3924eb3f4 100755
--- a/workflow/engine/classes/model/map/DbSourceMapBuilder.php
+++ b/workflow/engine/classes/model/map/DbSourceMapBuilder.php
@@ -16,72 +16,73 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class DbSourceMapBuilder {
+class DbSourceMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.DbSourceMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.DbSourceMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('DB_SOURCE');
- $tMap->setPhpName('DbSource');
+ $tMap = $this->dbMap->addTable('DB_SOURCE');
+ $tMap->setPhpName('DbSource');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('DBS_UID', 'DbsUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('DBS_UID', 'DbsUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DBS_TYPE', 'DbsType', 'string', CreoleTypes::VARCHAR, true, 8);
+ $tMap->addColumn('DBS_TYPE', 'DbsType', 'string', CreoleTypes::VARCHAR, true, 8);
- $tMap->addColumn('DBS_SERVER', 'DbsServer', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('DBS_SERVER', 'DbsServer', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('DBS_DATABASE_NAME', 'DbsDatabaseName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('DBS_DATABASE_NAME', 'DbsDatabaseName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('DBS_USERNAME', 'DbsUsername', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DBS_USERNAME', 'DbsUsername', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DBS_PASSWORD', 'DbsPassword', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('DBS_PASSWORD', 'DbsPassword', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('DBS_PORT', 'DbsPort', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('DBS_PORT', 'DbsPort', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('DBS_ENCODE', 'DbsEncode', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('DBS_ENCODE', 'DbsEncode', 'string', CreoleTypes::VARCHAR, false, 32);
- } // doBuild()
+ } // doBuild()
} // DbSourceMapBuilder
diff --git a/workflow/engine/classes/model/map/DepartmentMapBuilder.php b/workflow/engine/classes/model/map/DepartmentMapBuilder.php
index 039045d59..c6dd74b92 100755
--- a/workflow/engine/classes/model/map/DepartmentMapBuilder.php
+++ b/workflow/engine/classes/model/map/DepartmentMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class DepartmentMapBuilder {
+class DepartmentMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.DepartmentMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.DepartmentMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('DEPARTMENT');
- $tMap->setPhpName('Department');
+ $tMap = $this->dbMap->addTable('DEPARTMENT');
+ $tMap->setPhpName('Department');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('DEP_UID', 'DepUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('DEP_UID', 'DepUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEP_PARENT', 'DepParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DEP_PARENT', 'DepParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEP_MANAGER', 'DepManager', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DEP_MANAGER', 'DepManager', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DEP_LOCATION', 'DepLocation', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('DEP_LOCATION', 'DepLocation', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('DEP_STATUS', 'DepStatus', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('DEP_STATUS', 'DepStatus', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('DEP_REF_CODE', 'DepRefCode', 'string', CreoleTypes::VARCHAR, true, 50);
+ $tMap->addColumn('DEP_REF_CODE', 'DepRefCode', 'string', CreoleTypes::VARCHAR, true, 50);
- $tMap->addColumn('DEP_LDAP_DN', 'DepLdapDn', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('DEP_LDAP_DN', 'DepLdapDn', 'string', CreoleTypes::VARCHAR, true, 255);
- } // doBuild()
+ } // doBuild()
} // DepartmentMapBuilder
diff --git a/workflow/engine/classes/model/map/DimTimeCompleteMapBuilder.php b/workflow/engine/classes/model/map/DimTimeCompleteMapBuilder.php
index 1056367ab..7398d9632 100755
--- a/workflow/engine/classes/model/map/DimTimeCompleteMapBuilder.php
+++ b/workflow/engine/classes/model/map/DimTimeCompleteMapBuilder.php
@@ -16,70 +16,71 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class DimTimeCompleteMapBuilder {
+class DimTimeCompleteMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.DimTimeCompleteMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.DimTimeCompleteMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('DIM_TIME_COMPLETE');
- $tMap->setPhpName('DimTimeComplete');
+ $tMap = $this->dbMap->addTable('DIM_TIME_COMPLETE');
+ $tMap->setPhpName('DimTimeComplete');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('TIME_ID', 'TimeId', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addPrimaryKey('TIME_ID', 'TimeId', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('MONTH_ID', 'MonthId', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('MONTH_ID', 'MonthId', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('QTR_ID', 'QtrId', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('QTR_ID', 'QtrId', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('YEAR_ID', 'YearId', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('YEAR_ID', 'YearId', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('MONTH_NAME', 'MonthName', 'string', CreoleTypes::VARCHAR, true, 3);
+ $tMap->addColumn('MONTH_NAME', 'MonthName', 'string', CreoleTypes::VARCHAR, true, 3);
- $tMap->addColumn('MONTH_DESC', 'MonthDesc', 'string', CreoleTypes::VARCHAR, true, 9);
+ $tMap->addColumn('MONTH_DESC', 'MonthDesc', 'string', CreoleTypes::VARCHAR, true, 9);
- $tMap->addColumn('QTR_NAME', 'QtrName', 'string', CreoleTypes::VARCHAR, true, 4);
+ $tMap->addColumn('QTR_NAME', 'QtrName', 'string', CreoleTypes::VARCHAR, true, 4);
- $tMap->addColumn('QTR_DESC', 'QtrDesc', 'string', CreoleTypes::VARCHAR, true, 9);
+ $tMap->addColumn('QTR_DESC', 'QtrDesc', 'string', CreoleTypes::VARCHAR, true, 9);
- } // doBuild()
+ } // doBuild()
} // DimTimeCompleteMapBuilder
diff --git a/workflow/engine/classes/model/map/DimTimeDelegateMapBuilder.php b/workflow/engine/classes/model/map/DimTimeDelegateMapBuilder.php
index 64a81ec87..b75ac4cac 100755
--- a/workflow/engine/classes/model/map/DimTimeDelegateMapBuilder.php
+++ b/workflow/engine/classes/model/map/DimTimeDelegateMapBuilder.php
@@ -16,70 +16,71 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class DimTimeDelegateMapBuilder {
+class DimTimeDelegateMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.DimTimeDelegateMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.DimTimeDelegateMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('DIM_TIME_DELEGATE');
- $tMap->setPhpName('DimTimeDelegate');
+ $tMap = $this->dbMap->addTable('DIM_TIME_DELEGATE');
+ $tMap->setPhpName('DimTimeDelegate');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('TIME_ID', 'TimeId', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addPrimaryKey('TIME_ID', 'TimeId', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('MONTH_ID', 'MonthId', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('MONTH_ID', 'MonthId', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('QTR_ID', 'QtrId', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('QTR_ID', 'QtrId', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('YEAR_ID', 'YearId', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('YEAR_ID', 'YearId', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('MONTH_NAME', 'MonthName', 'string', CreoleTypes::VARCHAR, true, 3);
+ $tMap->addColumn('MONTH_NAME', 'MonthName', 'string', CreoleTypes::VARCHAR, true, 3);
- $tMap->addColumn('MONTH_DESC', 'MonthDesc', 'string', CreoleTypes::VARCHAR, true, 9);
+ $tMap->addColumn('MONTH_DESC', 'MonthDesc', 'string', CreoleTypes::VARCHAR, true, 9);
- $tMap->addColumn('QTR_NAME', 'QtrName', 'string', CreoleTypes::VARCHAR, true, 4);
+ $tMap->addColumn('QTR_NAME', 'QtrName', 'string', CreoleTypes::VARCHAR, true, 4);
- $tMap->addColumn('QTR_DESC', 'QtrDesc', 'string', CreoleTypes::VARCHAR, true, 9);
+ $tMap->addColumn('QTR_DESC', 'QtrDesc', 'string', CreoleTypes::VARCHAR, true, 9);
- } // doBuild()
+ } // doBuild()
} // DimTimeDelegateMapBuilder
diff --git a/workflow/engine/classes/model/map/DynaformMapBuilder.php b/workflow/engine/classes/model/map/DynaformMapBuilder.php
index f05e1c315..9eac141b1 100755
--- a/workflow/engine/classes/model/map/DynaformMapBuilder.php
+++ b/workflow/engine/classes/model/map/DynaformMapBuilder.php
@@ -16,64 +16,65 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class DynaformMapBuilder {
+class DynaformMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.DynaformMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.DynaformMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('DYNAFORM');
- $tMap->setPhpName('Dynaform');
+ $tMap = $this->dbMap->addTable('DYNAFORM');
+ $tMap->setPhpName('Dynaform');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('DYN_TYPE', 'DynType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('DYN_TYPE', 'DynType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('DYN_FILENAME', 'DynFilename', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('DYN_FILENAME', 'DynFilename', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addValidator('DYN_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'xmlform|grid', 'Please select a valid dynaform type.');
+ $tMap->addValidator('DYN_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'xmlform|grid', 'Please select a valid dynaform type.');
- } // doBuild()
+ } // doBuild()
} // DynaformMapBuilder
diff --git a/workflow/engine/classes/model/map/EventMapBuilder.php b/workflow/engine/classes/model/map/EventMapBuilder.php
index f27943c06..1456d5807 100755
--- a/workflow/engine/classes/model/map/EventMapBuilder.php
+++ b/workflow/engine/classes/model/map/EventMapBuilder.php
@@ -16,94 +16,95 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class EventMapBuilder {
+class EventMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.EventMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.EventMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('EVENT');
- $tMap->setPhpName('Event');
+ $tMap = $this->dbMap->addTable('EVENT');
+ $tMap->setPhpName('Event');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('EVN_UID', 'EvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('EVN_UID', 'EvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('EVN_STATUS', 'EvnStatus', 'string', CreoleTypes::VARCHAR, true, 16);
+ $tMap->addColumn('EVN_STATUS', 'EvnStatus', 'string', CreoleTypes::VARCHAR, true, 16);
- $tMap->addColumn('EVN_WHEN_OCCURS', 'EvnWhenOccurs', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('EVN_WHEN_OCCURS', 'EvnWhenOccurs', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('EVN_RELATED_TO', 'EvnRelatedTo', 'string', CreoleTypes::VARCHAR, false, 16);
+ $tMap->addColumn('EVN_RELATED_TO', 'EvnRelatedTo', 'string', CreoleTypes::VARCHAR, false, 16);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('EVN_TAS_UID_FROM', 'EvnTasUidFrom', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('EVN_TAS_UID_FROM', 'EvnTasUidFrom', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('EVN_TAS_UID_TO', 'EvnTasUidTo', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('EVN_TAS_UID_TO', 'EvnTasUidTo', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('EVN_TAS_ESTIMATED_DURATION', 'EvnTasEstimatedDuration', 'double', CreoleTypes::DOUBLE, false, null);
+ $tMap->addColumn('EVN_TAS_ESTIMATED_DURATION', 'EvnTasEstimatedDuration', 'double', CreoleTypes::DOUBLE, false, null);
- $tMap->addColumn('EVN_TIME_UNIT', 'EvnTimeUnit', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('EVN_TIME_UNIT', 'EvnTimeUnit', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('EVN_WHEN', 'EvnWhen', 'double', CreoleTypes::DOUBLE, true, null);
+ $tMap->addColumn('EVN_WHEN', 'EvnWhen', 'double', CreoleTypes::DOUBLE, true, null);
- $tMap->addColumn('EVN_MAX_ATTEMPTS', 'EvnMaxAttempts', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('EVN_MAX_ATTEMPTS', 'EvnMaxAttempts', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('EVN_ACTION', 'EvnAction', 'string', CreoleTypes::VARCHAR, true, 50);
+ $tMap->addColumn('EVN_ACTION', 'EvnAction', 'string', CreoleTypes::VARCHAR, true, 50);
- $tMap->addColumn('EVN_CONDITIONS', 'EvnConditions', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('EVN_CONDITIONS', 'EvnConditions', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('EVN_ACTION_PARAMETERS', 'EvnActionParameters', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('EVN_ACTION_PARAMETERS', 'EvnActionParameters', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('TRI_UID', 'TriUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('TRI_UID', 'TriUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('EVN_POSX', 'EvnPosx', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('EVN_POSX', 'EvnPosx', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('EVN_POSY', 'EvnPosy', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('EVN_POSY', 'EvnPosy', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('EVN_TYPE', 'EvnType', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('EVN_TYPE', 'EvnType', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('TAS_EVN_UID', 'TasEvnUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('TAS_EVN_UID', 'TasEvnUid', 'string', CreoleTypes::VARCHAR, false, 32);
- } // doBuild()
+ } // doBuild()
} // EventMapBuilder
diff --git a/workflow/engine/classes/model/map/FieldConditionMapBuilder.php b/workflow/engine/classes/model/map/FieldConditionMapBuilder.php
index 90d17a858..0ed484cb8 100755
--- a/workflow/engine/classes/model/map/FieldConditionMapBuilder.php
+++ b/workflow/engine/classes/model/map/FieldConditionMapBuilder.php
@@ -16,70 +16,71 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class FieldConditionMapBuilder {
+class FieldConditionMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.FieldConditionMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.FieldConditionMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('FIELD_CONDITION');
- $tMap->setPhpName('FieldCondition');
+ $tMap = $this->dbMap->addTable('FIELD_CONDITION');
+ $tMap->setPhpName('FieldCondition');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('FCD_UID', 'FcdUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('FCD_UID', 'FcdUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('FCD_FUNCTION', 'FcdFunction', 'string', CreoleTypes::VARCHAR, true, 50);
+ $tMap->addColumn('FCD_FUNCTION', 'FcdFunction', 'string', CreoleTypes::VARCHAR, true, 50);
- $tMap->addColumn('FCD_FIELDS', 'FcdFields', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('FCD_FIELDS', 'FcdFields', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('FCD_CONDITION', 'FcdCondition', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('FCD_CONDITION', 'FcdCondition', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('FCD_EVENTS', 'FcdEvents', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('FCD_EVENTS', 'FcdEvents', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('FCD_EVENT_OWNERS', 'FcdEventOwners', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('FCD_EVENT_OWNERS', 'FcdEventOwners', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('FCD_STATUS', 'FcdStatus', 'string', CreoleTypes::VARCHAR, false, 10);
+ $tMap->addColumn('FCD_STATUS', 'FcdStatus', 'string', CreoleTypes::VARCHAR, false, 10);
- $tMap->addColumn('FCD_DYN_UID', 'FcdDynUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('FCD_DYN_UID', 'FcdDynUid', 'string', CreoleTypes::VARCHAR, true, 32);
- } // doBuild()
+ } // doBuild()
} // FieldConditionMapBuilder
diff --git a/workflow/engine/classes/model/map/FieldsMapBuilder.php b/workflow/engine/classes/model/map/FieldsMapBuilder.php
index d88f2416b..9380301fc 100755
--- a/workflow/engine/classes/model/map/FieldsMapBuilder.php
+++ b/workflow/engine/classes/model/map/FieldsMapBuilder.php
@@ -16,84 +16,85 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class FieldsMapBuilder {
+class FieldsMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.FieldsMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.FieldsMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('FIELDS');
- $tMap->setPhpName('Fields');
+ $tMap = $this->dbMap->addTable('FIELDS');
+ $tMap->setPhpName('Fields');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('FLD_UID', 'FldUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('FLD_UID', 'FldUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('ADD_TAB_UID', 'AddTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('ADD_TAB_UID', 'AddTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('FLD_INDEX', 'FldIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('FLD_INDEX', 'FldIndex', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('FLD_NAME', 'FldName', 'string', CreoleTypes::VARCHAR, true, 60);
+ $tMap->addColumn('FLD_NAME', 'FldName', 'string', CreoleTypes::VARCHAR, true, 60);
- $tMap->addColumn('FLD_DESCRIPTION', 'FldDescription', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('FLD_DESCRIPTION', 'FldDescription', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('FLD_TYPE', 'FldType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('FLD_TYPE', 'FldType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('FLD_SIZE', 'FldSize', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('FLD_SIZE', 'FldSize', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('FLD_NULL', 'FldNull', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('FLD_NULL', 'FldNull', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('FLD_AUTO_INCREMENT', 'FldAutoIncrement', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('FLD_AUTO_INCREMENT', 'FldAutoIncrement', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('FLD_KEY', 'FldKey', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('FLD_KEY', 'FldKey', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('FLD_FOREIGN_KEY', 'FldForeignKey', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('FLD_FOREIGN_KEY', 'FldForeignKey', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('FLD_FOREIGN_KEY_TABLE', 'FldForeignKeyTable', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('FLD_FOREIGN_KEY_TABLE', 'FldForeignKeyTable', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('FLD_DYN_NAME', 'FldDynName', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('FLD_DYN_NAME', 'FldDynName', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addColumn('FLD_DYN_UID', 'FldDynUid', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('FLD_DYN_UID', 'FldDynUid', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addColumn('FLD_FILTER', 'FldFilter', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('FLD_FILTER', 'FldFilter', 'int', CreoleTypes::TINYINT, false, null);
- } // doBuild()
+ } // doBuild()
} // FieldsMapBuilder
diff --git a/workflow/engine/classes/model/map/GatewayMapBuilder.php b/workflow/engine/classes/model/map/GatewayMapBuilder.php
index 3ce8267a0..a616c6be0 100755
--- a/workflow/engine/classes/model/map/GatewayMapBuilder.php
+++ b/workflow/engine/classes/model/map/GatewayMapBuilder.php
@@ -16,76 +16,77 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class GatewayMapBuilder {
+class GatewayMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.GatewayMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.GatewayMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('GATEWAY');
- $tMap->setPhpName('Gateway');
+ $tMap = $this->dbMap->addTable('GATEWAY');
+ $tMap->setPhpName('Gateway');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('GAT_UID', 'GatUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('GAT_UID', 'GatUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('GAT_NEXT_TASK', 'GatNextTask', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('GAT_NEXT_TASK', 'GatNextTask', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('GAT_X', 'GatX', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('GAT_X', 'GatX', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('GAT_Y', 'GatY', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('GAT_Y', 'GatY', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('GAT_TYPE', 'GatType', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('GAT_TYPE', 'GatType', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addValidator('GAT_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Gateway UID can be no larger than 32 in size');
+ $tMap->addValidator('GAT_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Gateway UID can be no larger than 32 in size');
- $tMap->addValidator('GAT_UID', 'required', 'propel.validator.RequiredValidator', '', 'Gateway Element UID is required.');
+ $tMap->addValidator('GAT_UID', 'required', 'propel.validator.RequiredValidator', '', 'Gateway Element UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- } // doBuild()
+ } // doBuild()
} // GatewayMapBuilder
diff --git a/workflow/engine/classes/model/map/GroupUserMapBuilder.php b/workflow/engine/classes/model/map/GroupUserMapBuilder.php
index 73662f281..8a2712ab0 100755
--- a/workflow/engine/classes/model/map/GroupUserMapBuilder.php
+++ b/workflow/engine/classes/model/map/GroupUserMapBuilder.php
@@ -16,66 +16,67 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class GroupUserMapBuilder {
+class GroupUserMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.GroupUserMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.GroupUserMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('GROUP_USER');
- $tMap->setPhpName('GroupUser');
+ $tMap = $this->dbMap->addTable('GROUP_USER');
+ $tMap->setPhpName('GroupUser');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('GRP_UID', 'GrpUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('GRP_UID', 'GrpUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addValidator('GRP_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Group UID can be no larger than 32 in size');
+ $tMap->addValidator('GRP_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Group UID can be no larger than 32 in size');
- $tMap->addValidator('GRP_UID', 'required', 'propel.validator.RequiredValidator', '', 'Group UID is required.');
+ $tMap->addValidator('GRP_UID', 'required', 'propel.validator.RequiredValidator', '', 'Group UID is required.');
- $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
+ $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
- $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
+ $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
- } // doBuild()
+ } // doBuild()
} // GroupUserMapBuilder
diff --git a/workflow/engine/classes/model/map/GroupwfMapBuilder.php b/workflow/engine/classes/model/map/GroupwfMapBuilder.php
index 42cd12fc7..a6c7bf436 100755
--- a/workflow/engine/classes/model/map/GroupwfMapBuilder.php
+++ b/workflow/engine/classes/model/map/GroupwfMapBuilder.php
@@ -16,66 +16,67 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class GroupwfMapBuilder {
+class GroupwfMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.GroupwfMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.GroupwfMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('GROUPWF');
- $tMap->setPhpName('Groupwf');
+ $tMap = $this->dbMap->addTable('GROUPWF');
+ $tMap->setPhpName('Groupwf');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('GRP_UID', 'GrpUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('GRP_UID', 'GrpUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('GRP_STATUS', 'GrpStatus', 'string', CreoleTypes::CHAR, true, 8);
+ $tMap->addColumn('GRP_STATUS', 'GrpStatus', 'string', CreoleTypes::CHAR, true, 8);
- $tMap->addColumn('GRP_LDAP_DN', 'GrpLdapDn', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('GRP_LDAP_DN', 'GrpLdapDn', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('GRP_UX', 'GrpUx', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('GRP_UX', 'GrpUx', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addValidator('GRP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE', 'Please select a valid status.');
+ $tMap->addValidator('GRP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE', 'Please select a valid status.');
- $tMap->addValidator('GRP_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Application Document UID is required.');
+ $tMap->addValidator('GRP_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Application Document UID is required.');
- } // doBuild()
+ } // doBuild()
} // GroupwfMapBuilder
diff --git a/workflow/engine/classes/model/map/HolidayMapBuilder.php b/workflow/engine/classes/model/map/HolidayMapBuilder.php
index 2e06368d4..211ade611 100755
--- a/workflow/engine/classes/model/map/HolidayMapBuilder.php
+++ b/workflow/engine/classes/model/map/HolidayMapBuilder.php
@@ -16,60 +16,61 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class HolidayMapBuilder {
+class HolidayMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.HolidayMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.HolidayMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('HOLIDAY');
- $tMap->setPhpName('Holiday');
+ $tMap = $this->dbMap->addTable('HOLIDAY');
+ $tMap->setPhpName('Holiday');
- $tMap->setUseIdGenerator(true);
+ $tMap->setUseIdGenerator(true);
- $tMap->addPrimaryKey('HLD_UID', 'HldUid', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('HLD_UID', 'HldUid', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('HLD_DATE', 'HldDate', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('HLD_DATE', 'HldDate', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('HLD_DESCRIPTION', 'HldDescription', 'string', CreoleTypes::VARCHAR, true, 200);
+ $tMap->addColumn('HLD_DESCRIPTION', 'HldDescription', 'string', CreoleTypes::VARCHAR, true, 200);
- } // doBuild()
+ } // doBuild()
} // HolidayMapBuilder
diff --git a/workflow/engine/classes/model/map/InputDocumentMapBuilder.php b/workflow/engine/classes/model/map/InputDocumentMapBuilder.php
index 605bb529e..699315a15 100755
--- a/workflow/engine/classes/model/map/InputDocumentMapBuilder.php
+++ b/workflow/engine/classes/model/map/InputDocumentMapBuilder.php
@@ -16,90 +16,91 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class InputDocumentMapBuilder {
+class InputDocumentMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.InputDocumentMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.InputDocumentMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('INPUT_DOCUMENT');
- $tMap->setPhpName('InputDocument');
+ $tMap = $this->dbMap->addTable('INPUT_DOCUMENT');
+ $tMap->setPhpName('InputDocument');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('INP_DOC_UID', 'InpDocUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('INP_DOC_UID', 'InpDocUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('INP_DOC_FORM_NEEDED', 'InpDocFormNeeded', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('INP_DOC_FORM_NEEDED', 'InpDocFormNeeded', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('INP_DOC_ORIGINAL', 'InpDocOriginal', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('INP_DOC_ORIGINAL', 'InpDocOriginal', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('INP_DOC_PUBLISHED', 'InpDocPublished', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('INP_DOC_PUBLISHED', 'InpDocPublished', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('INP_DOC_VERSIONING', 'InpDocVersioning', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('INP_DOC_VERSIONING', 'InpDocVersioning', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('INP_DOC_DESTINATION_PATH', 'InpDocDestinationPath', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('INP_DOC_DESTINATION_PATH', 'InpDocDestinationPath', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('INP_DOC_TAGS', 'InpDocTags', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('INP_DOC_TAGS', 'InpDocTags', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addValidator('INP_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Input Document UID can be no larger than 32 in size');
+ $tMap->addValidator('INP_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Input Document UID can be no larger than 32 in size');
- $tMap->addValidator('INP_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Input Document UID is required.');
+ $tMap->addValidator('INP_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Input Document UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('INP_DOC_FORM_NEEDED', 'validValues', 'propel.validator.ValidValuesValidator', 'VIRTUAL|REAL|VREAL', 'Please select a valid document format.');
+ $tMap->addValidator('INP_DOC_FORM_NEEDED', 'validValues', 'propel.validator.ValidValuesValidator', 'VIRTUAL|REAL|VREAL', 'Please select a valid document format.');
- $tMap->addValidator('INP_DOC_FORM_NEEDED', 'required', 'propel.validator.RequiredValidator', '', 'Document format is required.');
+ $tMap->addValidator('INP_DOC_FORM_NEEDED', 'required', 'propel.validator.RequiredValidator', '', 'Document format is required.');
- $tMap->addValidator('INP_DOC_ORIGINAL', 'validValues', 'propel.validator.ValidValuesValidator', 'COPY|ORIGINAL|COPYLEGAL|FINAL', 'Please select a valid document format type.');
+ $tMap->addValidator('INP_DOC_ORIGINAL', 'validValues', 'propel.validator.ValidValuesValidator', 'COPY|ORIGINAL|COPYLEGAL|FINAL', 'Please select a valid document format type.');
- $tMap->addValidator('INP_DOC_ORIGINAL', 'required', 'propel.validator.RequiredValidator', '', 'Document format type is required.');
+ $tMap->addValidator('INP_DOC_ORIGINAL', 'required', 'propel.validator.RequiredValidator', '', 'Document format type is required.');
- $tMap->addValidator('INP_DOC_PUBLISHED', 'validValues', 'propel.validator.ValidValuesValidator', 'PUBLIC|PRIVATE', 'Please select a valid document access.');
+ $tMap->addValidator('INP_DOC_PUBLISHED', 'validValues', 'propel.validator.ValidValuesValidator', 'PUBLIC|PRIVATE', 'Please select a valid document access.');
- $tMap->addValidator('INP_DOC_PUBLISHED', 'required', 'propel.validator.RequiredValidator', '', 'Document access is required.');
+ $tMap->addValidator('INP_DOC_PUBLISHED', 'required', 'propel.validator.RequiredValidator', '', 'Document access is required.');
- } // doBuild()
+ } // doBuild()
} // InputDocumentMapBuilder
diff --git a/workflow/engine/classes/model/map/IsoCountryMapBuilder.php b/workflow/engine/classes/model/map/IsoCountryMapBuilder.php
index 214a12576..d4ba23c15 100755
--- a/workflow/engine/classes/model/map/IsoCountryMapBuilder.php
+++ b/workflow/engine/classes/model/map/IsoCountryMapBuilder.php
@@ -16,60 +16,61 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class IsoCountryMapBuilder {
+class IsoCountryMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.IsoCountryMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.IsoCountryMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('ISO_COUNTRY');
- $tMap->setPhpName('IsoCountry');
+ $tMap = $this->dbMap->addTable('ISO_COUNTRY');
+ $tMap->setPhpName('IsoCountry');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('IC_UID', 'IcUid', 'string', CreoleTypes::VARCHAR, true, 2);
+ $tMap->addPrimaryKey('IC_UID', 'IcUid', 'string', CreoleTypes::VARCHAR, true, 2);
- $tMap->addColumn('IC_NAME', 'IcName', 'string', CreoleTypes::VARCHAR, false, 255);
+ $tMap->addColumn('IC_NAME', 'IcName', 'string', CreoleTypes::VARCHAR, false, 255);
- $tMap->addColumn('IC_SORT_ORDER', 'IcSortOrder', 'string', CreoleTypes::VARCHAR, false, 255);
+ $tMap->addColumn('IC_SORT_ORDER', 'IcSortOrder', 'string', CreoleTypes::VARCHAR, false, 255);
- } // doBuild()
+ } // doBuild()
} // IsoCountryMapBuilder
diff --git a/workflow/engine/classes/model/map/IsoLocationMapBuilder.php b/workflow/engine/classes/model/map/IsoLocationMapBuilder.php
index 78a94b3bd..c5aa12d7d 100755
--- a/workflow/engine/classes/model/map/IsoLocationMapBuilder.php
+++ b/workflow/engine/classes/model/map/IsoLocationMapBuilder.php
@@ -16,64 +16,65 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class IsoLocationMapBuilder {
+class IsoLocationMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.IsoLocationMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.IsoLocationMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('ISO_LOCATION');
- $tMap->setPhpName('IsoLocation');
+ $tMap = $this->dbMap->addTable('ISO_LOCATION');
+ $tMap->setPhpName('IsoLocation');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('IC_UID', 'IcUid', 'string', CreoleTypes::VARCHAR, true, 2);
+ $tMap->addPrimaryKey('IC_UID', 'IcUid', 'string', CreoleTypes::VARCHAR, true, 2);
- $tMap->addPrimaryKey('IL_UID', 'IlUid', 'string', CreoleTypes::VARCHAR, true, 5);
+ $tMap->addPrimaryKey('IL_UID', 'IlUid', 'string', CreoleTypes::VARCHAR, true, 5);
- $tMap->addColumn('IL_NAME', 'IlName', 'string', CreoleTypes::VARCHAR, false, 255);
+ $tMap->addColumn('IL_NAME', 'IlName', 'string', CreoleTypes::VARCHAR, false, 255);
- $tMap->addColumn('IL_NORMAL_NAME', 'IlNormalName', 'string', CreoleTypes::VARCHAR, false, 255);
+ $tMap->addColumn('IL_NORMAL_NAME', 'IlNormalName', 'string', CreoleTypes::VARCHAR, false, 255);
- $tMap->addColumn('IS_UID', 'IsUid', 'string', CreoleTypes::VARCHAR, false, 4);
+ $tMap->addColumn('IS_UID', 'IsUid', 'string', CreoleTypes::VARCHAR, false, 4);
- } // doBuild()
+ } // doBuild()
} // IsoLocationMapBuilder
diff --git a/workflow/engine/classes/model/map/IsoSubdivisionMapBuilder.php b/workflow/engine/classes/model/map/IsoSubdivisionMapBuilder.php
index 238b2c897..ec3c2ce25 100755
--- a/workflow/engine/classes/model/map/IsoSubdivisionMapBuilder.php
+++ b/workflow/engine/classes/model/map/IsoSubdivisionMapBuilder.php
@@ -16,60 +16,61 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class IsoSubdivisionMapBuilder {
+class IsoSubdivisionMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.IsoSubdivisionMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.IsoSubdivisionMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('ISO_SUBDIVISION');
- $tMap->setPhpName('IsoSubdivision');
+ $tMap = $this->dbMap->addTable('ISO_SUBDIVISION');
+ $tMap->setPhpName('IsoSubdivision');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('IC_UID', 'IcUid', 'string', CreoleTypes::VARCHAR, true, 2);
+ $tMap->addPrimaryKey('IC_UID', 'IcUid', 'string', CreoleTypes::VARCHAR, true, 2);
- $tMap->addPrimaryKey('IS_UID', 'IsUid', 'string', CreoleTypes::VARCHAR, true, 4);
+ $tMap->addPrimaryKey('IS_UID', 'IsUid', 'string', CreoleTypes::VARCHAR, true, 4);
- $tMap->addColumn('IS_NAME', 'IsName', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('IS_NAME', 'IsName', 'string', CreoleTypes::VARCHAR, true, 255);
- } // doBuild()
+ } // doBuild()
} // IsoSubdivisionMapBuilder
diff --git a/workflow/engine/classes/model/map/LanguageMapBuilder.php b/workflow/engine/classes/model/map/LanguageMapBuilder.php
index 91f8fd608..afa531039 100755
--- a/workflow/engine/classes/model/map/LanguageMapBuilder.php
+++ b/workflow/engine/classes/model/map/LanguageMapBuilder.php
@@ -16,76 +16,77 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class LanguageMapBuilder {
+class LanguageMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.LanguageMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.LanguageMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('LANGUAGE');
- $tMap->setPhpName('Language');
+ $tMap = $this->dbMap->addTable('LANGUAGE');
+ $tMap->setPhpName('Language');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('LAN_ID', 'LanId', 'string', CreoleTypes::VARCHAR, true, 4);
+ $tMap->addPrimaryKey('LAN_ID', 'LanId', 'string', CreoleTypes::VARCHAR, true, 4);
- $tMap->addColumn('LAN_NAME', 'LanName', 'string', CreoleTypes::VARCHAR, true, 30);
+ $tMap->addColumn('LAN_NAME', 'LanName', 'string', CreoleTypes::VARCHAR, true, 30);
- $tMap->addColumn('LAN_NATIVE_NAME', 'LanNativeName', 'string', CreoleTypes::VARCHAR, true, 30);
+ $tMap->addColumn('LAN_NATIVE_NAME', 'LanNativeName', 'string', CreoleTypes::VARCHAR, true, 30);
- $tMap->addColumn('LAN_DIRECTION', 'LanDirection', 'string', CreoleTypes::CHAR, true, 1);
+ $tMap->addColumn('LAN_DIRECTION', 'LanDirection', 'string', CreoleTypes::CHAR, true, 1);
- $tMap->addColumn('LAN_WEIGHT', 'LanWeight', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('LAN_WEIGHT', 'LanWeight', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('LAN_ENABLED', 'LanEnabled', 'string', CreoleTypes::CHAR, true, 1);
+ $tMap->addColumn('LAN_ENABLED', 'LanEnabled', 'string', CreoleTypes::CHAR, true, 1);
- $tMap->addColumn('LAN_CALENDAR', 'LanCalendar', 'string', CreoleTypes::VARCHAR, true, 30);
+ $tMap->addColumn('LAN_CALENDAR', 'LanCalendar', 'string', CreoleTypes::VARCHAR, true, 30);
- $tMap->addValidator('LAN_DIRECTION', 'validValues', 'propel.validator.ValidValuesValidator', 'L|R', 'Please select a valid Language Direccion.');
+ $tMap->addValidator('LAN_DIRECTION', 'validValues', 'propel.validator.ValidValuesValidator', 'L|R', 'Please select a valid Language Direccion.');
- $tMap->addValidator('LAN_DIRECTION', 'required', 'propel.validator.RequiredValidator', '', 'Document access is required.');
+ $tMap->addValidator('LAN_DIRECTION', 'required', 'propel.validator.RequiredValidator', '', 'Document access is required.');
- $tMap->addValidator('LAN_ENABLED', 'validValues', 'propel.validator.ValidValuesValidator', '1|0', 'Please select a valid Language Direccion.');
+ $tMap->addValidator('LAN_ENABLED', 'validValues', 'propel.validator.ValidValuesValidator', '1|0', 'Please select a valid Language Direccion.');
- $tMap->addValidator('LAN_ENABLED', 'required', 'propel.validator.RequiredValidator', '', 'Document access is required.');
+ $tMap->addValidator('LAN_ENABLED', 'required', 'propel.validator.RequiredValidator', '', 'Document access is required.');
- } // doBuild()
+ } // doBuild()
} // LanguageMapBuilder
diff --git a/workflow/engine/classes/model/map/LexicoMapBuilder.php b/workflow/engine/classes/model/map/LexicoMapBuilder.php
index f0b18a0d9..72b902353 100755
--- a/workflow/engine/classes/model/map/LexicoMapBuilder.php
+++ b/workflow/engine/classes/model/map/LexicoMapBuilder.php
@@ -16,62 +16,63 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class LexicoMapBuilder {
+class LexicoMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.LexicoMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.LexicoMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('LEXICO');
- $tMap->setPhpName('Lexico');
+ $tMap = $this->dbMap->addTable('LEXICO');
+ $tMap->setPhpName('Lexico');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('LEX_TOPIC', 'LexTopic', 'string', CreoleTypes::VARCHAR, true, 64);
+ $tMap->addPrimaryKey('LEX_TOPIC', 'LexTopic', 'string', CreoleTypes::VARCHAR, true, 64);
- $tMap->addPrimaryKey('LEX_KEY', 'LexKey', 'string', CreoleTypes::VARCHAR, true, 128);
+ $tMap->addPrimaryKey('LEX_KEY', 'LexKey', 'string', CreoleTypes::VARCHAR, true, 128);
- $tMap->addColumn('LEX_VALUE', 'LexValue', 'string', CreoleTypes::VARCHAR, true, 128);
+ $tMap->addColumn('LEX_VALUE', 'LexValue', 'string', CreoleTypes::VARCHAR, true, 128);
- $tMap->addColumn('LEX_CAPTION', 'LexCaption', 'string', CreoleTypes::VARCHAR, true, 128);
+ $tMap->addColumn('LEX_CAPTION', 'LexCaption', 'string', CreoleTypes::VARCHAR, true, 128);
- } // doBuild()
+ } // doBuild()
} // LexicoMapBuilder
diff --git a/workflow/engine/classes/model/map/LogCasesSchedulerMapBuilder.php b/workflow/engine/classes/model/map/LogCasesSchedulerMapBuilder.php
index dbc833a34..f15fa36c2 100755
--- a/workflow/engine/classes/model/map/LogCasesSchedulerMapBuilder.php
+++ b/workflow/engine/classes/model/map/LogCasesSchedulerMapBuilder.php
@@ -16,74 +16,75 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class LogCasesSchedulerMapBuilder {
+class LogCasesSchedulerMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.LogCasesSchedulerMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.LogCasesSchedulerMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('LOG_CASES_SCHEDULER');
- $tMap->setPhpName('LogCasesScheduler');
+ $tMap = $this->dbMap->addTable('LOG_CASES_SCHEDULER');
+ $tMap->setPhpName('LogCasesScheduler');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('LOG_CASE_UID', 'LogCaseUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('LOG_CASE_UID', 'LogCaseUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_NAME', 'UsrName', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_NAME', 'UsrName', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('EXEC_DATE', 'ExecDate', 'int', CreoleTypes::DATE, true, null);
+ $tMap->addColumn('EXEC_DATE', 'ExecDate', 'int', CreoleTypes::DATE, true, null);
- $tMap->addColumn('EXEC_HOUR', 'ExecHour', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('EXEC_HOUR', 'ExecHour', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('RESULT', 'Result', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('RESULT', 'Result', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SCH_UID', 'SchUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('SCH_UID', 'SchUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('WS_CREATE_CASE_STATUS', 'WsCreateCaseStatus', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('WS_CREATE_CASE_STATUS', 'WsCreateCaseStatus', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('WS_ROUTE_CASE_STATUS', 'WsRouteCaseStatus', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('WS_ROUTE_CASE_STATUS', 'WsRouteCaseStatus', 'string', CreoleTypes::LONGVARCHAR, true, null);
- } // doBuild()
+ } // doBuild()
} // LogCasesSchedulerMapBuilder
diff --git a/workflow/engine/classes/model/map/LoginLogMapBuilder.php b/workflow/engine/classes/model/map/LoginLogMapBuilder.php
index 8fff667b9..3321db105 100755
--- a/workflow/engine/classes/model/map/LoginLogMapBuilder.php
+++ b/workflow/engine/classes/model/map/LoginLogMapBuilder.php
@@ -16,70 +16,71 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class LoginLogMapBuilder {
+class LoginLogMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.LoginLogMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.LoginLogMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('LOGIN_LOG');
- $tMap->setPhpName('LoginLog');
+ $tMap = $this->dbMap->addTable('LOGIN_LOG');
+ $tMap->setPhpName('LoginLog');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('LOG_UID', 'LogUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('LOG_UID', 'LogUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('LOG_STATUS', 'LogStatus', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('LOG_STATUS', 'LogStatus', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('LOG_IP', 'LogIp', 'string', CreoleTypes::VARCHAR, true, 15);
+ $tMap->addColumn('LOG_IP', 'LogIp', 'string', CreoleTypes::VARCHAR, true, 15);
- $tMap->addColumn('LOG_SID', 'LogSid', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('LOG_SID', 'LogSid', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('LOG_INIT_DATE', 'LogInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('LOG_INIT_DATE', 'LogInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('LOG_END_DATE', 'LogEndDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('LOG_END_DATE', 'LogEndDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('LOG_CLIENT_HOSTNAME', 'LogClientHostname', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('LOG_CLIENT_HOSTNAME', 'LogClientHostname', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- } // doBuild()
+ } // doBuild()
} // LoginLogMapBuilder
diff --git a/workflow/engine/classes/model/map/ObjectPermissionMapBuilder.php b/workflow/engine/classes/model/map/ObjectPermissionMapBuilder.php
index 031ae1345..db912195d 100755
--- a/workflow/engine/classes/model/map/ObjectPermissionMapBuilder.php
+++ b/workflow/engine/classes/model/map/ObjectPermissionMapBuilder.php
@@ -16,116 +16,117 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ObjectPermissionMapBuilder {
+class ObjectPermissionMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ObjectPermissionMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ObjectPermissionMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('OBJECT_PERMISSION');
- $tMap->setPhpName('ObjectPermission');
+ $tMap = $this->dbMap->addTable('OBJECT_PERMISSION');
+ $tMap->setPhpName('ObjectPermission');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('OP_UID', 'OpUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('OP_UID', 'OpUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('OP_USER_RELATION', 'OpUserRelation', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('OP_USER_RELATION', 'OpUserRelation', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('OP_TASK_SOURCE', 'OpTaskSource', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('OP_TASK_SOURCE', 'OpTaskSource', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('OP_PARTICIPATE', 'OpParticipate', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('OP_PARTICIPATE', 'OpParticipate', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('OP_OBJ_TYPE', 'OpObjType', 'string', CreoleTypes::VARCHAR, true, 15);
+ $tMap->addColumn('OP_OBJ_TYPE', 'OpObjType', 'string', CreoleTypes::VARCHAR, true, 15);
- $tMap->addColumn('OP_OBJ_UID', 'OpObjUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('OP_OBJ_UID', 'OpObjUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('OP_ACTION', 'OpAction', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('OP_ACTION', 'OpAction', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('OP_CASE_STATUS', 'OpCaseStatus', 'string', CreoleTypes::VARCHAR, false, 10);
+ $tMap->addColumn('OP_CASE_STATUS', 'OpCaseStatus', 'string', CreoleTypes::VARCHAR, false, 10);
- $tMap->addValidator('OP_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Object permission UID can be no larger than 32 in size');
+ $tMap->addValidator('OP_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Object permission UID can be no larger than 32 in size');
- $tMap->addValidator('OP_UID', 'required', 'propel.validator.RequiredValidator', '', 'Object permission UID is required.');
+ $tMap->addValidator('OP_UID', 'required', 'propel.validator.RequiredValidator', '', 'Object permission UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('TAS_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Task UID can be no larger than 32 in size');
+ $tMap->addValidator('TAS_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Task UID can be no larger than 32 in size');
- $tMap->addValidator('TAS_UID', 'required', 'propel.validator.RequiredValidator', '', 'Task UID is required.');
+ $tMap->addValidator('TAS_UID', 'required', 'propel.validator.RequiredValidator', '', 'Task UID is required.');
- $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User or Group UID can be no larger than 32 in size');
+ $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User or Group UID can be no larger than 32 in size');
- $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User or Group UID is required.');
+ $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User or Group UID is required.');
- $tMap->addValidator('OP_USER_RELATION', 'validValues', 'propel.validator.ValidValuesValidator', '1|2', 'Please select a valid relation.');
+ $tMap->addValidator('OP_USER_RELATION', 'validValues', 'propel.validator.ValidValuesValidator', '1|2', 'Please select a valid relation.');
- $tMap->addValidator('OP_USER_RELATION', 'required', 'propel.validator.RequiredValidator', '', 'Relation is required.');
+ $tMap->addValidator('OP_USER_RELATION', 'required', 'propel.validator.RequiredValidator', '', 'Relation is required.');
- $tMap->addValidator('OP_TASK_SOURCE', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Source task UID can be no larger than 32 in size');
+ $tMap->addValidator('OP_TASK_SOURCE', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Source task UID can be no larger than 32 in size');
- $tMap->addValidator('OP_TASK_SOURCE', 'required', 'propel.validator.RequiredValidator', '', 'Source task is required.');
+ $tMap->addValidator('OP_TASK_SOURCE', 'required', 'propel.validator.RequiredValidator', '', 'Source task is required.');
- $tMap->addValidator('OP_PARTICIPATE', 'validValues', 'propel.validator.ValidValuesValidator', '0|1', 'Please select a valid participation value.');
+ $tMap->addValidator('OP_PARTICIPATE', 'validValues', 'propel.validator.ValidValuesValidator', '0|1', 'Please select a valid participation value.');
- $tMap->addValidator('OP_PARTICIPATE', 'required', 'propel.validator.RequiredValidator', '', 'Participation is required.');
+ $tMap->addValidator('OP_PARTICIPATE', 'required', 'propel.validator.RequiredValidator', '', 'Participation is required.');
- $tMap->addValidator('OP_OBJ_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '15', 'Object type can be no larger than 15 in size');
+ $tMap->addValidator('OP_OBJ_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '15', 'Object type can be no larger than 15 in size');
- $tMap->addValidator('OP_OBJ_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Object type is required.');
+ $tMap->addValidator('OP_OBJ_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Object type is required.');
- $tMap->addValidator('OP_OBJ_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Object UID can be no larger than 32 in size');
+ $tMap->addValidator('OP_OBJ_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Object UID can be no larger than 32 in size');
- $tMap->addValidator('OP_OBJ_UID', 'required', 'propel.validator.RequiredValidator', '', 'Object UID is required.');
+ $tMap->addValidator('OP_OBJ_UID', 'required', 'propel.validator.RequiredValidator', '', 'Object UID is required.');
- $tMap->addValidator('OP_ACTION', 'maxLength', 'propel.validator.MaxLengthValidator', '15', 'Action can be no larger than 15 in size');
+ $tMap->addValidator('OP_ACTION', 'maxLength', 'propel.validator.MaxLengthValidator', '15', 'Action can be no larger than 15 in size');
- $tMap->addValidator('OP_ACTION', 'required', 'propel.validator.RequiredValidator', '', 'Action is required.');
+ $tMap->addValidator('OP_ACTION', 'required', 'propel.validator.RequiredValidator', '', 'Action is required.');
- } // doBuild()
+ } // doBuild()
} // ObjectPermissionMapBuilder
diff --git a/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php b/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php
index 36cd98402..108307459 100755
--- a/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php
+++ b/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php
@@ -16,104 +16,105 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class OutputDocumentMapBuilder {
+class OutputDocumentMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.OutputDocumentMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.OutputDocumentMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('OUTPUT_DOCUMENT');
- $tMap->setPhpName('OutputDocument');
+ $tMap = $this->dbMap->addTable('OUTPUT_DOCUMENT');
+ $tMap->setPhpName('OutputDocument');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('OUT_DOC_UID', 'OutDocUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('OUT_DOC_UID', 'OutDocUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('OUT_DOC_LANDSCAPE', 'OutDocLandscape', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('OUT_DOC_LANDSCAPE', 'OutDocLandscape', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('OUT_DOC_MEDIA', 'OutDocMedia', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('OUT_DOC_MEDIA', 'OutDocMedia', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('OUT_DOC_LEFT_MARGIN', 'OutDocLeftMargin', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('OUT_DOC_LEFT_MARGIN', 'OutDocLeftMargin', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('OUT_DOC_RIGHT_MARGIN', 'OutDocRightMargin', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('OUT_DOC_RIGHT_MARGIN', 'OutDocRightMargin', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('OUT_DOC_TOP_MARGIN', 'OutDocTopMargin', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('OUT_DOC_TOP_MARGIN', 'OutDocTopMargin', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('OUT_DOC_BOTTOM_MARGIN', 'OutDocBottomMargin', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('OUT_DOC_BOTTOM_MARGIN', 'OutDocBottomMargin', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('OUT_DOC_GENERATE', 'OutDocGenerate', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('OUT_DOC_GENERATE', 'OutDocGenerate', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('OUT_DOC_TYPE', 'OutDocType', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('OUT_DOC_TYPE', 'OutDocType', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('OUT_DOC_CURRENT_REVISION', 'OutDocCurrentRevision', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('OUT_DOC_CURRENT_REVISION', 'OutDocCurrentRevision', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('OUT_DOC_FIELD_MAPPING', 'OutDocFieldMapping', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('OUT_DOC_FIELD_MAPPING', 'OutDocFieldMapping', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('OUT_DOC_VERSIONING', 'OutDocVersioning', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('OUT_DOC_VERSIONING', 'OutDocVersioning', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('OUT_DOC_DESTINATION_PATH', 'OutDocDestinationPath', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('OUT_DOC_DESTINATION_PATH', 'OutDocDestinationPath', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('OUT_DOC_TAGS', 'OutDocTags', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('OUT_DOC_TAGS', 'OutDocTags', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('OUT_DOC_PDF_SECURITY_ENABLED', 'OutDocPdfSecurityEnabled', 'int', CreoleTypes::TINYINT, false, null);
+ $tMap->addColumn('OUT_DOC_PDF_SECURITY_ENABLED', 'OutDocPdfSecurityEnabled', 'int', CreoleTypes::TINYINT, false, null);
- $tMap->addColumn('OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OutDocPdfSecurityOpenPassword', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OutDocPdfSecurityOpenPassword', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OutDocPdfSecurityOwnerPassword', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OutDocPdfSecurityOwnerPassword', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('OUT_DOC_PDF_SECURITY_PERMISSIONS', 'OutDocPdfSecurityPermissions', 'string', CreoleTypes::VARCHAR, false, 150);
+ $tMap->addColumn('OUT_DOC_PDF_SECURITY_PERMISSIONS', 'OutDocPdfSecurityPermissions', 'string', CreoleTypes::VARCHAR, false, 150);
- $tMap->addValidator('OUT_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Output Document UID can be no larger than 32 in size');
+ $tMap->addValidator('OUT_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Output Document UID can be no larger than 32 in size');
- $tMap->addValidator('OUT_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Output Document UID is required.');
+ $tMap->addValidator('OUT_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Output Document UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('OUT_DOC_GENERATE', 'validValues', 'propel.validator.ValidValuesValidator', 'BOTH|DOC|PDF', 'Please select a outputdocument.');
+ $tMap->addValidator('OUT_DOC_GENERATE', 'validValues', 'propel.validator.ValidValuesValidator', 'BOTH|DOC|PDF', 'Please select a outputdocument.');
- $tMap->addValidator('OUT_DOC_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'HTML|ITEXT|JRXML|ACROFORM', 'Please select a valid Output Document Type.');
+ $tMap->addValidator('OUT_DOC_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'HTML|ITEXT|JRXML|ACROFORM', 'Please select a valid Output Document Type.');
- } // doBuild()
+ } // doBuild()
} // OutputDocumentMapBuilder
diff --git a/workflow/engine/classes/model/map/ProcessCategoryMapBuilder.php b/workflow/engine/classes/model/map/ProcessCategoryMapBuilder.php
index 9f4852179..9ca16507a 100755
--- a/workflow/engine/classes/model/map/ProcessCategoryMapBuilder.php
+++ b/workflow/engine/classes/model/map/ProcessCategoryMapBuilder.php
@@ -16,62 +16,63 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ProcessCategoryMapBuilder {
+class ProcessCategoryMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ProcessCategoryMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ProcessCategoryMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('PROCESS_CATEGORY');
- $tMap->setPhpName('ProcessCategory');
+ $tMap = $this->dbMap->addTable('PROCESS_CATEGORY');
+ $tMap->setPhpName('ProcessCategory');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('CATEGORY_UID', 'CategoryUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('CATEGORY_UID', 'CategoryUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('CATEGORY_PARENT', 'CategoryParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('CATEGORY_PARENT', 'CategoryParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('CATEGORY_NAME', 'CategoryName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('CATEGORY_NAME', 'CategoryName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('CATEGORY_ICON', 'CategoryIcon', 'string', CreoleTypes::VARCHAR, false, 100);
+ $tMap->addColumn('CATEGORY_ICON', 'CategoryIcon', 'string', CreoleTypes::VARCHAR, false, 100);
- } // doBuild()
+ } // doBuild()
} // ProcessCategoryMapBuilder
diff --git a/workflow/engine/classes/model/map/ProcessMapBuilder.php b/workflow/engine/classes/model/map/ProcessMapBuilder.php
index 976b76e45..9ea1230b2 100755
--- a/workflow/engine/classes/model/map/ProcessMapBuilder.php
+++ b/workflow/engine/classes/model/map/ProcessMapBuilder.php
@@ -16,112 +16,113 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ProcessMapBuilder {
+class ProcessMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ProcessMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ProcessMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('PROCESS');
- $tMap->setPhpName('Process');
+ $tMap = $this->dbMap->addTable('PROCESS');
+ $tMap->setPhpName('Process');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_PARENT', 'ProParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_PARENT', 'ProParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_TIME', 'ProTime', 'double', CreoleTypes::DOUBLE, true, null);
+ $tMap->addColumn('PRO_TIME', 'ProTime', 'double', CreoleTypes::DOUBLE, true, null);
- $tMap->addColumn('PRO_TIMEUNIT', 'ProTimeunit', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('PRO_TIMEUNIT', 'ProTimeunit', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('PRO_STATUS', 'ProStatus', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('PRO_STATUS', 'ProStatus', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('PRO_TYPE_DAY', 'ProTypeDay', 'string', CreoleTypes::CHAR, true, 1);
+ $tMap->addColumn('PRO_TYPE_DAY', 'ProTypeDay', 'string', CreoleTypes::CHAR, true, 1);
- $tMap->addColumn('PRO_TYPE', 'ProType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('PRO_TYPE', 'ProType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('PRO_ASSIGNMENT', 'ProAssignment', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('PRO_ASSIGNMENT', 'ProAssignment', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('PRO_SHOW_MAP', 'ProShowMap', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('PRO_SHOW_MAP', 'ProShowMap', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('PRO_SHOW_MESSAGE', 'ProShowMessage', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('PRO_SHOW_MESSAGE', 'ProShowMessage', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('PRO_SHOW_DELEGATE', 'ProShowDelegate', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('PRO_SHOW_DELEGATE', 'ProShowDelegate', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('PRO_SHOW_DYNAFORM', 'ProShowDynaform', 'int', CreoleTypes::TINYINT, true, null);
+ $tMap->addColumn('PRO_SHOW_DYNAFORM', 'ProShowDynaform', 'int', CreoleTypes::TINYINT, true, null);
- $tMap->addColumn('PRO_CATEGORY', 'ProCategory', 'string', CreoleTypes::VARCHAR, true, 48);
+ $tMap->addColumn('PRO_CATEGORY', 'ProCategory', 'string', CreoleTypes::VARCHAR, true, 48);
- $tMap->addColumn('PRO_SUB_CATEGORY', 'ProSubCategory', 'string', CreoleTypes::VARCHAR, true, 48);
+ $tMap->addColumn('PRO_SUB_CATEGORY', 'ProSubCategory', 'string', CreoleTypes::VARCHAR, true, 48);
- $tMap->addColumn('PRO_INDUSTRY', 'ProIndustry', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('PRO_INDUSTRY', 'ProIndustry', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_UPDATE_DATE', 'ProUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('PRO_UPDATE_DATE', 'ProUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('PRO_CREATE_DATE', 'ProCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('PRO_CREATE_DATE', 'ProCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('PRO_CREATE_USER', 'ProCreateUser', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_CREATE_USER', 'ProCreateUser', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_HEIGHT', 'ProHeight', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('PRO_HEIGHT', 'ProHeight', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_WIDTH', 'ProWidth', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('PRO_WIDTH', 'ProWidth', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_TITLE_X', 'ProTitleX', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('PRO_TITLE_X', 'ProTitleX', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_TITLE_Y', 'ProTitleY', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('PRO_TITLE_Y', 'ProTitleY', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_DEBUG', 'ProDebug', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('PRO_DEBUG', 'ProDebug', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('PRO_DYNAFORMS', 'ProDynaforms', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('PRO_DYNAFORMS', 'ProDynaforms', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('PRO_DERIVATION_SCREEN_TPL', 'ProDerivationScreenTpl', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('PRO_DERIVATION_SCREEN_TPL', 'ProDerivationScreenTpl', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addValidator('PRO_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'WEEKS|MONTHS|DAYS|HOURS|MINUTES', 'Please select a valid Time Unit.');
+ $tMap->addValidator('PRO_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'WEEKS|MONTHS|DAYS|HOURS|MINUTES', 'Please select a valid Time Unit.');
- $tMap->addValidator('PRO_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|DISABLED', 'Please select a valid Process Status.');
+ $tMap->addValidator('PRO_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|DISABLED', 'Please select a valid Process Status.');
- $tMap->addValidator('PRO_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL', 'Please select a valid Process Type.');
+ $tMap->addValidator('PRO_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL', 'Please select a valid Process Type.');
- $tMap->addValidator('PRO_ASSIGNMENT', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid Process Assignment');
+ $tMap->addValidator('PRO_ASSIGNMENT', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid Process Assignment');
- } // doBuild()
+ } // doBuild()
} // ProcessMapBuilder
diff --git a/workflow/engine/classes/model/map/ProcessOwnerMapBuilder.php b/workflow/engine/classes/model/map/ProcessOwnerMapBuilder.php
index 6ddf3abd8..c0cc8f097 100755
--- a/workflow/engine/classes/model/map/ProcessOwnerMapBuilder.php
+++ b/workflow/engine/classes/model/map/ProcessOwnerMapBuilder.php
@@ -16,58 +16,59 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ProcessOwnerMapBuilder {
+class ProcessOwnerMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ProcessOwnerMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ProcessOwnerMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('PROCESS_OWNER');
- $tMap->setPhpName('ProcessOwner');
+ $tMap = $this->dbMap->addTable('PROCESS_OWNER');
+ $tMap->setPhpName('ProcessOwner');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('OWN_UID', 'OwnUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('OWN_UID', 'OwnUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- } // doBuild()
+ } // doBuild()
} // ProcessOwnerMapBuilder
diff --git a/workflow/engine/classes/model/map/ProcessUserMapBuilder.php b/workflow/engine/classes/model/map/ProcessUserMapBuilder.php
index f1e03ab74..2449166df 100755
--- a/workflow/engine/classes/model/map/ProcessUserMapBuilder.php
+++ b/workflow/engine/classes/model/map/ProcessUserMapBuilder.php
@@ -16,78 +16,79 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ProcessUserMapBuilder {
+class ProcessUserMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ProcessUserMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ProcessUserMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('PROCESS_USER');
- $tMap->setPhpName('ProcessUser');
+ $tMap = $this->dbMap->addTable('PROCESS_USER');
+ $tMap->setPhpName('ProcessUser');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('PU_UID', 'PuUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('PU_UID', 'PuUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PU_TYPE', 'PuType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('PU_TYPE', 'PuType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addValidator('PU_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process User UID can be no larger than 32 in size');
+ $tMap->addValidator('PU_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process User UID can be no larger than 32 in size');
- $tMap->addValidator('PU_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process User UID is required.');
+ $tMap->addValidator('PU_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process User UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
+ $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
- $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
+ $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
- $tMap->addValidator('PU_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '20', 'Value can be no larger than 20 in size');
+ $tMap->addValidator('PU_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '20', 'Value can be no larger than 20 in size');
- $tMap->addValidator('PU_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Value is required.');
+ $tMap->addValidator('PU_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Value is required.');
- } // doBuild()
+ } // doBuild()
} // ProcessUserMapBuilder
diff --git a/workflow/engine/classes/model/map/ReportTableMapBuilder.php b/workflow/engine/classes/model/map/ReportTableMapBuilder.php
index d609d1786..488bdbbe0 100755
--- a/workflow/engine/classes/model/map/ReportTableMapBuilder.php
+++ b/workflow/engine/classes/model/map/ReportTableMapBuilder.php
@@ -16,94 +16,95 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ReportTableMapBuilder {
+class ReportTableMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ReportTableMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ReportTableMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('REPORT_TABLE');
- $tMap->setPhpName('ReportTable');
+ $tMap = $this->dbMap->addTable('REPORT_TABLE');
+ $tMap->setPhpName('ReportTable');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('REP_TAB_UID', 'RepTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('REP_TAB_UID', 'RepTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('REP_TAB_NAME', 'RepTabName', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('REP_TAB_NAME', 'RepTabName', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('REP_TAB_TYPE', 'RepTabType', 'string', CreoleTypes::VARCHAR, true, 6);
+ $tMap->addColumn('REP_TAB_TYPE', 'RepTabType', 'string', CreoleTypes::VARCHAR, true, 6);
- $tMap->addColumn('REP_TAB_GRID', 'RepTabGrid', 'string', CreoleTypes::VARCHAR, false, 150);
+ $tMap->addColumn('REP_TAB_GRID', 'RepTabGrid', 'string', CreoleTypes::VARCHAR, false, 150);
- $tMap->addColumn('REP_TAB_CONNECTION', 'RepTabConnection', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('REP_TAB_CONNECTION', 'RepTabConnection', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('REP_TAB_CREATE_DATE', 'RepTabCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('REP_TAB_CREATE_DATE', 'RepTabCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('REP_TAB_STATUS', 'RepTabStatus', 'string', CreoleTypes::CHAR, true, 8);
+ $tMap->addColumn('REP_TAB_STATUS', 'RepTabStatus', 'string', CreoleTypes::CHAR, true, 8);
- $tMap->addValidator('REP_TAB_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Report table UID can be no larger than 32 in size');
+ $tMap->addValidator('REP_TAB_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Report table UID can be no larger than 32 in size');
- $tMap->addValidator('REP_TAB_UID', 'required', 'propel.validator.RequiredValidator', '', 'Report table UID is required.');
+ $tMap->addValidator('REP_TAB_UID', 'required', 'propel.validator.RequiredValidator', '', 'Report table UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('REP_TAB_NAME', 'maxLength', 'propel.validator.MaxLengthValidator', '100', 'Report table name can be no larger than 100 in size');
+ $tMap->addValidator('REP_TAB_NAME', 'maxLength', 'propel.validator.MaxLengthValidator', '100', 'Report table name can be no larger than 100 in size');
- $tMap->addValidator('REP_TAB_NAME', 'required', 'propel.validator.RequiredValidator', '', 'Report table name is required.');
+ $tMap->addValidator('REP_TAB_NAME', 'required', 'propel.validator.RequiredValidator', '', 'Report table name is required.');
- $tMap->addValidator('REP_TAB_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|GRID', 'Please select a valid type.');
+ $tMap->addValidator('REP_TAB_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|GRID', 'Please select a valid type.');
- $tMap->addValidator('REP_TAB_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Report table type is required.');
+ $tMap->addValidator('REP_TAB_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Report table type is required.');
- $tMap->addValidator('REP_TAB_CONNECTION', 'maxLength', 'propel.validator.MaxLengthValidator', '10', 'Report table connection can be no larger than 10 in size');
+ $tMap->addValidator('REP_TAB_CONNECTION', 'maxLength', 'propel.validator.MaxLengthValidator', '10', 'Report table connection can be no larger than 10 in size');
- $tMap->addValidator('REP_TAB_CONNECTION', 'required', 'propel.validator.RequiredValidator', '', 'Report table connection is required.');
+ $tMap->addValidator('REP_TAB_CONNECTION', 'required', 'propel.validator.RequiredValidator', '', 'Report table connection is required.');
- $tMap->addValidator('REP_TAB_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE', 'Please select a valid status.');
+ $tMap->addValidator('REP_TAB_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE', 'Please select a valid status.');
- $tMap->addValidator('REP_TAB_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Report table status is required.');
+ $tMap->addValidator('REP_TAB_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Report table status is required.');
- } // doBuild()
+ } // doBuild()
} // ReportTableMapBuilder
diff --git a/workflow/engine/classes/model/map/ReportVarMapBuilder.php b/workflow/engine/classes/model/map/ReportVarMapBuilder.php
index 2890eedf5..5db9f2362 100755
--- a/workflow/engine/classes/model/map/ReportVarMapBuilder.php
+++ b/workflow/engine/classes/model/map/ReportVarMapBuilder.php
@@ -16,80 +16,81 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ReportVarMapBuilder {
+class ReportVarMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ReportVarMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ReportVarMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('REPORT_VAR');
- $tMap->setPhpName('ReportVar');
+ $tMap = $this->dbMap->addTable('REPORT_VAR');
+ $tMap->setPhpName('ReportVar');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('REP_VAR_UID', 'RepVarUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('REP_VAR_UID', 'RepVarUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('REP_TAB_UID', 'RepTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('REP_TAB_UID', 'RepTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('REP_VAR_NAME', 'RepVarName', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('REP_VAR_NAME', 'RepVarName', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('REP_VAR_TYPE', 'RepVarType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('REP_VAR_TYPE', 'RepVarType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addValidator('REP_VAR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Report variable UID can be no larger than 32 in size');
+ $tMap->addValidator('REP_VAR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Report variable UID can be no larger than 32 in size');
- $tMap->addValidator('REP_VAR_UID', 'required', 'propel.validator.RequiredValidator', '', 'Report variable UID is required.');
+ $tMap->addValidator('REP_VAR_UID', 'required', 'propel.validator.RequiredValidator', '', 'Report variable UID is required.');
- $tMap->addValidator('REP_TAB_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Report table UID can be no larger than 32 in size');
+ $tMap->addValidator('REP_TAB_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Report table UID can be no larger than 32 in size');
- $tMap->addValidator('REP_TAB_UID', 'required', 'propel.validator.RequiredValidator', '', 'Report variable UID is required.');
+ $tMap->addValidator('REP_TAB_UID', 'required', 'propel.validator.RequiredValidator', '', 'Report variable UID is required.');
- $tMap->addValidator('REP_VAR_NAME', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'Report variable name can be no larger than 255 in size');
+ $tMap->addValidator('REP_VAR_NAME', 'maxLength', 'propel.validator.MaxLengthValidator', '255', 'Report variable name can be no larger than 255 in size');
- $tMap->addValidator('REP_VAR_NAME', 'required', 'propel.validator.RequiredValidator', '', 'Report variable name is required.');
+ $tMap->addValidator('REP_VAR_NAME', 'required', 'propel.validator.RequiredValidator', '', 'Report variable name is required.');
- $tMap->addValidator('REP_VAR_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '20', 'Report variable type can be no larger than 20 in size');
+ $tMap->addValidator('REP_VAR_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '20', 'Report variable type can be no larger than 20 in size');
- $tMap->addValidator('REP_VAR_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Report variable type is required.');
+ $tMap->addValidator('REP_VAR_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Report variable type is required.');
- } // doBuild()
+ } // doBuild()
} // ReportVarMapBuilder
diff --git a/workflow/engine/classes/model/map/RouteMapBuilder.php b/workflow/engine/classes/model/map/RouteMapBuilder.php
index d0904dc78..64d53a3d9 100755
--- a/workflow/engine/classes/model/map/RouteMapBuilder.php
+++ b/workflow/engine/classes/model/map/RouteMapBuilder.php
@@ -16,112 +16,113 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class RouteMapBuilder {
+class RouteMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.RouteMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.RouteMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('ROUTE');
- $tMap->setPhpName('Route');
+ $tMap = $this->dbMap->addTable('ROUTE');
+ $tMap->setPhpName('Route');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('ROU_UID', 'RouUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('ROU_UID', 'RouUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('ROU_PARENT', 'RouParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('ROU_PARENT', 'RouParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('ROU_NEXT_TASK', 'RouNextTask', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('ROU_NEXT_TASK', 'RouNextTask', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('ROU_CASE', 'RouCase', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('ROU_CASE', 'RouCase', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('ROU_TYPE', 'RouType', 'string', CreoleTypes::VARCHAR, true, 25);
+ $tMap->addColumn('ROU_TYPE', 'RouType', 'string', CreoleTypes::VARCHAR, true, 25);
- $tMap->addColumn('ROU_CONDITION', 'RouCondition', 'string', CreoleTypes::VARCHAR, true, 512);
+ $tMap->addColumn('ROU_CONDITION', 'RouCondition', 'string', CreoleTypes::VARCHAR, true, 512);
- $tMap->addColumn('ROU_TO_LAST_USER', 'RouToLastUser', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('ROU_TO_LAST_USER', 'RouToLastUser', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('ROU_OPTIONAL', 'RouOptional', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('ROU_OPTIONAL', 'RouOptional', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('ROU_SEND_EMAIL', 'RouSendEmail', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('ROU_SEND_EMAIL', 'RouSendEmail', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('ROU_SOURCEANCHOR', 'RouSourceanchor', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('ROU_SOURCEANCHOR', 'RouSourceanchor', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('ROU_TARGETANCHOR', 'RouTargetanchor', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('ROU_TARGETANCHOR', 'RouTargetanchor', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('ROU_TO_PORT', 'RouToPort', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('ROU_TO_PORT', 'RouToPort', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('ROU_FROM_PORT', 'RouFromPort', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('ROU_FROM_PORT', 'RouFromPort', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('ROU_EVN_UID', 'RouEvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('ROU_EVN_UID', 'RouEvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('GAT_UID', 'GatUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('GAT_UID', 'GatUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addValidator('ROU_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Route UID can be no larger than 32 in size');
+ $tMap->addValidator('ROU_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Route UID can be no larger than 32 in size');
- $tMap->addValidator('ROU_UID', 'required', 'propel.validator.RequiredValidator', '', 'Route UID is required.');
+ $tMap->addValidator('ROU_UID', 'required', 'propel.validator.RequiredValidator', '', 'Route UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('TAS_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Task UID can be no larger than 32 in size');
+ $tMap->addValidator('TAS_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Task UID can be no larger than 32 in size');
- $tMap->addValidator('TAS_UID', 'required', 'propel.validator.RequiredValidator', '', 'Task UID is required.');
+ $tMap->addValidator('TAS_UID', 'required', 'propel.validator.RequiredValidator', '', 'Task UID is required.');
- $tMap->addValidator('ROU_NEXT_TASK', 'required', 'propel.validator.RequiredValidator', '', 'Next Task UID is required.');
+ $tMap->addValidator('ROU_NEXT_TASK', 'required', 'propel.validator.RequiredValidator', '', 'Next Task UID is required.');
- $tMap->addValidator('ROU_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'SEQUENTIAL|EVALUATE|SELECT|PARALLEL|PARALLEL-BY-EVALUATION|SEC-JOIN|DISCRIMINATOR', 'Please select a valid Route Type.');
+ $tMap->addValidator('ROU_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'SEQUENTIAL|EVALUATE|SELECT|PARALLEL|PARALLEL-BY-EVALUATION|SEC-JOIN|DISCRIMINATOR', 'Please select a valid Route Type.');
- $tMap->addValidator('ROU_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Route type is required.');
+ $tMap->addValidator('ROU_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Route type is required.');
- $tMap->addValidator('ROU_TO_LAST_USER', 'validValues', 'propel.validator.ValidValuesValidator', 'FALSE|TRUE', 'Please select a valid value for ROU_TO_LAST_USER .');
+ $tMap->addValidator('ROU_TO_LAST_USER', 'validValues', 'propel.validator.ValidValuesValidator', 'FALSE|TRUE', 'Please select a valid value for ROU_TO_LAST_USER .');
- $tMap->addValidator('ROU_OPTIONAL', 'validValues', 'propel.validator.ValidValuesValidator', 'FALSE|TRUE', 'Please select a valid value for ROU_OPTIONAL .');
+ $tMap->addValidator('ROU_OPTIONAL', 'validValues', 'propel.validator.ValidValuesValidator', 'FALSE|TRUE', 'Please select a valid value for ROU_OPTIONAL .');
- $tMap->addValidator('ROU_SEND_EMAIL', 'validValues', 'propel.validator.ValidValuesValidator', 'FALSE|TRUE', 'Please select a valid value for ROU_SEND_EMAIL.');
+ $tMap->addValidator('ROU_SEND_EMAIL', 'validValues', 'propel.validator.ValidValuesValidator', 'FALSE|TRUE', 'Please select a valid value for ROU_SEND_EMAIL.');
- } // doBuild()
+ } // doBuild()
} // RouteMapBuilder
diff --git a/workflow/engine/classes/model/map/SessionMapBuilder.php b/workflow/engine/classes/model/map/SessionMapBuilder.php
index 8a41bfd87..5c6780c78 100755
--- a/workflow/engine/classes/model/map/SessionMapBuilder.php
+++ b/workflow/engine/classes/model/map/SessionMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class SessionMapBuilder {
+class SessionMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.SessionMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.SessionMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('SESSION');
- $tMap->setPhpName('Session');
+ $tMap = $this->dbMap->addTable('SESSION');
+ $tMap->setPhpName('Session');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('SES_UID', 'SesUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('SES_UID', 'SesUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SES_STATUS', 'SesStatus', 'string', CreoleTypes::VARCHAR, true, 16);
+ $tMap->addColumn('SES_STATUS', 'SesStatus', 'string', CreoleTypes::VARCHAR, true, 16);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SES_REMOTE_IP', 'SesRemoteIp', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('SES_REMOTE_IP', 'SesRemoteIp', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SES_INIT_DATE', 'SesInitDate', 'string', CreoleTypes::VARCHAR, true, 19);
+ $tMap->addColumn('SES_INIT_DATE', 'SesInitDate', 'string', CreoleTypes::VARCHAR, true, 19);
- $tMap->addColumn('SES_DUE_DATE', 'SesDueDate', 'string', CreoleTypes::VARCHAR, true, 19);
+ $tMap->addColumn('SES_DUE_DATE', 'SesDueDate', 'string', CreoleTypes::VARCHAR, true, 19);
- $tMap->addColumn('SES_END_DATE', 'SesEndDate', 'string', CreoleTypes::VARCHAR, true, 19);
+ $tMap->addColumn('SES_END_DATE', 'SesEndDate', 'string', CreoleTypes::VARCHAR, true, 19);
- } // doBuild()
+ } // doBuild()
} // SessionMapBuilder
diff --git a/workflow/engine/classes/model/map/ShadowTableMapBuilder.php b/workflow/engine/classes/model/map/ShadowTableMapBuilder.php
index 8d790521d..1624028cc 100755
--- a/workflow/engine/classes/model/map/ShadowTableMapBuilder.php
+++ b/workflow/engine/classes/model/map/ShadowTableMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class ShadowTableMapBuilder {
+class ShadowTableMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.ShadowTableMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.ShadowTableMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('SHADOW_TABLE');
- $tMap->setPhpName('ShadowTable');
+ $tMap = $this->dbMap->addTable('SHADOW_TABLE');
+ $tMap->setPhpName('ShadowTable');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('SHD_UID', 'ShdUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('SHD_UID', 'ShdUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('ADD_TAB_UID', 'AddTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('ADD_TAB_UID', 'AddTabUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SHD_ACTION', 'ShdAction', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addColumn('SHD_ACTION', 'ShdAction', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('SHD_DETAILS', 'ShdDetails', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('SHD_DETAILS', 'ShdDetails', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SHD_DATE', 'ShdDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('SHD_DATE', 'ShdDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- } // doBuild()
+ } // doBuild()
} // ShadowTableMapBuilder
diff --git a/workflow/engine/classes/model/map/StageMapBuilder.php b/workflow/engine/classes/model/map/StageMapBuilder.php
index c5c108e23..d263b0edf 100755
--- a/workflow/engine/classes/model/map/StageMapBuilder.php
+++ b/workflow/engine/classes/model/map/StageMapBuilder.php
@@ -16,64 +16,65 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class StageMapBuilder {
+class StageMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.StageMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.StageMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('STAGE');
- $tMap->setPhpName('Stage');
+ $tMap = $this->dbMap->addTable('STAGE');
+ $tMap->setPhpName('Stage');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('STG_UID', 'StgUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('STG_UID', 'StgUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('STG_POSX', 'StgPosx', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('STG_POSX', 'StgPosx', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('STG_POSY', 'StgPosy', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('STG_POSY', 'StgPosy', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('STG_INDEX', 'StgIndex', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('STG_INDEX', 'StgIndex', 'int', CreoleTypes::INTEGER, true, null);
- } // doBuild()
+ } // doBuild()
} // StageMapBuilder
diff --git a/workflow/engine/classes/model/map/StepMapBuilder.php b/workflow/engine/classes/model/map/StepMapBuilder.php
index 69623c6f6..d20008aa2 100755
--- a/workflow/engine/classes/model/map/StepMapBuilder.php
+++ b/workflow/engine/classes/model/map/StepMapBuilder.php
@@ -16,72 +16,73 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class StepMapBuilder {
+class StepMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.StepMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.StepMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('STEP');
- $tMap->setPhpName('Step');
+ $tMap = $this->dbMap->addTable('STEP');
+ $tMap->setPhpName('Step');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('STEP_UID', 'StepUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('STEP_UID', 'StepUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('STEP_TYPE_OBJ', 'StepTypeObj', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('STEP_TYPE_OBJ', 'StepTypeObj', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('STEP_UID_OBJ', 'StepUidObj', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('STEP_UID_OBJ', 'StepUidObj', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('STEP_CONDITION', 'StepCondition', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('STEP_CONDITION', 'StepCondition', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('STEP_POSITION', 'StepPosition', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('STEP_POSITION', 'StepPosition', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('STEP_MODE', 'StepMode', 'string', CreoleTypes::VARCHAR, false, 10);
+ $tMap->addColumn('STEP_MODE', 'StepMode', 'string', CreoleTypes::VARCHAR, false, 10);
- $tMap->addValidator('STEP_TYPE_OBJ', 'validValues', 'propel.validator.ValidValuesValidator', 'DYNAFORM|INPUT_DOCUMENT|MESSAGE|OUTPUT_DOCUMENT|EXTERNAL', 'Please select a valid value for STEP_TYPE_OBJ.');
+ $tMap->addValidator('STEP_TYPE_OBJ', 'validValues', 'propel.validator.ValidValuesValidator', 'DYNAFORM|INPUT_DOCUMENT|MESSAGE|OUTPUT_DOCUMENT|EXTERNAL', 'Please select a valid value for STEP_TYPE_OBJ.');
- } // doBuild()
+ } // doBuild()
} // StepMapBuilder
diff --git a/workflow/engine/classes/model/map/StepSupervisorMapBuilder.php b/workflow/engine/classes/model/map/StepSupervisorMapBuilder.php
index 002564d16..b64130e63 100755
--- a/workflow/engine/classes/model/map/StepSupervisorMapBuilder.php
+++ b/workflow/engine/classes/model/map/StepSupervisorMapBuilder.php
@@ -16,66 +16,67 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class StepSupervisorMapBuilder {
+class StepSupervisorMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.StepSupervisorMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.StepSupervisorMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('STEP_SUPERVISOR');
- $tMap->setPhpName('StepSupervisor');
+ $tMap = $this->dbMap->addTable('STEP_SUPERVISOR');
+ $tMap->setPhpName('StepSupervisor');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('STEP_UID', 'StepUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('STEP_UID', 'StepUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('STEP_TYPE_OBJ', 'StepTypeObj', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('STEP_TYPE_OBJ', 'StepTypeObj', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('STEP_UID_OBJ', 'StepUidObj', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('STEP_UID_OBJ', 'StepUidObj', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('STEP_POSITION', 'StepPosition', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('STEP_POSITION', 'StepPosition', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addValidator('STEP_TYPE_OBJ', 'validValues', 'propel.validator.ValidValuesValidator', 'DYNAFORM|INPUT_DOCUMENT|OUTPUT_DOCUMENT', 'Please select a valid value for STEP_TYPE_OBJ.');
+ $tMap->addValidator('STEP_TYPE_OBJ', 'validValues', 'propel.validator.ValidValuesValidator', 'DYNAFORM|INPUT_DOCUMENT|OUTPUT_DOCUMENT', 'Please select a valid value for STEP_TYPE_OBJ.');
- } // doBuild()
+ } // doBuild()
} // StepSupervisorMapBuilder
diff --git a/workflow/engine/classes/model/map/StepTriggerMapBuilder.php b/workflow/engine/classes/model/map/StepTriggerMapBuilder.php
index cec2f15ce..5ee3667be 100755
--- a/workflow/engine/classes/model/map/StepTriggerMapBuilder.php
+++ b/workflow/engine/classes/model/map/StepTriggerMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class StepTriggerMapBuilder {
+class StepTriggerMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.StepTriggerMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.StepTriggerMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('STEP_TRIGGER');
- $tMap->setPhpName('StepTrigger');
+ $tMap = $this->dbMap->addTable('STEP_TRIGGER');
+ $tMap->setPhpName('StepTrigger');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('STEP_UID', 'StepUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('STEP_UID', 'StepUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('TRI_UID', 'TriUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('TRI_UID', 'TriUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('ST_TYPE', 'StType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addPrimaryKey('ST_TYPE', 'StType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('ST_CONDITION', 'StCondition', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('ST_CONDITION', 'StCondition', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('ST_POSITION', 'StPosition', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('ST_POSITION', 'StPosition', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addValidator('ST_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'BEFORE|AFTER', 'Please select a valid value for Trigger Type ST_TYPE.');
+ $tMap->addValidator('ST_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'BEFORE|AFTER', 'Please select a valid value for Trigger Type ST_TYPE.');
- } // doBuild()
+ } // doBuild()
} // StepTriggerMapBuilder
diff --git a/workflow/engine/classes/model/map/SubApplicationMapBuilder.php b/workflow/engine/classes/model/map/SubApplicationMapBuilder.php
index 686cf0b5b..afde65059 100755
--- a/workflow/engine/classes/model/map/SubApplicationMapBuilder.php
+++ b/workflow/engine/classes/model/map/SubApplicationMapBuilder.php
@@ -16,74 +16,75 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class SubApplicationMapBuilder {
+class SubApplicationMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.SubApplicationMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.SubApplicationMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('SUB_APPLICATION');
- $tMap->setPhpName('SubApplication');
+ $tMap = $this->dbMap->addTable('SUB_APPLICATION');
+ $tMap->setPhpName('SubApplication');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('DEL_INDEX_PARENT', 'DelIndexParent', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('DEL_INDEX_PARENT', 'DelIndexParent', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addPrimaryKey('DEL_THREAD_PARENT', 'DelThreadParent', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('DEL_THREAD_PARENT', 'DelThreadParent', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('SA_STATUS', 'SaStatus', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('SA_STATUS', 'SaStatus', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SA_VALUES_OUT', 'SaValuesOut', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('SA_VALUES_OUT', 'SaValuesOut', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('SA_VALUES_IN', 'SaValuesIn', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('SA_VALUES_IN', 'SaValuesIn', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('SA_INIT_DATE', 'SaInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('SA_INIT_DATE', 'SaInitDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('SA_FINISH_DATE', 'SaFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('SA_FINISH_DATE', 'SaFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addValidator('SA_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|FINISHED|CANCELLED', 'Please select a valid value for SA_STATUS.');
+ $tMap->addValidator('SA_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|FINISHED|CANCELLED', 'Please select a valid value for SA_STATUS.');
- } // doBuild()
+ } // doBuild()
} // SubApplicationMapBuilder
diff --git a/workflow/engine/classes/model/map/SubProcessMapBuilder.php b/workflow/engine/classes/model/map/SubProcessMapBuilder.php
index 74f7bf69c..253564bb9 100755
--- a/workflow/engine/classes/model/map/SubProcessMapBuilder.php
+++ b/workflow/engine/classes/model/map/SubProcessMapBuilder.php
@@ -16,84 +16,85 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class SubProcessMapBuilder {
+class SubProcessMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.SubProcessMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.SubProcessMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('SUB_PROCESS');
- $tMap->setPhpName('SubProcess');
+ $tMap = $this->dbMap->addTable('SUB_PROCESS');
+ $tMap->setPhpName('SubProcess');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('SP_UID', 'SpUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('SP_UID', 'SpUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_PARENT', 'ProParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_PARENT', 'ProParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_PARENT', 'TasParent', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_PARENT', 'TasParent', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SP_TYPE', 'SpType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('SP_TYPE', 'SpType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('SP_SYNCHRONOUS', 'SpSynchronous', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('SP_SYNCHRONOUS', 'SpSynchronous', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('SP_SYNCHRONOUS_TYPE', 'SpSynchronousType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('SP_SYNCHRONOUS_TYPE', 'SpSynchronousType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('SP_SYNCHRONOUS_WAIT', 'SpSynchronousWait', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('SP_SYNCHRONOUS_WAIT', 'SpSynchronousWait', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('SP_VARIABLES_OUT', 'SpVariablesOut', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('SP_VARIABLES_OUT', 'SpVariablesOut', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('SP_VARIABLES_IN', 'SpVariablesIn', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('SP_VARIABLES_IN', 'SpVariablesIn', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addColumn('SP_GRID_IN', 'SpGridIn', 'string', CreoleTypes::VARCHAR, true, 50);
+ $tMap->addColumn('SP_GRID_IN', 'SpGridIn', 'string', CreoleTypes::VARCHAR, true, 50);
- $tMap->addValidator('SP_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'SIMPLE|MULTIPLE', 'Please select a valid value for SP_TYPE.');
+ $tMap->addValidator('SP_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'SIMPLE|MULTIPLE', 'Please select a valid value for SP_TYPE.');
- $tMap->addValidator('SP_SYNCHRONOUS', 'validValues', 'propel.validator.ValidValuesValidator', '1|0', 'Please select a valid value for SP_SYNCHRONOUS.');
+ $tMap->addValidator('SP_SYNCHRONOUS', 'validValues', 'propel.validator.ValidValuesValidator', '1|0', 'Please select a valid value for SP_SYNCHRONOUS.');
- $tMap->addValidator('SP_SYNCHRONOUS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'ALL|INSTANCES|TIME', 'Please select a valid value for SP_SYNCHRONOUS_TYPE.');
+ $tMap->addValidator('SP_SYNCHRONOUS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'ALL|INSTANCES|TIME', 'Please select a valid value for SP_SYNCHRONOUS_TYPE.');
- } // doBuild()
+ } // doBuild()
} // SubProcessMapBuilder
diff --git a/workflow/engine/classes/model/map/SwimlanesElementsMapBuilder.php b/workflow/engine/classes/model/map/SwimlanesElementsMapBuilder.php
index c1725771f..c62e59a62 100755
--- a/workflow/engine/classes/model/map/SwimlanesElementsMapBuilder.php
+++ b/workflow/engine/classes/model/map/SwimlanesElementsMapBuilder.php
@@ -16,82 +16,83 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class SwimlanesElementsMapBuilder {
+class SwimlanesElementsMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.SwimlanesElementsMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.SwimlanesElementsMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('SWIMLANES_ELEMENTS');
- $tMap->setPhpName('SwimlanesElements');
+ $tMap = $this->dbMap->addTable('SWIMLANES_ELEMENTS');
+ $tMap->setPhpName('SwimlanesElements');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('SWI_UID', 'SwiUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('SWI_UID', 'SwiUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('SWI_TYPE', 'SwiType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('SWI_TYPE', 'SwiType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('SWI_X', 'SwiX', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('SWI_X', 'SwiX', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('SWI_Y', 'SwiY', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('SWI_Y', 'SwiY', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('SWI_WIDTH', 'SwiWidth', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('SWI_WIDTH', 'SwiWidth', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('SWI_HEIGHT', 'SwiHeight', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('SWI_HEIGHT', 'SwiHeight', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('SWI_NEXT_UID', 'SwiNextUid', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('SWI_NEXT_UID', 'SwiNextUid', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addValidator('SWI_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Swimlane Element UID can be no larger than 32 in size');
+ $tMap->addValidator('SWI_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Swimlane Element UID can be no larger than 32 in size');
- $tMap->addValidator('SWI_UID', 'required', 'propel.validator.RequiredValidator', '', 'Swimlane Element UID is required.');
+ $tMap->addValidator('SWI_UID', 'required', 'propel.validator.RequiredValidator', '', 'Swimlane Element UID is required.');
- $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
+ $tMap->addValidator('PRO_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Process UID can be no larger than 32 in size');
- $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
+ $tMap->addValidator('PRO_UID', 'required', 'propel.validator.RequiredValidator', '', 'Process UID is required.');
- $tMap->addValidator('SWI_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'LINE|TEXT', 'Please select a valid Swimlane Element type.');
+ $tMap->addValidator('SWI_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'LINE|TEXT', 'Please select a valid Swimlane Element type.');
- $tMap->addValidator('SWI_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Swimlane Element type is required.');
+ $tMap->addValidator('SWI_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Swimlane Element type is required.');
- } // doBuild()
+ } // doBuild()
} // SwimlanesElementsMapBuilder
diff --git a/workflow/engine/classes/model/map/TaskMapBuilder.php b/workflow/engine/classes/model/map/TaskMapBuilder.php
index 0fa178d7b..598e3d9b6 100755
--- a/workflow/engine/classes/model/map/TaskMapBuilder.php
+++ b/workflow/engine/classes/model/map/TaskMapBuilder.php
@@ -16,174 +16,175 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class TaskMapBuilder {
+class TaskMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.TaskMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.TaskMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('TASK');
- $tMap->setPhpName('Task');
+ $tMap = $this->dbMap->addTable('TASK');
+ $tMap->setPhpName('Task');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_TYPE', 'TasType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_TYPE', 'TasType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_DURATION', 'TasDuration', 'double', CreoleTypes::DOUBLE, true, null);
+ $tMap->addColumn('TAS_DURATION', 'TasDuration', 'double', CreoleTypes::DOUBLE, true, null);
- $tMap->addColumn('TAS_DELAY_TYPE', 'TasDelayType', 'string', CreoleTypes::VARCHAR, true, 30);
+ $tMap->addColumn('TAS_DELAY_TYPE', 'TasDelayType', 'string', CreoleTypes::VARCHAR, true, 30);
- $tMap->addColumn('TAS_TEMPORIZER', 'TasTemporizer', 'double', CreoleTypes::DOUBLE, true, null);
+ $tMap->addColumn('TAS_TEMPORIZER', 'TasTemporizer', 'double', CreoleTypes::DOUBLE, true, null);
- $tMap->addColumn('TAS_TYPE_DAY', 'TasTypeDay', 'string', CreoleTypes::CHAR, true, 1);
+ $tMap->addColumn('TAS_TYPE_DAY', 'TasTypeDay', 'string', CreoleTypes::CHAR, true, 1);
- $tMap->addColumn('TAS_TIMEUNIT', 'TasTimeunit', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_TIMEUNIT', 'TasTimeunit', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_ALERT', 'TasAlert', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_ALERT', 'TasAlert', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_PRIORITY_VARIABLE', 'TasPriorityVariable', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('TAS_PRIORITY_VARIABLE', 'TasPriorityVariable', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('TAS_ASSIGN_TYPE', 'TasAssignType', 'string', CreoleTypes::VARCHAR, true, 30);
+ $tMap->addColumn('TAS_ASSIGN_TYPE', 'TasAssignType', 'string', CreoleTypes::VARCHAR, true, 30);
- $tMap->addColumn('TAS_ASSIGN_VARIABLE', 'TasAssignVariable', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('TAS_ASSIGN_VARIABLE', 'TasAssignVariable', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('TAS_MI_INSTANCE_VARIABLE', 'TasMiInstanceVariable', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('TAS_MI_INSTANCE_VARIABLE', 'TasMiInstanceVariable', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('TAS_MI_COMPLETE_VARIABLE', 'TasMiCompleteVariable', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('TAS_MI_COMPLETE_VARIABLE', 'TasMiCompleteVariable', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('TAS_ASSIGN_LOCATION', 'TasAssignLocation', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_ASSIGN_LOCATION', 'TasAssignLocation', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_ASSIGN_LOCATION_ADHOC', 'TasAssignLocationAdhoc', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_ASSIGN_LOCATION_ADHOC', 'TasAssignLocationAdhoc', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_TRANSFER_FLY', 'TasTransferFly', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_TRANSFER_FLY', 'TasTransferFly', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_LAST_ASSIGNED', 'TasLastAssigned', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_LAST_ASSIGNED', 'TasLastAssigned', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_USER', 'TasUser', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_USER', 'TasUser', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_CAN_UPLOAD', 'TasCanUpload', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_CAN_UPLOAD', 'TasCanUpload', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_VIEW_UPLOAD', 'TasViewUpload', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_VIEW_UPLOAD', 'TasViewUpload', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_VIEW_ADDITIONAL_DOCUMENTATION', 'TasViewAdditionalDocumentation', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_VIEW_ADDITIONAL_DOCUMENTATION', 'TasViewAdditionalDocumentation', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_CAN_CANCEL', 'TasCanCancel', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_CAN_CANCEL', 'TasCanCancel', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_OWNER_APP', 'TasOwnerApp', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_OWNER_APP', 'TasOwnerApp', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('STG_UID', 'StgUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('STG_UID', 'StgUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_CAN_PAUSE', 'TasCanPause', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_CAN_PAUSE', 'TasCanPause', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_CAN_SEND_MESSAGE', 'TasCanSendMessage', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_CAN_SEND_MESSAGE', 'TasCanSendMessage', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_CAN_DELETE_DOCS', 'TasCanDeleteDocs', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_CAN_DELETE_DOCS', 'TasCanDeleteDocs', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_SELF_SERVICE', 'TasSelfService', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_SELF_SERVICE', 'TasSelfService', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_START', 'TasStart', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_START', 'TasStart', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_TO_LAST_USER', 'TasToLastUser', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_TO_LAST_USER', 'TasToLastUser', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_SEND_LAST_EMAIL', 'TasSendLastEmail', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TAS_SEND_LAST_EMAIL', 'TasSendLastEmail', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TAS_DERIVATION', 'TasDerivation', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('TAS_DERIVATION', 'TasDerivation', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('TAS_POSX', 'TasPosx', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('TAS_POSX', 'TasPosx', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('TAS_POSY', 'TasPosy', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('TAS_POSY', 'TasPosy', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('TAS_WIDTH', 'TasWidth', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('TAS_WIDTH', 'TasWidth', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('TAS_HEIGHT', 'TasHeight', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addColumn('TAS_HEIGHT', 'TasHeight', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addColumn('TAS_COLOR', 'TasColor', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_COLOR', 'TasColor', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_EVN_UID', 'TasEvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_EVN_UID', 'TasEvnUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_BOUNDARY', 'TasBoundary', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('TAS_BOUNDARY', 'TasBoundary', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TAS_DERIVATION_SCREEN_TPL', 'TasDerivationScreenTpl', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('TAS_DERIVATION_SCREEN_TPL', 'TasDerivationScreenTpl', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN', 'Please select a valid value for TAS_TYPE.');
+ $tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN', 'Please select a valid value for TAS_TYPE.');
- $tMap->addValidator('TAS_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'MINUTES|HOURS|DAYS|WEEKS|MONTHS', 'Please select a valid value for TAS_TIMEUNIT.');
+ $tMap->addValidator('TAS_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'MINUTES|HOURS|DAYS|WEEKS|MONTHS', 'Please select a valid value for TAS_TIMEUNIT.');
- $tMap->addValidator('TAS_ALERT', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ALERT.');
+ $tMap->addValidator('TAS_ALERT', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ALERT.');
- $tMap->addValidator('TAS_ASSIGN_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'BALANCED|MANUAL|EVALUATE|REPORT_TO|SELF_SERVICE|STATIC_MI|CANCEL_MI', 'Please select a valid value for TAS_ASSIGN_TYPE.');
+ $tMap->addValidator('TAS_ASSIGN_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'BALANCED|MANUAL|EVALUATE|REPORT_TO|SELF_SERVICE|STATIC_MI|CANCEL_MI', 'Please select a valid value for TAS_ASSIGN_TYPE.');
- $tMap->addValidator('TAS_ASSIGN_LOCATION', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ASSIGN_LOCATION.');
+ $tMap->addValidator('TAS_ASSIGN_LOCATION', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ASSIGN_LOCATION.');
- $tMap->addValidator('TAS_ASSIGN_LOCATION_ADHOC', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ASSIGN_LOCATION_ADHOC.');
+ $tMap->addValidator('TAS_ASSIGN_LOCATION_ADHOC', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_ASSIGN_LOCATION_ADHOC.');
- $tMap->addValidator('TAS_TRANSFER_FLY', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_TRANSFER_FLY.');
+ $tMap->addValidator('TAS_TRANSFER_FLY', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_TRANSFER_FLY.');
- $tMap->addValidator('TAS_CAN_UPLOAD', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_UPLOAD.');
+ $tMap->addValidator('TAS_CAN_UPLOAD', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_UPLOAD.');
- $tMap->addValidator('TAS_VIEW_UPLOAD', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_VIEW_UPLOAD.');
+ $tMap->addValidator('TAS_VIEW_UPLOAD', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_VIEW_UPLOAD.');
- $tMap->addValidator('TAS_VIEW_ADDITIONAL_DOCUMENTATION', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_VIEW_ADDITIONAL_DOCUMENTATION.');
+ $tMap->addValidator('TAS_VIEW_ADDITIONAL_DOCUMENTATION', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_VIEW_ADDITIONAL_DOCUMENTATION.');
- $tMap->addValidator('TAS_CAN_CANCEL', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_CANCEL.');
+ $tMap->addValidator('TAS_CAN_CANCEL', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_CANCEL.');
- $tMap->addValidator('TAS_CAN_PAUSE', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_PAUSE.');
+ $tMap->addValidator('TAS_CAN_PAUSE', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_PAUSE.');
- $tMap->addValidator('TAS_CAN_SEND_MESSAGE', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_SEND_MESSAGE.');
+ $tMap->addValidator('TAS_CAN_SEND_MESSAGE', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_CAN_SEND_MESSAGE.');
- $tMap->addValidator('TAS_CAN_DELETE_DOCS', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|VIEW|FALSE', 'Please select a valid value for TAS_CAN_DELETE_DOCS.');
+ $tMap->addValidator('TAS_CAN_DELETE_DOCS', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|VIEW|FALSE', 'Please select a valid value for TAS_CAN_DELETE_DOCS.');
- $tMap->addValidator('TAS_SELF_SERVICE', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_SELF_SERVICE.');
+ $tMap->addValidator('TAS_SELF_SERVICE', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_SELF_SERVICE.');
- $tMap->addValidator('TAS_START', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_START.');
+ $tMap->addValidator('TAS_START', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_START.');
- $tMap->addValidator('TAS_TO_LAST_USER', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_TO_LAST_USER.');
+ $tMap->addValidator('TAS_TO_LAST_USER', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_TO_LAST_USER.');
- $tMap->addValidator('TAS_SEND_LAST_EMAIL', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_SEND_LAST_EMAIL.');
+ $tMap->addValidator('TAS_SEND_LAST_EMAIL', 'validValues', 'propel.validator.ValidValuesValidator', 'TRUE|FALSE', 'Please select a valid value for TAS_SEND_LAST_EMAIL.');
- $tMap->addValidator('TAS_DERIVATION', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|FAST|AUTOMATIC', 'Please select a valid value for TAS_DERIVATION.');
+ $tMap->addValidator('TAS_DERIVATION', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|FAST|AUTOMATIC', 'Please select a valid value for TAS_DERIVATION.');
- } // doBuild()
+ } // doBuild()
} // TaskMapBuilder
diff --git a/workflow/engine/classes/model/map/TaskUserMapBuilder.php b/workflow/engine/classes/model/map/TaskUserMapBuilder.php
index 31b7aa2c6..fdca38ebd 100755
--- a/workflow/engine/classes/model/map/TaskUserMapBuilder.php
+++ b/workflow/engine/classes/model/map/TaskUserMapBuilder.php
@@ -16,78 +16,79 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class TaskUserMapBuilder {
+class TaskUserMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.TaskUserMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.TaskUserMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('TASK_USER');
- $tMap->setPhpName('TaskUser');
+ $tMap = $this->dbMap->addTable('TASK_USER');
+ $tMap->setPhpName('TaskUser');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addPrimaryKey('TU_TYPE', 'TuType', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('TU_TYPE', 'TuType', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addPrimaryKey('TU_RELATION', 'TuRelation', 'int', CreoleTypes::INTEGER, true, null);
+ $tMap->addPrimaryKey('TU_RELATION', 'TuRelation', 'int', CreoleTypes::INTEGER, true, null);
- $tMap->addValidator('TAS_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Task UID can be no larger than 32 in size');
+ $tMap->addValidator('TAS_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Task UID can be no larger than 32 in size');
- $tMap->addValidator('TAS_UID', 'required', 'propel.validator.RequiredValidator', '', 'Task UID is required.');
+ $tMap->addValidator('TAS_UID', 'required', 'propel.validator.RequiredValidator', '', 'Task UID is required.');
- $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
+ $tMap->addValidator('USR_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'User UID can be no larger than 32 in size');
- $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
+ $tMap->addValidator('USR_UID', 'required', 'propel.validator.RequiredValidator', '', 'User UID is required.');
- $tMap->addValidator('TU_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', '1|2', 'Please select a valid type.');
+ $tMap->addValidator('TU_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', '1|2', 'Please select a valid type.');
- $tMap->addValidator('TU_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Type is required.');
+ $tMap->addValidator('TU_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Type is required.');
- $tMap->addValidator('TU_RELATION', 'validValues', 'propel.validator.ValidValuesValidator', '1|2', 'Please select a valid relation.');
+ $tMap->addValidator('TU_RELATION', 'validValues', 'propel.validator.ValidValuesValidator', '1|2', 'Please select a valid relation.');
- $tMap->addValidator('TU_RELATION', 'required', 'propel.validator.RequiredValidator', '', 'Relation is required.');
+ $tMap->addValidator('TU_RELATION', 'required', 'propel.validator.RequiredValidator', '', 'Relation is required.');
- } // doBuild()
+ } // doBuild()
} // TaskUserMapBuilder
diff --git a/workflow/engine/classes/model/map/TranslationMapBuilder.php b/workflow/engine/classes/model/map/TranslationMapBuilder.php
index 651a01cb8..d32959e13 100755
--- a/workflow/engine/classes/model/map/TranslationMapBuilder.php
+++ b/workflow/engine/classes/model/map/TranslationMapBuilder.php
@@ -16,80 +16,81 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class TranslationMapBuilder {
+class TranslationMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.TranslationMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.TranslationMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('TRANSLATION');
- $tMap->setPhpName('Translation');
+ $tMap = $this->dbMap->addTable('TRANSLATION');
+ $tMap->setPhpName('Translation');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('TRN_CATEGORY', 'TrnCategory', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addPrimaryKey('TRN_CATEGORY', 'TrnCategory', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addPrimaryKey('TRN_ID', 'TrnId', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addPrimaryKey('TRN_ID', 'TrnId', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addPrimaryKey('TRN_LANG', 'TrnLang', 'string', CreoleTypes::VARCHAR, true, 10);
+ $tMap->addPrimaryKey('TRN_LANG', 'TrnLang', 'string', CreoleTypes::VARCHAR, true, 10);
- $tMap->addColumn('TRN_VALUE', 'TrnValue', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('TRN_VALUE', 'TrnValue', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('TRN_UPDATE_DATE', 'TrnUpdateDate', 'int', CreoleTypes::DATE, false, null);
+ $tMap->addColumn('TRN_UPDATE_DATE', 'TrnUpdateDate', 'int', CreoleTypes::DATE, false, null);
- $tMap->addValidator('TRN_CATEGORY', 'maxLength', 'propel.validator.MaxLengthValidator', '100', 'Category can be no larger than 100 in size');
+ $tMap->addValidator('TRN_CATEGORY', 'maxLength', 'propel.validator.MaxLengthValidator', '100', 'Category can be no larger than 100 in size');
- $tMap->addValidator('TRN_CATEGORY', 'required', 'propel.validator.RequiredValidator', '', 'Category is required.');
+ $tMap->addValidator('TRN_CATEGORY', 'required', 'propel.validator.RequiredValidator', '', 'Category is required.');
- $tMap->addValidator('TRN_ID', 'maxLength', 'propel.validator.MaxLengthValidator', '100', 'ID can be no larger than 100 in size');
+ $tMap->addValidator('TRN_ID', 'maxLength', 'propel.validator.MaxLengthValidator', '100', 'ID can be no larger than 100 in size');
- $tMap->addValidator('TRN_ID', 'required', 'propel.validator.RequiredValidator', '', 'ID is required.');
+ $tMap->addValidator('TRN_ID', 'required', 'propel.validator.RequiredValidator', '', 'ID is required.');
- $tMap->addValidator('TRN_LANG', 'maxLength', 'propel.validator.MaxLengthValidator', '5', 'Language can be no larger than 5 in size');
+ $tMap->addValidator('TRN_LANG', 'maxLength', 'propel.validator.MaxLengthValidator', '5', 'Language can be no larger than 5 in size');
- $tMap->addValidator('TRN_LANG', 'required', 'propel.validator.RequiredValidator', '', 'Language is required.');
+ $tMap->addValidator('TRN_LANG', 'required', 'propel.validator.RequiredValidator', '', 'Language is required.');
- $tMap->addValidator('TRN_VALUE', 'maxLength', 'propel.validator.MaxLengthValidator', '200', 'Value can be no larger than 200 in size');
+ $tMap->addValidator('TRN_VALUE', 'maxLength', 'propel.validator.MaxLengthValidator', '200', 'Value can be no larger than 200 in size');
- $tMap->addValidator('TRN_VALUE', 'required', 'propel.validator.RequiredValidator', '', 'Value is required.');
+ $tMap->addValidator('TRN_VALUE', 'required', 'propel.validator.RequiredValidator', '', 'Value is required.');
- } // doBuild()
+ } // doBuild()
} // TranslationMapBuilder
diff --git a/workflow/engine/classes/model/map/TriggersMapBuilder.php b/workflow/engine/classes/model/map/TriggersMapBuilder.php
index 7605a5eb5..dfe4b9cc5 100755
--- a/workflow/engine/classes/model/map/TriggersMapBuilder.php
+++ b/workflow/engine/classes/model/map/TriggersMapBuilder.php
@@ -16,68 +16,69 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class TriggersMapBuilder {
+class TriggersMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.TriggersMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.TriggersMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('TRIGGERS');
- $tMap->setPhpName('Triggers');
+ $tMap = $this->dbMap->addTable('TRIGGERS');
+ $tMap->setPhpName('Triggers');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('TRI_UID', 'TriUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('TRI_UID', 'TriUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('TRI_TYPE', 'TriType', 'string', CreoleTypes::VARCHAR, true, 20);
+ $tMap->addColumn('TRI_TYPE', 'TriType', 'string', CreoleTypes::VARCHAR, true, 20);
- $tMap->addColumn('TRI_WEBBOT', 'TriWebbot', 'string', CreoleTypes::LONGVARCHAR, true, null);
+ $tMap->addColumn('TRI_WEBBOT', 'TriWebbot', 'string', CreoleTypes::LONGVARCHAR, true, null);
- $tMap->addColumn('TRI_PARAM', 'TriParam', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('TRI_PARAM', 'TriParam', 'string', CreoleTypes::LONGVARCHAR, false, null);
- $tMap->addValidator('TRI_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'WEBBOT|SCRIPT', 'Please select a valid type.');
+ $tMap->addValidator('TRI_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'WEBBOT|SCRIPT', 'Please select a valid type.');
- $tMap->addValidator('TRI_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Type is required.');
+ $tMap->addValidator('TRI_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Type is required.');
- } // doBuild()
+ } // doBuild()
} // TriggersMapBuilder
diff --git a/workflow/engine/classes/model/map/UsersMapBuilder.php b/workflow/engine/classes/model/map/UsersMapBuilder.php
index 5550c32f1..e811bf8aa 100755
--- a/workflow/engine/classes/model/map/UsersMapBuilder.php
+++ b/workflow/engine/classes/model/map/UsersMapBuilder.php
@@ -16,110 +16,111 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class UsersMapBuilder {
+class UsersMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.UsersMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.UsersMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('USERS');
- $tMap->setPhpName('Users');
+ $tMap = $this->dbMap->addTable('USERS');
+ $tMap->setPhpName('Users');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_USERNAME', 'UsrUsername', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('USR_USERNAME', 'UsrUsername', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('USR_PASSWORD', 'UsrPassword', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_PASSWORD', 'UsrPassword', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_FIRSTNAME', 'UsrFirstname', 'string', CreoleTypes::VARCHAR, true, 50);
+ $tMap->addColumn('USR_FIRSTNAME', 'UsrFirstname', 'string', CreoleTypes::VARCHAR, true, 50);
- $tMap->addColumn('USR_LASTNAME', 'UsrLastname', 'string', CreoleTypes::VARCHAR, true, 50);
+ $tMap->addColumn('USR_LASTNAME', 'UsrLastname', 'string', CreoleTypes::VARCHAR, true, 50);
- $tMap->addColumn('USR_EMAIL', 'UsrEmail', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('USR_EMAIL', 'UsrEmail', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('USR_DUE_DATE', 'UsrDueDate', 'int', CreoleTypes::DATE, true, null);
+ $tMap->addColumn('USR_DUE_DATE', 'UsrDueDate', 'int', CreoleTypes::DATE, true, null);
- $tMap->addColumn('USR_CREATE_DATE', 'UsrCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('USR_CREATE_DATE', 'UsrCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('USR_UPDATE_DATE', 'UsrUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
+ $tMap->addColumn('USR_UPDATE_DATE', 'UsrUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
- $tMap->addColumn('USR_STATUS', 'UsrStatus', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('USR_STATUS', 'UsrStatus', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_COUNTRY', 'UsrCountry', 'string', CreoleTypes::VARCHAR, true, 3);
+ $tMap->addColumn('USR_COUNTRY', 'UsrCountry', 'string', CreoleTypes::VARCHAR, true, 3);
- $tMap->addColumn('USR_CITY', 'UsrCity', 'string', CreoleTypes::VARCHAR, true, 3);
+ $tMap->addColumn('USR_CITY', 'UsrCity', 'string', CreoleTypes::VARCHAR, true, 3);
- $tMap->addColumn('USR_LOCATION', 'UsrLocation', 'string', CreoleTypes::VARCHAR, true, 3);
+ $tMap->addColumn('USR_LOCATION', 'UsrLocation', 'string', CreoleTypes::VARCHAR, true, 3);
- $tMap->addColumn('USR_ADDRESS', 'UsrAddress', 'string', CreoleTypes::VARCHAR, true, 255);
+ $tMap->addColumn('USR_ADDRESS', 'UsrAddress', 'string', CreoleTypes::VARCHAR, true, 255);
- $tMap->addColumn('USR_PHONE', 'UsrPhone', 'string', CreoleTypes::VARCHAR, true, 24);
+ $tMap->addColumn('USR_PHONE', 'UsrPhone', 'string', CreoleTypes::VARCHAR, true, 24);
- $tMap->addColumn('USR_FAX', 'UsrFax', 'string', CreoleTypes::VARCHAR, true, 24);
+ $tMap->addColumn('USR_FAX', 'UsrFax', 'string', CreoleTypes::VARCHAR, true, 24);
- $tMap->addColumn('USR_CELLULAR', 'UsrCellular', 'string', CreoleTypes::VARCHAR, true, 24);
+ $tMap->addColumn('USR_CELLULAR', 'UsrCellular', 'string', CreoleTypes::VARCHAR, true, 24);
- $tMap->addColumn('USR_ZIP_CODE', 'UsrZipCode', 'string', CreoleTypes::VARCHAR, true, 16);
+ $tMap->addColumn('USR_ZIP_CODE', 'UsrZipCode', 'string', CreoleTypes::VARCHAR, true, 16);
- $tMap->addColumn('DEP_UID', 'DepUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addColumn('DEP_UID', 'DepUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_POSITION', 'UsrPosition', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('USR_POSITION', 'UsrPosition', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('USR_RESUME', 'UsrResume', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('USR_RESUME', 'UsrResume', 'string', CreoleTypes::VARCHAR, true, 100);
- $tMap->addColumn('USR_BIRTHDAY', 'UsrBirthday', 'int', CreoleTypes::DATE, false, null);
+ $tMap->addColumn('USR_BIRTHDAY', 'UsrBirthday', 'int', CreoleTypes::DATE, false, null);
- $tMap->addColumn('USR_ROLE', 'UsrRole', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('USR_ROLE', 'UsrRole', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('USR_REPORTS_TO', 'UsrReportsTo', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('USR_REPORTS_TO', 'UsrReportsTo', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('USR_REPLACED_BY', 'UsrReplacedBy', 'string', CreoleTypes::VARCHAR, false, 32);
+ $tMap->addColumn('USR_REPLACED_BY', 'UsrReplacedBy', 'string', CreoleTypes::VARCHAR, false, 32);
- $tMap->addColumn('USR_UX', 'UsrUx', 'string', CreoleTypes::VARCHAR, false, 128);
+ $tMap->addColumn('USR_UX', 'UsrUx', 'string', CreoleTypes::VARCHAR, false, 128);
- $tMap->addValidator('USR_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|VACATION|CLOSED', 'Please select a valid type.');
+ $tMap->addValidator('USR_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|VACATION|CLOSED', 'Please select a valid type.');
- $tMap->addValidator('USR_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Type is required.');
+ $tMap->addValidator('USR_STATUS', 'required', 'propel.validator.RequiredValidator', '', 'Type is required.');
- } // doBuild()
+ } // doBuild()
} // UsersMapBuilder
diff --git a/workflow/engine/classes/model/map/UsersPropertiesMapBuilder.php b/workflow/engine/classes/model/map/UsersPropertiesMapBuilder.php
index d77276a09..7baef3398 100755
--- a/workflow/engine/classes/model/map/UsersPropertiesMapBuilder.php
+++ b/workflow/engine/classes/model/map/UsersPropertiesMapBuilder.php
@@ -16,62 +16,63 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
-class UsersPropertiesMapBuilder {
+class UsersPropertiesMapBuilder
+{
- /**
- * The (dot-path) name of this class
- */
- const CLASS_NAME = 'classes.model.map.UsersPropertiesMapBuilder';
+ /**
+ * The (dot-path) name of this class
+ */
+ const CLASS_NAME = 'classes.model.map.UsersPropertiesMapBuilder';
- /**
- * The database map.
- */
- private $dbMap;
+ /**
+ * The database map.
+ */
+ private $dbMap;
- /**
- * Tells us if this DatabaseMapBuilder is built so that we
- * don't have to re-build it every time.
- *
- * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
- */
- public function isBuilt()
- {
- return ($this->dbMap !== null);
- }
+ /**
+ * Tells us if this DatabaseMapBuilder is built so that we
+ * don't have to re-build it every time.
+ *
+ * @return boolean true if this DatabaseMapBuilder is built, false otherwise.
+ */
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
- /**
- * Gets the databasemap this map builder built.
- *
- * @return the databasemap
- */
- public function getDatabaseMap()
- {
- return $this->dbMap;
- }
+ /**
+ * Gets the databasemap this map builder built.
+ *
+ * @return the databasemap
+ */
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
- /**
- * The doBuild() method builds the DatabaseMap
- *
- * @return void
- * @throws PropelException
- */
- public function doBuild()
- {
- $this->dbMap = Propel::getDatabaseMap('workflow');
+ /**
+ * The doBuild() method builds the DatabaseMap
+ *
+ * @return void
+ * @throws PropelException
+ */
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('workflow');
- $tMap = $this->dbMap->addTable('USERS_PROPERTIES');
- $tMap->setPhpName('UsersProperties');
+ $tMap = $this->dbMap->addTable('USERS_PROPERTIES');
+ $tMap->setPhpName('UsersProperties');
- $tMap->setUseIdGenerator(false);
+ $tMap->setUseIdGenerator(false);
- $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
+ $tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
- $tMap->addColumn('USR_LAST_UPDATE_DATE', 'UsrLastUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
+ $tMap->addColumn('USR_LAST_UPDATE_DATE', 'UsrLastUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
- $tMap->addColumn('USR_LOGGED_NEXT_TIME', 'UsrLoggedNextTime', 'int', CreoleTypes::INTEGER, false, null);
+ $tMap->addColumn('USR_LOGGED_NEXT_TIME', 'UsrLoggedNextTime', 'int', CreoleTypes::INTEGER, false, null);
- $tMap->addColumn('USR_PASSWORD_HISTORY', 'UsrPasswordHistory', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('USR_PASSWORD_HISTORY', 'UsrPasswordHistory', 'string', CreoleTypes::LONGVARCHAR, false, null);
- } // doBuild()
+ } // doBuild()
} // UsersPropertiesMapBuilder
diff --git a/workflow/engine/classes/model/om/BaseAdditionalTables.php b/workflow/engine/classes/model/om/BaseAdditionalTables.php
index e758f4b7d..256e33890 100755
--- a/workflow/engine/classes/model/om/BaseAdditionalTables.php
+++ b/workflow/engine/classes/model/om/BaseAdditionalTables.php
@@ -16,1284 +16,1365 @@ include_once 'classes/model/AdditionalTablesPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAdditionalTables extends BaseObject implements Persistent {
+abstract class BaseAdditionalTables extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AdditionalTablesPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the add_tab_uid field.
+ * @var string
+ */
+ protected $add_tab_uid = '';
+
+ /**
+ * The value for the add_tab_name field.
+ * @var string
+ */
+ protected $add_tab_name = '';
+
+ /**
+ * The value for the add_tab_class_name field.
+ * @var string
+ */
+ protected $add_tab_class_name = '';
+
+ /**
+ * The value for the add_tab_description field.
+ * @var string
+ */
+ protected $add_tab_description;
+
+ /**
+ * The value for the add_tab_sdw_log_insert field.
+ * @var int
+ */
+ protected $add_tab_sdw_log_insert = 0;
+
+ /**
+ * The value for the add_tab_sdw_log_update field.
+ * @var int
+ */
+ protected $add_tab_sdw_log_update = 0;
+
+ /**
+ * The value for the add_tab_sdw_log_delete field.
+ * @var int
+ */
+ protected $add_tab_sdw_log_delete = 0;
+
+ /**
+ * The value for the add_tab_sdw_log_select field.
+ * @var int
+ */
+ protected $add_tab_sdw_log_select = 0;
+
+ /**
+ * The value for the add_tab_sdw_max_length field.
+ * @var int
+ */
+ protected $add_tab_sdw_max_length = 0;
+
+ /**
+ * The value for the add_tab_sdw_auto_delete field.
+ * @var int
+ */
+ protected $add_tab_sdw_auto_delete = 0;
+
+ /**
+ * The value for the add_tab_plg_uid field.
+ * @var string
+ */
+ protected $add_tab_plg_uid = '';
+
+ /**
+ * The value for the dbs_uid field.
+ * @var string
+ */
+ protected $dbs_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the add_tab_type field.
+ * @var string
+ */
+ protected $add_tab_type = '';
+
+ /**
+ * The value for the add_tab_grid field.
+ * @var string
+ */
+ protected $add_tab_grid = '';
+
+ /**
+ * The value for the add_tab_tag field.
+ * @var string
+ */
+ protected $add_tab_tag = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [add_tab_uid] column value.
+ *
+ * @return string
+ */
+ public function getAddTabUid()
+ {
+
+ return $this->add_tab_uid;
+ }
+
+ /**
+ * Get the [add_tab_name] column value.
+ *
+ * @return string
+ */
+ public function getAddTabName()
+ {
+
+ return $this->add_tab_name;
+ }
+
+ /**
+ * Get the [add_tab_class_name] column value.
+ *
+ * @return string
+ */
+ public function getAddTabClassName()
+ {
+
+ return $this->add_tab_class_name;
+ }
+
+ /**
+ * Get the [add_tab_description] column value.
+ *
+ * @return string
+ */
+ public function getAddTabDescription()
+ {
+
+ return $this->add_tab_description;
+ }
+
+ /**
+ * Get the [add_tab_sdw_log_insert] column value.
+ *
+ * @return int
+ */
+ public function getAddTabSdwLogInsert()
+ {
+
+ return $this->add_tab_sdw_log_insert;
+ }
+
+ /**
+ * Get the [add_tab_sdw_log_update] column value.
+ *
+ * @return int
+ */
+ public function getAddTabSdwLogUpdate()
+ {
+
+ return $this->add_tab_sdw_log_update;
+ }
+
+ /**
+ * Get the [add_tab_sdw_log_delete] column value.
+ *
+ * @return int
+ */
+ public function getAddTabSdwLogDelete()
+ {
+
+ return $this->add_tab_sdw_log_delete;
+ }
+
+ /**
+ * Get the [add_tab_sdw_log_select] column value.
+ *
+ * @return int
+ */
+ public function getAddTabSdwLogSelect()
+ {
+
+ return $this->add_tab_sdw_log_select;
+ }
+
+ /**
+ * Get the [add_tab_sdw_max_length] column value.
+ *
+ * @return int
+ */
+ public function getAddTabSdwMaxLength()
+ {
+
+ return $this->add_tab_sdw_max_length;
+ }
+
+ /**
+ * Get the [add_tab_sdw_auto_delete] column value.
+ *
+ * @return int
+ */
+ public function getAddTabSdwAutoDelete()
+ {
+
+ return $this->add_tab_sdw_auto_delete;
+ }
+
+ /**
+ * Get the [add_tab_plg_uid] column value.
+ *
+ * @return string
+ */
+ public function getAddTabPlgUid()
+ {
+
+ return $this->add_tab_plg_uid;
+ }
+
+ /**
+ * Get the [dbs_uid] column value.
+ *
+ * @return string
+ */
+ public function getDbsUid()
+ {
+
+ return $this->dbs_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [add_tab_type] column value.
+ *
+ * @return string
+ */
+ public function getAddTabType()
+ {
+
+ return $this->add_tab_type;
+ }
+
+ /**
+ * Get the [add_tab_grid] column value.
+ *
+ * @return string
+ */
+ public function getAddTabGrid()
+ {
+
+ return $this->add_tab_grid;
+ }
+
+ /**
+ * Get the [add_tab_tag] column value.
+ *
+ * @return string
+ */
+ public function getAddTabTag()
+ {
+
+ return $this->add_tab_tag;
+ }
+
+ /**
+ * Set the value of [add_tab_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_uid !== $v || $v === '') {
+ $this->add_tab_uid = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_UID;
+ }
+
+ } // setAddTabUid()
+
+ /**
+ * Set the value of [add_tab_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_name !== $v || $v === '') {
+ $this->add_tab_name = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_NAME;
+ }
+
+ } // setAddTabName()
+
+ /**
+ * Set the value of [add_tab_class_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabClassName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_class_name !== $v || $v === '') {
+ $this->add_tab_class_name = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_CLASS_NAME;
+ }
+
+ } // setAddTabClassName()
+
+ /**
+ * Set the value of [add_tab_description] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabDescription($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_description !== $v) {
+ $this->add_tab_description = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_DESCRIPTION;
+ }
+
+ } // setAddTabDescription()
+
+ /**
+ * Set the value of [add_tab_sdw_log_insert] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAddTabSdwLogInsert($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->add_tab_sdw_log_insert !== $v || $v === 0) {
+ $this->add_tab_sdw_log_insert = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT;
+ }
+
+ } // setAddTabSdwLogInsert()
+
+ /**
+ * Set the value of [add_tab_sdw_log_update] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAddTabSdwLogUpdate($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->add_tab_sdw_log_update !== $v || $v === 0) {
+ $this->add_tab_sdw_log_update = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE;
+ }
+
+ } // setAddTabSdwLogUpdate()
+
+ /**
+ * Set the value of [add_tab_sdw_log_delete] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAddTabSdwLogDelete($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->add_tab_sdw_log_delete !== $v || $v === 0) {
+ $this->add_tab_sdw_log_delete = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE;
+ }
+
+ } // setAddTabSdwLogDelete()
+
+ /**
+ * Set the value of [add_tab_sdw_log_select] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAddTabSdwLogSelect($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->add_tab_sdw_log_select !== $v || $v === 0) {
+ $this->add_tab_sdw_log_select = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT;
+ }
+
+ } // setAddTabSdwLogSelect()
+
+ /**
+ * Set the value of [add_tab_sdw_max_length] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAddTabSdwMaxLength($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->add_tab_sdw_max_length !== $v || $v === 0) {
+ $this->add_tab_sdw_max_length = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH;
+ }
+
+ } // setAddTabSdwMaxLength()
+
+ /**
+ * Set the value of [add_tab_sdw_auto_delete] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAddTabSdwAutoDelete($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->add_tab_sdw_auto_delete !== $v || $v === 0) {
+ $this->add_tab_sdw_auto_delete = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE;
+ }
+
+ } // setAddTabSdwAutoDelete()
+
+ /**
+ * Set the value of [add_tab_plg_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabPlgUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_plg_uid !== $v || $v === '') {
+ $this->add_tab_plg_uid = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_PLG_UID;
+ }
+
+ } // setAddTabPlgUid()
+
+ /**
+ * Set the value of [dbs_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_uid !== $v || $v === '') {
+ $this->dbs_uid = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::DBS_UID;
+ }
+
+ } // setDbsUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [add_tab_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_type !== $v || $v === '') {
+ $this->add_tab_type = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_TYPE;
+ }
+
+ } // setAddTabType()
+
+ /**
+ * Set the value of [add_tab_grid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabGrid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_grid !== $v || $v === '') {
+ $this->add_tab_grid = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_GRID;
+ }
+
+ } // setAddTabGrid()
+
+ /**
+ * Set the value of [add_tab_tag] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabTag($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_tag !== $v || $v === '') {
+ $this->add_tab_tag = $v;
+ $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_TAG;
+ }
+
+ } // setAddTabTag()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->add_tab_uid = $rs->getString($startcol + 0);
+
+ $this->add_tab_name = $rs->getString($startcol + 1);
+
+ $this->add_tab_class_name = $rs->getString($startcol + 2);
+
+ $this->add_tab_description = $rs->getString($startcol + 3);
+
+ $this->add_tab_sdw_log_insert = $rs->getInt($startcol + 4);
+
+ $this->add_tab_sdw_log_update = $rs->getInt($startcol + 5);
+
+ $this->add_tab_sdw_log_delete = $rs->getInt($startcol + 6);
+
+ $this->add_tab_sdw_log_select = $rs->getInt($startcol + 7);
+
+ $this->add_tab_sdw_max_length = $rs->getInt($startcol + 8);
+
+ $this->add_tab_sdw_auto_delete = $rs->getInt($startcol + 9);
+
+ $this->add_tab_plg_uid = $rs->getString($startcol + 10);
+
+ $this->dbs_uid = $rs->getString($startcol + 11);
+
+ $this->pro_uid = $rs->getString($startcol + 12);
+
+ $this->add_tab_type = $rs->getString($startcol + 13);
+
+ $this->add_tab_grid = $rs->getString($startcol + 14);
+
+ $this->add_tab_tag = $rs->getString($startcol + 15);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 16; // 16 = AdditionalTablesPeer::NUM_COLUMNS - AdditionalTablesPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AdditionalTables object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AdditionalTablesPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AdditionalTablesPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AdditionalTablesPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AdditionalTablesPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AdditionalTablesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAddTabUid();
+ break;
+ case 1:
+ return $this->getAddTabName();
+ break;
+ case 2:
+ return $this->getAddTabClassName();
+ break;
+ case 3:
+ return $this->getAddTabDescription();
+ break;
+ case 4:
+ return $this->getAddTabSdwLogInsert();
+ break;
+ case 5:
+ return $this->getAddTabSdwLogUpdate();
+ break;
+ case 6:
+ return $this->getAddTabSdwLogDelete();
+ break;
+ case 7:
+ return $this->getAddTabSdwLogSelect();
+ break;
+ case 8:
+ return $this->getAddTabSdwMaxLength();
+ break;
+ case 9:
+ return $this->getAddTabSdwAutoDelete();
+ break;
+ case 10:
+ return $this->getAddTabPlgUid();
+ break;
+ case 11:
+ return $this->getDbsUid();
+ break;
+ case 12:
+ return $this->getProUid();
+ break;
+ case 13:
+ return $this->getAddTabType();
+ break;
+ case 14:
+ return $this->getAddTabGrid();
+ break;
+ case 15:
+ return $this->getAddTabTag();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AdditionalTablesPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAddTabUid(),
+ $keys[1] => $this->getAddTabName(),
+ $keys[2] => $this->getAddTabClassName(),
+ $keys[3] => $this->getAddTabDescription(),
+ $keys[4] => $this->getAddTabSdwLogInsert(),
+ $keys[5] => $this->getAddTabSdwLogUpdate(),
+ $keys[6] => $this->getAddTabSdwLogDelete(),
+ $keys[7] => $this->getAddTabSdwLogSelect(),
+ $keys[8] => $this->getAddTabSdwMaxLength(),
+ $keys[9] => $this->getAddTabSdwAutoDelete(),
+ $keys[10] => $this->getAddTabPlgUid(),
+ $keys[11] => $this->getDbsUid(),
+ $keys[12] => $this->getProUid(),
+ $keys[13] => $this->getAddTabType(),
+ $keys[14] => $this->getAddTabGrid(),
+ $keys[15] => $this->getAddTabTag(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AdditionalTablesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAddTabUid($value);
+ break;
+ case 1:
+ $this->setAddTabName($value);
+ break;
+ case 2:
+ $this->setAddTabClassName($value);
+ break;
+ case 3:
+ $this->setAddTabDescription($value);
+ break;
+ case 4:
+ $this->setAddTabSdwLogInsert($value);
+ break;
+ case 5:
+ $this->setAddTabSdwLogUpdate($value);
+ break;
+ case 6:
+ $this->setAddTabSdwLogDelete($value);
+ break;
+ case 7:
+ $this->setAddTabSdwLogSelect($value);
+ break;
+ case 8:
+ $this->setAddTabSdwMaxLength($value);
+ break;
+ case 9:
+ $this->setAddTabSdwAutoDelete($value);
+ break;
+ case 10:
+ $this->setAddTabPlgUid($value);
+ break;
+ case 11:
+ $this->setDbsUid($value);
+ break;
+ case 12:
+ $this->setProUid($value);
+ break;
+ case 13:
+ $this->setAddTabType($value);
+ break;
+ case 14:
+ $this->setAddTabGrid($value);
+ break;
+ case 15:
+ $this->setAddTabTag($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AdditionalTablesPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAddTabUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setAddTabName($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setAddTabClassName($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setAddTabDescription($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setAddTabSdwLogInsert($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setAddTabSdwLogUpdate($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setAddTabSdwLogDelete($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setAddTabSdwLogSelect($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setAddTabSdwMaxLength($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setAddTabSdwAutoDelete($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setAddTabPlgUid($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setDbsUid($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setProUid($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setAddTabType($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setAddTabGrid($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setAddTabTag($arr[$keys[15]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AdditionalTablesPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_UID)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $this->add_tab_uid);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_NAME)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_NAME, $this->add_tab_name);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_CLASS_NAME)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_CLASS_NAME, $this->add_tab_class_name);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_DESCRIPTION)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_DESCRIPTION, $this->add_tab_description);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT, $this->add_tab_sdw_log_insert);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE, $this->add_tab_sdw_log_update);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE, $this->add_tab_sdw_log_delete);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT, $this->add_tab_sdw_log_select);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH, $this->add_tab_sdw_max_length);
+ }
+
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE, $this->add_tab_sdw_auto_delete);
+ }
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_PLG_UID)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_PLG_UID, $this->add_tab_plg_uid);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AdditionalTablesPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(AdditionalTablesPeer::DBS_UID)) {
+ $criteria->add(AdditionalTablesPeer::DBS_UID, $this->dbs_uid);
+ }
+ if ($this->isColumnModified(AdditionalTablesPeer::PRO_UID)) {
+ $criteria->add(AdditionalTablesPeer::PRO_UID, $this->pro_uid);
+ }
- /**
- * The value for the add_tab_uid field.
- * @var string
- */
- protected $add_tab_uid = '';
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_TYPE)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_TYPE, $this->add_tab_type);
+ }
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_GRID)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_GRID, $this->add_tab_grid);
+ }
- /**
- * The value for the add_tab_name field.
- * @var string
- */
- protected $add_tab_name = '';
+ if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_TAG)) {
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_TAG, $this->add_tab_tag);
+ }
- /**
- * The value for the add_tab_class_name field.
- * @var string
- */
- protected $add_tab_class_name = '';
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AdditionalTablesPeer::DATABASE_NAME);
+
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $this->add_tab_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getAddTabUid();
+ }
+
+ /**
+ * Generic method to set the primary key (add_tab_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setAddTabUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AdditionalTables (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAddTabName($this->add_tab_name);
+
+ $copyObj->setAddTabClassName($this->add_tab_class_name);
+
+ $copyObj->setAddTabDescription($this->add_tab_description);
+
+ $copyObj->setAddTabSdwLogInsert($this->add_tab_sdw_log_insert);
+
+ $copyObj->setAddTabSdwLogUpdate($this->add_tab_sdw_log_update);
+
+ $copyObj->setAddTabSdwLogDelete($this->add_tab_sdw_log_delete);
+
+ $copyObj->setAddTabSdwLogSelect($this->add_tab_sdw_log_select);
+
+ $copyObj->setAddTabSdwMaxLength($this->add_tab_sdw_max_length);
+
+ $copyObj->setAddTabSdwAutoDelete($this->add_tab_sdw_auto_delete);
+
+ $copyObj->setAddTabPlgUid($this->add_tab_plg_uid);
+
+ $copyObj->setDbsUid($this->dbs_uid);
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setAddTabType($this->add_tab_type);
+
+ $copyObj->setAddTabGrid($this->add_tab_grid);
+
+ $copyObj->setAddTabTag($this->add_tab_tag);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAddTabUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AdditionalTables Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AdditionalTablesPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AdditionalTablesPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The value for the add_tab_description field.
- * @var string
- */
- protected $add_tab_description;
-
-
- /**
- * The value for the add_tab_sdw_log_insert field.
- * @var int
- */
- protected $add_tab_sdw_log_insert = 0;
-
-
- /**
- * The value for the add_tab_sdw_log_update field.
- * @var int
- */
- protected $add_tab_sdw_log_update = 0;
-
-
- /**
- * The value for the add_tab_sdw_log_delete field.
- * @var int
- */
- protected $add_tab_sdw_log_delete = 0;
-
-
- /**
- * The value for the add_tab_sdw_log_select field.
- * @var int
- */
- protected $add_tab_sdw_log_select = 0;
-
-
- /**
- * The value for the add_tab_sdw_max_length field.
- * @var int
- */
- protected $add_tab_sdw_max_length = 0;
-
-
- /**
- * The value for the add_tab_sdw_auto_delete field.
- * @var int
- */
- protected $add_tab_sdw_auto_delete = 0;
-
-
- /**
- * The value for the add_tab_plg_uid field.
- * @var string
- */
- protected $add_tab_plg_uid = '';
-
-
- /**
- * The value for the dbs_uid field.
- * @var string
- */
- protected $dbs_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the add_tab_type field.
- * @var string
- */
- protected $add_tab_type = '';
-
-
- /**
- * The value for the add_tab_grid field.
- * @var string
- */
- protected $add_tab_grid = '';
-
-
- /**
- * The value for the add_tab_tag field.
- * @var string
- */
- protected $add_tab_tag = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [add_tab_uid] column value.
- *
- * @return string
- */
- public function getAddTabUid()
- {
-
- return $this->add_tab_uid;
- }
-
- /**
- * Get the [add_tab_name] column value.
- *
- * @return string
- */
- public function getAddTabName()
- {
-
- return $this->add_tab_name;
- }
-
- /**
- * Get the [add_tab_class_name] column value.
- *
- * @return string
- */
- public function getAddTabClassName()
- {
-
- return $this->add_tab_class_name;
- }
-
- /**
- * Get the [add_tab_description] column value.
- *
- * @return string
- */
- public function getAddTabDescription()
- {
-
- return $this->add_tab_description;
- }
-
- /**
- * Get the [add_tab_sdw_log_insert] column value.
- *
- * @return int
- */
- public function getAddTabSdwLogInsert()
- {
-
- return $this->add_tab_sdw_log_insert;
- }
-
- /**
- * Get the [add_tab_sdw_log_update] column value.
- *
- * @return int
- */
- public function getAddTabSdwLogUpdate()
- {
-
- return $this->add_tab_sdw_log_update;
- }
-
- /**
- * Get the [add_tab_sdw_log_delete] column value.
- *
- * @return int
- */
- public function getAddTabSdwLogDelete()
- {
-
- return $this->add_tab_sdw_log_delete;
- }
-
- /**
- * Get the [add_tab_sdw_log_select] column value.
- *
- * @return int
- */
- public function getAddTabSdwLogSelect()
- {
-
- return $this->add_tab_sdw_log_select;
- }
-
- /**
- * Get the [add_tab_sdw_max_length] column value.
- *
- * @return int
- */
- public function getAddTabSdwMaxLength()
- {
-
- return $this->add_tab_sdw_max_length;
- }
-
- /**
- * Get the [add_tab_sdw_auto_delete] column value.
- *
- * @return int
- */
- public function getAddTabSdwAutoDelete()
- {
-
- return $this->add_tab_sdw_auto_delete;
- }
-
- /**
- * Get the [add_tab_plg_uid] column value.
- *
- * @return string
- */
- public function getAddTabPlgUid()
- {
-
- return $this->add_tab_plg_uid;
- }
-
- /**
- * Get the [dbs_uid] column value.
- *
- * @return string
- */
- public function getDbsUid()
- {
-
- return $this->dbs_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [add_tab_type] column value.
- *
- * @return string
- */
- public function getAddTabType()
- {
-
- return $this->add_tab_type;
- }
-
- /**
- * Get the [add_tab_grid] column value.
- *
- * @return string
- */
- public function getAddTabGrid()
- {
-
- return $this->add_tab_grid;
- }
-
- /**
- * Get the [add_tab_tag] column value.
- *
- * @return string
- */
- public function getAddTabTag()
- {
-
- return $this->add_tab_tag;
- }
-
- /**
- * Set the value of [add_tab_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_uid !== $v || $v === '') {
- $this->add_tab_uid = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_UID;
- }
-
- } // setAddTabUid()
-
- /**
- * Set the value of [add_tab_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_name !== $v || $v === '') {
- $this->add_tab_name = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_NAME;
- }
-
- } // setAddTabName()
-
- /**
- * Set the value of [add_tab_class_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabClassName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_class_name !== $v || $v === '') {
- $this->add_tab_class_name = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_CLASS_NAME;
- }
-
- } // setAddTabClassName()
-
- /**
- * Set the value of [add_tab_description] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabDescription($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_description !== $v) {
- $this->add_tab_description = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_DESCRIPTION;
- }
-
- } // setAddTabDescription()
-
- /**
- * Set the value of [add_tab_sdw_log_insert] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAddTabSdwLogInsert($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->add_tab_sdw_log_insert !== $v || $v === 0) {
- $this->add_tab_sdw_log_insert = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT;
- }
-
- } // setAddTabSdwLogInsert()
-
- /**
- * Set the value of [add_tab_sdw_log_update] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAddTabSdwLogUpdate($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->add_tab_sdw_log_update !== $v || $v === 0) {
- $this->add_tab_sdw_log_update = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE;
- }
-
- } // setAddTabSdwLogUpdate()
-
- /**
- * Set the value of [add_tab_sdw_log_delete] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAddTabSdwLogDelete($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->add_tab_sdw_log_delete !== $v || $v === 0) {
- $this->add_tab_sdw_log_delete = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE;
- }
-
- } // setAddTabSdwLogDelete()
-
- /**
- * Set the value of [add_tab_sdw_log_select] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAddTabSdwLogSelect($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->add_tab_sdw_log_select !== $v || $v === 0) {
- $this->add_tab_sdw_log_select = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT;
- }
-
- } // setAddTabSdwLogSelect()
-
- /**
- * Set the value of [add_tab_sdw_max_length] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAddTabSdwMaxLength($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->add_tab_sdw_max_length !== $v || $v === 0) {
- $this->add_tab_sdw_max_length = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH;
- }
-
- } // setAddTabSdwMaxLength()
-
- /**
- * Set the value of [add_tab_sdw_auto_delete] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAddTabSdwAutoDelete($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->add_tab_sdw_auto_delete !== $v || $v === 0) {
- $this->add_tab_sdw_auto_delete = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE;
- }
-
- } // setAddTabSdwAutoDelete()
-
- /**
- * Set the value of [add_tab_plg_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabPlgUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_plg_uid !== $v || $v === '') {
- $this->add_tab_plg_uid = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_PLG_UID;
- }
-
- } // setAddTabPlgUid()
-
- /**
- * Set the value of [dbs_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_uid !== $v || $v === '') {
- $this->dbs_uid = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::DBS_UID;
- }
-
- } // setDbsUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [add_tab_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_type !== $v || $v === '') {
- $this->add_tab_type = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_TYPE;
- }
-
- } // setAddTabType()
-
- /**
- * Set the value of [add_tab_grid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabGrid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_grid !== $v || $v === '') {
- $this->add_tab_grid = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_GRID;
- }
-
- } // setAddTabGrid()
-
- /**
- * Set the value of [add_tab_tag] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabTag($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_tag !== $v || $v === '') {
- $this->add_tab_tag = $v;
- $this->modifiedColumns[] = AdditionalTablesPeer::ADD_TAB_TAG;
- }
-
- } // setAddTabTag()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->add_tab_uid = $rs->getString($startcol + 0);
-
- $this->add_tab_name = $rs->getString($startcol + 1);
-
- $this->add_tab_class_name = $rs->getString($startcol + 2);
-
- $this->add_tab_description = $rs->getString($startcol + 3);
-
- $this->add_tab_sdw_log_insert = $rs->getInt($startcol + 4);
-
- $this->add_tab_sdw_log_update = $rs->getInt($startcol + 5);
-
- $this->add_tab_sdw_log_delete = $rs->getInt($startcol + 6);
-
- $this->add_tab_sdw_log_select = $rs->getInt($startcol + 7);
-
- $this->add_tab_sdw_max_length = $rs->getInt($startcol + 8);
-
- $this->add_tab_sdw_auto_delete = $rs->getInt($startcol + 9);
-
- $this->add_tab_plg_uid = $rs->getString($startcol + 10);
-
- $this->dbs_uid = $rs->getString($startcol + 11);
-
- $this->pro_uid = $rs->getString($startcol + 12);
-
- $this->add_tab_type = $rs->getString($startcol + 13);
-
- $this->add_tab_grid = $rs->getString($startcol + 14);
-
- $this->add_tab_tag = $rs->getString($startcol + 15);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 16; // 16 = AdditionalTablesPeer::NUM_COLUMNS - AdditionalTablesPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AdditionalTables object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AdditionalTablesPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AdditionalTablesPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AdditionalTablesPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AdditionalTablesPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AdditionalTablesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAddTabUid();
- break;
- case 1:
- return $this->getAddTabName();
- break;
- case 2:
- return $this->getAddTabClassName();
- break;
- case 3:
- return $this->getAddTabDescription();
- break;
- case 4:
- return $this->getAddTabSdwLogInsert();
- break;
- case 5:
- return $this->getAddTabSdwLogUpdate();
- break;
- case 6:
- return $this->getAddTabSdwLogDelete();
- break;
- case 7:
- return $this->getAddTabSdwLogSelect();
- break;
- case 8:
- return $this->getAddTabSdwMaxLength();
- break;
- case 9:
- return $this->getAddTabSdwAutoDelete();
- break;
- case 10:
- return $this->getAddTabPlgUid();
- break;
- case 11:
- return $this->getDbsUid();
- break;
- case 12:
- return $this->getProUid();
- break;
- case 13:
- return $this->getAddTabType();
- break;
- case 14:
- return $this->getAddTabGrid();
- break;
- case 15:
- return $this->getAddTabTag();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AdditionalTablesPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAddTabUid(),
- $keys[1] => $this->getAddTabName(),
- $keys[2] => $this->getAddTabClassName(),
- $keys[3] => $this->getAddTabDescription(),
- $keys[4] => $this->getAddTabSdwLogInsert(),
- $keys[5] => $this->getAddTabSdwLogUpdate(),
- $keys[6] => $this->getAddTabSdwLogDelete(),
- $keys[7] => $this->getAddTabSdwLogSelect(),
- $keys[8] => $this->getAddTabSdwMaxLength(),
- $keys[9] => $this->getAddTabSdwAutoDelete(),
- $keys[10] => $this->getAddTabPlgUid(),
- $keys[11] => $this->getDbsUid(),
- $keys[12] => $this->getProUid(),
- $keys[13] => $this->getAddTabType(),
- $keys[14] => $this->getAddTabGrid(),
- $keys[15] => $this->getAddTabTag(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AdditionalTablesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAddTabUid($value);
- break;
- case 1:
- $this->setAddTabName($value);
- break;
- case 2:
- $this->setAddTabClassName($value);
- break;
- case 3:
- $this->setAddTabDescription($value);
- break;
- case 4:
- $this->setAddTabSdwLogInsert($value);
- break;
- case 5:
- $this->setAddTabSdwLogUpdate($value);
- break;
- case 6:
- $this->setAddTabSdwLogDelete($value);
- break;
- case 7:
- $this->setAddTabSdwLogSelect($value);
- break;
- case 8:
- $this->setAddTabSdwMaxLength($value);
- break;
- case 9:
- $this->setAddTabSdwAutoDelete($value);
- break;
- case 10:
- $this->setAddTabPlgUid($value);
- break;
- case 11:
- $this->setDbsUid($value);
- break;
- case 12:
- $this->setProUid($value);
- break;
- case 13:
- $this->setAddTabType($value);
- break;
- case 14:
- $this->setAddTabGrid($value);
- break;
- case 15:
- $this->setAddTabTag($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AdditionalTablesPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAddTabUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAddTabName($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAddTabClassName($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setAddTabDescription($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setAddTabSdwLogInsert($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setAddTabSdwLogUpdate($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setAddTabSdwLogDelete($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setAddTabSdwLogSelect($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setAddTabSdwMaxLength($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setAddTabSdwAutoDelete($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setAddTabPlgUid($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setDbsUid($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setProUid($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setAddTabType($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setAddTabGrid($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setAddTabTag($arr[$keys[15]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AdditionalTablesPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_UID)) $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $this->add_tab_uid);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_NAME)) $criteria->add(AdditionalTablesPeer::ADD_TAB_NAME, $this->add_tab_name);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_CLASS_NAME)) $criteria->add(AdditionalTablesPeer::ADD_TAB_CLASS_NAME, $this->add_tab_class_name);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_DESCRIPTION)) $criteria->add(AdditionalTablesPeer::ADD_TAB_DESCRIPTION, $this->add_tab_description);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT)) $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT, $this->add_tab_sdw_log_insert);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE)) $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE, $this->add_tab_sdw_log_update);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE)) $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE, $this->add_tab_sdw_log_delete);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT)) $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT, $this->add_tab_sdw_log_select);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH)) $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH, $this->add_tab_sdw_max_length);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE)) $criteria->add(AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE, $this->add_tab_sdw_auto_delete);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_PLG_UID)) $criteria->add(AdditionalTablesPeer::ADD_TAB_PLG_UID, $this->add_tab_plg_uid);
- if ($this->isColumnModified(AdditionalTablesPeer::DBS_UID)) $criteria->add(AdditionalTablesPeer::DBS_UID, $this->dbs_uid);
- if ($this->isColumnModified(AdditionalTablesPeer::PRO_UID)) $criteria->add(AdditionalTablesPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_TYPE)) $criteria->add(AdditionalTablesPeer::ADD_TAB_TYPE, $this->add_tab_type);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_GRID)) $criteria->add(AdditionalTablesPeer::ADD_TAB_GRID, $this->add_tab_grid);
- if ($this->isColumnModified(AdditionalTablesPeer::ADD_TAB_TAG)) $criteria->add(AdditionalTablesPeer::ADD_TAB_TAG, $this->add_tab_tag);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AdditionalTablesPeer::DATABASE_NAME);
-
- $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $this->add_tab_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getAddTabUid();
- }
-
- /**
- * Generic method to set the primary key (add_tab_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setAddTabUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AdditionalTables (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAddTabName($this->add_tab_name);
-
- $copyObj->setAddTabClassName($this->add_tab_class_name);
-
- $copyObj->setAddTabDescription($this->add_tab_description);
-
- $copyObj->setAddTabSdwLogInsert($this->add_tab_sdw_log_insert);
-
- $copyObj->setAddTabSdwLogUpdate($this->add_tab_sdw_log_update);
-
- $copyObj->setAddTabSdwLogDelete($this->add_tab_sdw_log_delete);
-
- $copyObj->setAddTabSdwLogSelect($this->add_tab_sdw_log_select);
-
- $copyObj->setAddTabSdwMaxLength($this->add_tab_sdw_max_length);
-
- $copyObj->setAddTabSdwAutoDelete($this->add_tab_sdw_auto_delete);
-
- $copyObj->setAddTabPlgUid($this->add_tab_plg_uid);
-
- $copyObj->setDbsUid($this->dbs_uid);
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setAddTabType($this->add_tab_type);
-
- $copyObj->setAddTabGrid($this->add_tab_grid);
-
- $copyObj->setAddTabTag($this->add_tab_tag);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAddTabUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AdditionalTables Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AdditionalTablesPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AdditionalTablesPeer();
- }
- return self::$peer;
- }
-
-} // BaseAdditionalTables
diff --git a/workflow/engine/classes/model/om/BaseAdditionalTablesPeer.php b/workflow/engine/classes/model/om/BaseAdditionalTablesPeer.php
index 95f7fd68f..688e4d01a 100755
--- a/workflow/engine/classes/model/om/BaseAdditionalTablesPeer.php
+++ b/workflow/engine/classes/model/om/BaseAdditionalTablesPeer.php
@@ -12,629 +12,631 @@ include_once 'classes/model/AdditionalTables.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAdditionalTablesPeer {
+abstract class BaseAdditionalTablesPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'ADDITIONAL_TABLES';
+ /** the table name for this class */
+ const TABLE_NAME = 'ADDITIONAL_TABLES';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AdditionalTables';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AdditionalTables';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 16;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the ADD_TAB_UID field */
+ const ADD_TAB_UID = 'ADDITIONAL_TABLES.ADD_TAB_UID';
+
+ /** the column name for the ADD_TAB_NAME field */
+ const ADD_TAB_NAME = 'ADDITIONAL_TABLES.ADD_TAB_NAME';
+
+ /** the column name for the ADD_TAB_CLASS_NAME field */
+ const ADD_TAB_CLASS_NAME = 'ADDITIONAL_TABLES.ADD_TAB_CLASS_NAME';
+
+ /** the column name for the ADD_TAB_DESCRIPTION field */
+ const ADD_TAB_DESCRIPTION = 'ADDITIONAL_TABLES.ADD_TAB_DESCRIPTION';
+
+ /** the column name for the ADD_TAB_SDW_LOG_INSERT field */
+ const ADD_TAB_SDW_LOG_INSERT = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_INSERT';
+
+ /** the column name for the ADD_TAB_SDW_LOG_UPDATE field */
+ const ADD_TAB_SDW_LOG_UPDATE = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_UPDATE';
+
+ /** the column name for the ADD_TAB_SDW_LOG_DELETE field */
+ const ADD_TAB_SDW_LOG_DELETE = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_DELETE';
+
+ /** the column name for the ADD_TAB_SDW_LOG_SELECT field */
+ const ADD_TAB_SDW_LOG_SELECT = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_SELECT';
+
+ /** the column name for the ADD_TAB_SDW_MAX_LENGTH field */
+ const ADD_TAB_SDW_MAX_LENGTH = 'ADDITIONAL_TABLES.ADD_TAB_SDW_MAX_LENGTH';
+
+ /** the column name for the ADD_TAB_SDW_AUTO_DELETE field */
+ const ADD_TAB_SDW_AUTO_DELETE = 'ADDITIONAL_TABLES.ADD_TAB_SDW_AUTO_DELETE';
+
+ /** the column name for the ADD_TAB_PLG_UID field */
+ const ADD_TAB_PLG_UID = 'ADDITIONAL_TABLES.ADD_TAB_PLG_UID';
+
+ /** the column name for the DBS_UID field */
+ const DBS_UID = 'ADDITIONAL_TABLES.DBS_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'ADDITIONAL_TABLES.PRO_UID';
+
+ /** the column name for the ADD_TAB_TYPE field */
+ const ADD_TAB_TYPE = 'ADDITIONAL_TABLES.ADD_TAB_TYPE';
+
+ /** the column name for the ADD_TAB_GRID field */
+ const ADD_TAB_GRID = 'ADDITIONAL_TABLES.ADD_TAB_GRID';
+
+ /** the column name for the ADD_TAB_TAG field */
+ const ADD_TAB_TAG = 'ADDITIONAL_TABLES.ADD_TAB_TAG';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AddTabUid', 'AddTabName', 'AddTabClassName', 'AddTabDescription', 'AddTabSdwLogInsert', 'AddTabSdwLogUpdate', 'AddTabSdwLogDelete', 'AddTabSdwLogSelect', 'AddTabSdwMaxLength', 'AddTabSdwAutoDelete', 'AddTabPlgUid', 'DbsUid', 'ProUid', 'AddTabType', 'AddTabGrid', 'AddTabTag', ),
+ BasePeer::TYPE_COLNAME => array (AdditionalTablesPeer::ADD_TAB_UID, AdditionalTablesPeer::ADD_TAB_NAME, AdditionalTablesPeer::ADD_TAB_CLASS_NAME, AdditionalTablesPeer::ADD_TAB_DESCRIPTION, AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT, AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE, AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE, AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT, AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH, AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE, AdditionalTablesPeer::ADD_TAB_PLG_UID, AdditionalTablesPeer::DBS_UID, AdditionalTablesPeer::PRO_UID, AdditionalTablesPeer::ADD_TAB_TYPE, AdditionalTablesPeer::ADD_TAB_GRID, AdditionalTablesPeer::ADD_TAB_TAG, ),
+ BasePeer::TYPE_FIELDNAME => array ('ADD_TAB_UID', 'ADD_TAB_NAME', 'ADD_TAB_CLASS_NAME', 'ADD_TAB_DESCRIPTION', 'ADD_TAB_SDW_LOG_INSERT', 'ADD_TAB_SDW_LOG_UPDATE', 'ADD_TAB_SDW_LOG_DELETE', 'ADD_TAB_SDW_LOG_SELECT', 'ADD_TAB_SDW_MAX_LENGTH', 'ADD_TAB_SDW_AUTO_DELETE', 'ADD_TAB_PLG_UID', 'DBS_UID', 'PRO_UID', 'ADD_TAB_TYPE', 'ADD_TAB_GRID', 'ADD_TAB_TAG', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AddTabUid' => 0, 'AddTabName' => 1, 'AddTabClassName' => 2, 'AddTabDescription' => 3, 'AddTabSdwLogInsert' => 4, 'AddTabSdwLogUpdate' => 5, 'AddTabSdwLogDelete' => 6, 'AddTabSdwLogSelect' => 7, 'AddTabSdwMaxLength' => 8, 'AddTabSdwAutoDelete' => 9, 'AddTabPlgUid' => 10, 'DbsUid' => 11, 'ProUid' => 12, 'AddTabType' => 13, 'AddTabGrid' => 14, 'AddTabTag' => 15, ),
+ BasePeer::TYPE_COLNAME => array (AdditionalTablesPeer::ADD_TAB_UID => 0, AdditionalTablesPeer::ADD_TAB_NAME => 1, AdditionalTablesPeer::ADD_TAB_CLASS_NAME => 2, AdditionalTablesPeer::ADD_TAB_DESCRIPTION => 3, AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT => 4, AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE => 5, AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE => 6, AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT => 7, AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH => 8, AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE => 9, AdditionalTablesPeer::ADD_TAB_PLG_UID => 10, AdditionalTablesPeer::DBS_UID => 11, AdditionalTablesPeer::PRO_UID => 12, AdditionalTablesPeer::ADD_TAB_TYPE => 13, AdditionalTablesPeer::ADD_TAB_GRID => 14, AdditionalTablesPeer::ADD_TAB_TAG => 15, ),
+ BasePeer::TYPE_FIELDNAME => array ('ADD_TAB_UID' => 0, 'ADD_TAB_NAME' => 1, 'ADD_TAB_CLASS_NAME' => 2, 'ADD_TAB_DESCRIPTION' => 3, 'ADD_TAB_SDW_LOG_INSERT' => 4, 'ADD_TAB_SDW_LOG_UPDATE' => 5, 'ADD_TAB_SDW_LOG_DELETE' => 6, 'ADD_TAB_SDW_LOG_SELECT' => 7, 'ADD_TAB_SDW_MAX_LENGTH' => 8, 'ADD_TAB_SDW_AUTO_DELETE' => 9, 'ADD_TAB_PLG_UID' => 10, 'DBS_UID' => 11, 'PRO_UID' => 12, 'ADD_TAB_TYPE' => 13, 'ADD_TAB_GRID' => 14, 'ADD_TAB_TAG' => 15, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AdditionalTablesMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AdditionalTablesMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AdditionalTablesPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AdditionalTablesPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AdditionalTablesPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_UID);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_NAME);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_CLASS_NAME);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_DESCRIPTION);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_PLG_UID);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::DBS_UID);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::PRO_UID);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_TYPE);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_GRID);
+
+ $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_TAG);
+
+ }
+
+ const COUNT = 'COUNT(ADDITIONAL_TABLES.ADD_TAB_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT ADDITIONAL_TABLES.ADD_TAB_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AdditionalTablesPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AdditionalTablesPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AdditionalTablesPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AdditionalTables
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AdditionalTablesPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AdditionalTablesPeer::populateObjects(AdditionalTablesPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AdditionalTablesPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AdditionalTablesPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AdditionalTablesPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AdditionalTables or Criteria object.
+ *
+ * @param mixed $values Criteria or AdditionalTables object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AdditionalTables object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AdditionalTables or Criteria object.
+ *
+ * @param mixed $values Criteria or AdditionalTables object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AdditionalTablesPeer::ADD_TAB_UID);
+ $selectCriteria->add(AdditionalTablesPeer::ADD_TAB_UID, $criteria->remove(AdditionalTablesPeer::ADD_TAB_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the ADDITIONAL_TABLES table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AdditionalTablesPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AdditionalTables or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AdditionalTables object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AdditionalTables) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AdditionalTables object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AdditionalTables $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AdditionalTables $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AdditionalTablesPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AdditionalTablesPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AdditionalTablesPeer::DATABASE_NAME, AdditionalTablesPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return AdditionalTables
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(AdditionalTablesPeer::DATABASE_NAME);
+
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $pk);
+
+
+ $v = AdditionalTablesPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $pks, Criteria::IN);
+ $objs = AdditionalTablesPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** The total number of columns. */
- const NUM_COLUMNS = 16;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the ADD_TAB_UID field */
- const ADD_TAB_UID = 'ADDITIONAL_TABLES.ADD_TAB_UID';
-
- /** the column name for the ADD_TAB_NAME field */
- const ADD_TAB_NAME = 'ADDITIONAL_TABLES.ADD_TAB_NAME';
-
- /** the column name for the ADD_TAB_CLASS_NAME field */
- const ADD_TAB_CLASS_NAME = 'ADDITIONAL_TABLES.ADD_TAB_CLASS_NAME';
-
- /** the column name for the ADD_TAB_DESCRIPTION field */
- const ADD_TAB_DESCRIPTION = 'ADDITIONAL_TABLES.ADD_TAB_DESCRIPTION';
-
- /** the column name for the ADD_TAB_SDW_LOG_INSERT field */
- const ADD_TAB_SDW_LOG_INSERT = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_INSERT';
-
- /** the column name for the ADD_TAB_SDW_LOG_UPDATE field */
- const ADD_TAB_SDW_LOG_UPDATE = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_UPDATE';
-
- /** the column name for the ADD_TAB_SDW_LOG_DELETE field */
- const ADD_TAB_SDW_LOG_DELETE = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_DELETE';
-
- /** the column name for the ADD_TAB_SDW_LOG_SELECT field */
- const ADD_TAB_SDW_LOG_SELECT = 'ADDITIONAL_TABLES.ADD_TAB_SDW_LOG_SELECT';
-
- /** the column name for the ADD_TAB_SDW_MAX_LENGTH field */
- const ADD_TAB_SDW_MAX_LENGTH = 'ADDITIONAL_TABLES.ADD_TAB_SDW_MAX_LENGTH';
-
- /** the column name for the ADD_TAB_SDW_AUTO_DELETE field */
- const ADD_TAB_SDW_AUTO_DELETE = 'ADDITIONAL_TABLES.ADD_TAB_SDW_AUTO_DELETE';
-
- /** the column name for the ADD_TAB_PLG_UID field */
- const ADD_TAB_PLG_UID = 'ADDITIONAL_TABLES.ADD_TAB_PLG_UID';
-
- /** the column name for the DBS_UID field */
- const DBS_UID = 'ADDITIONAL_TABLES.DBS_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'ADDITIONAL_TABLES.PRO_UID';
-
- /** the column name for the ADD_TAB_TYPE field */
- const ADD_TAB_TYPE = 'ADDITIONAL_TABLES.ADD_TAB_TYPE';
-
- /** the column name for the ADD_TAB_GRID field */
- const ADD_TAB_GRID = 'ADDITIONAL_TABLES.ADD_TAB_GRID';
-
- /** the column name for the ADD_TAB_TAG field */
- const ADD_TAB_TAG = 'ADDITIONAL_TABLES.ADD_TAB_TAG';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AddTabUid', 'AddTabName', 'AddTabClassName', 'AddTabDescription', 'AddTabSdwLogInsert', 'AddTabSdwLogUpdate', 'AddTabSdwLogDelete', 'AddTabSdwLogSelect', 'AddTabSdwMaxLength', 'AddTabSdwAutoDelete', 'AddTabPlgUid', 'DbsUid', 'ProUid', 'AddTabType', 'AddTabGrid', 'AddTabTag', ),
- BasePeer::TYPE_COLNAME => array (AdditionalTablesPeer::ADD_TAB_UID, AdditionalTablesPeer::ADD_TAB_NAME, AdditionalTablesPeer::ADD_TAB_CLASS_NAME, AdditionalTablesPeer::ADD_TAB_DESCRIPTION, AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT, AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE, AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE, AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT, AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH, AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE, AdditionalTablesPeer::ADD_TAB_PLG_UID, AdditionalTablesPeer::DBS_UID, AdditionalTablesPeer::PRO_UID, AdditionalTablesPeer::ADD_TAB_TYPE, AdditionalTablesPeer::ADD_TAB_GRID, AdditionalTablesPeer::ADD_TAB_TAG, ),
- BasePeer::TYPE_FIELDNAME => array ('ADD_TAB_UID', 'ADD_TAB_NAME', 'ADD_TAB_CLASS_NAME', 'ADD_TAB_DESCRIPTION', 'ADD_TAB_SDW_LOG_INSERT', 'ADD_TAB_SDW_LOG_UPDATE', 'ADD_TAB_SDW_LOG_DELETE', 'ADD_TAB_SDW_LOG_SELECT', 'ADD_TAB_SDW_MAX_LENGTH', 'ADD_TAB_SDW_AUTO_DELETE', 'ADD_TAB_PLG_UID', 'DBS_UID', 'PRO_UID', 'ADD_TAB_TYPE', 'ADD_TAB_GRID', 'ADD_TAB_TAG', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AddTabUid' => 0, 'AddTabName' => 1, 'AddTabClassName' => 2, 'AddTabDescription' => 3, 'AddTabSdwLogInsert' => 4, 'AddTabSdwLogUpdate' => 5, 'AddTabSdwLogDelete' => 6, 'AddTabSdwLogSelect' => 7, 'AddTabSdwMaxLength' => 8, 'AddTabSdwAutoDelete' => 9, 'AddTabPlgUid' => 10, 'DbsUid' => 11, 'ProUid' => 12, 'AddTabType' => 13, 'AddTabGrid' => 14, 'AddTabTag' => 15, ),
- BasePeer::TYPE_COLNAME => array (AdditionalTablesPeer::ADD_TAB_UID => 0, AdditionalTablesPeer::ADD_TAB_NAME => 1, AdditionalTablesPeer::ADD_TAB_CLASS_NAME => 2, AdditionalTablesPeer::ADD_TAB_DESCRIPTION => 3, AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT => 4, AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE => 5, AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE => 6, AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT => 7, AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH => 8, AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE => 9, AdditionalTablesPeer::ADD_TAB_PLG_UID => 10, AdditionalTablesPeer::DBS_UID => 11, AdditionalTablesPeer::PRO_UID => 12, AdditionalTablesPeer::ADD_TAB_TYPE => 13, AdditionalTablesPeer::ADD_TAB_GRID => 14, AdditionalTablesPeer::ADD_TAB_TAG => 15, ),
- BasePeer::TYPE_FIELDNAME => array ('ADD_TAB_UID' => 0, 'ADD_TAB_NAME' => 1, 'ADD_TAB_CLASS_NAME' => 2, 'ADD_TAB_DESCRIPTION' => 3, 'ADD_TAB_SDW_LOG_INSERT' => 4, 'ADD_TAB_SDW_LOG_UPDATE' => 5, 'ADD_TAB_SDW_LOG_DELETE' => 6, 'ADD_TAB_SDW_LOG_SELECT' => 7, 'ADD_TAB_SDW_MAX_LENGTH' => 8, 'ADD_TAB_SDW_AUTO_DELETE' => 9, 'ADD_TAB_PLG_UID' => 10, 'DBS_UID' => 11, 'PRO_UID' => 12, 'ADD_TAB_TYPE' => 13, 'ADD_TAB_GRID' => 14, 'ADD_TAB_TAG' => 15, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AdditionalTablesMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AdditionalTablesMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AdditionalTablesPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AdditionalTablesPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AdditionalTablesPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_UID);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_NAME);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_CLASS_NAME);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_DESCRIPTION);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_PLG_UID);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::DBS_UID);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::PRO_UID);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_TYPE);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_GRID);
-
- $criteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_TAG);
-
- }
-
- const COUNT = 'COUNT(ADDITIONAL_TABLES.ADD_TAB_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT ADDITIONAL_TABLES.ADD_TAB_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AdditionalTablesPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AdditionalTablesPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AdditionalTablesPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AdditionalTables
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AdditionalTablesPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AdditionalTablesPeer::populateObjects(AdditionalTablesPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AdditionalTablesPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AdditionalTablesPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AdditionalTablesPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AdditionalTables or Criteria object.
- *
- * @param mixed $values Criteria or AdditionalTables object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AdditionalTables object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AdditionalTables or Criteria object.
- *
- * @param mixed $values Criteria or AdditionalTables object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AdditionalTablesPeer::ADD_TAB_UID);
- $selectCriteria->add(AdditionalTablesPeer::ADD_TAB_UID, $criteria->remove(AdditionalTablesPeer::ADD_TAB_UID), $comparison);
-
- } else { // $values is AdditionalTables object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the ADDITIONAL_TABLES table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AdditionalTablesPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AdditionalTables or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AdditionalTables object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AdditionalTables) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AdditionalTables object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AdditionalTables $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AdditionalTables $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AdditionalTablesPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AdditionalTablesPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AdditionalTablesPeer::DATABASE_NAME, AdditionalTablesPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return AdditionalTables
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(AdditionalTablesPeer::DATABASE_NAME);
-
- $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $pk);
-
-
- $v = AdditionalTablesPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(AdditionalTablesPeer::ADD_TAB_UID, $pks, Criteria::IN);
- $objs = AdditionalTablesPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseAdditionalTablesPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAdditionalTablesPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAdditionalTablesPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AdditionalTablesMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AdditionalTablesMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AdditionalTablesMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AdditionalTablesMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppCacheView.php b/workflow/engine/classes/model/om/BaseAppCacheView.php
index 8b6778480..522fadb98 100755
--- a/workflow/engine/classes/model/om/BaseAppCacheView.php
+++ b/workflow/engine/classes/model/om/BaseAppCacheView.php
@@ -16,2168 +16,2333 @@ include_once 'classes/model/AppCacheViewPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppCacheView extends BaseObject implements Persistent {
+abstract class BaseAppCacheView extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppCacheViewPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the del_index field.
+ * @var int
+ */
+ protected $del_index = 0;
+
+ /**
+ * The value for the app_number field.
+ * @var int
+ */
+ protected $app_number = 0;
+
+ /**
+ * The value for the app_status field.
+ * @var string
+ */
+ protected $app_status = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the previous_usr_uid field.
+ * @var string
+ */
+ protected $previous_usr_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the del_delegate_date field.
+ * @var int
+ */
+ protected $del_delegate_date;
+
+ /**
+ * The value for the del_init_date field.
+ * @var int
+ */
+ protected $del_init_date;
+
+ /**
+ * The value for the del_task_due_date field.
+ * @var int
+ */
+ protected $del_task_due_date;
+
+ /**
+ * The value for the del_finish_date field.
+ * @var int
+ */
+ protected $del_finish_date;
+
+ /**
+ * The value for the del_thread_status field.
+ * @var string
+ */
+ protected $del_thread_status = 'OPEN';
+
+ /**
+ * The value for the app_thread_status field.
+ * @var string
+ */
+ protected $app_thread_status = 'OPEN';
+
+ /**
+ * The value for the app_title field.
+ * @var string
+ */
+ protected $app_title = '';
+
+ /**
+ * The value for the app_pro_title field.
+ * @var string
+ */
+ protected $app_pro_title = '';
+
+ /**
+ * The value for the app_tas_title field.
+ * @var string
+ */
+ protected $app_tas_title = '';
+
+ /**
+ * The value for the app_current_user field.
+ * @var string
+ */
+ protected $app_current_user = '';
+
+ /**
+ * The value for the app_del_previous_user field.
+ * @var string
+ */
+ protected $app_del_previous_user = '';
+
+ /**
+ * The value for the del_priority field.
+ * @var string
+ */
+ protected $del_priority = '3';
+
+ /**
+ * The value for the del_duration field.
+ * @var double
+ */
+ protected $del_duration = 0;
+
+ /**
+ * The value for the del_queue_duration field.
+ * @var double
+ */
+ protected $del_queue_duration = 0;
+
+ /**
+ * The value for the del_delay_duration field.
+ * @var double
+ */
+ protected $del_delay_duration = 0;
+
+ /**
+ * The value for the del_started field.
+ * @var int
+ */
+ protected $del_started = 0;
+
+ /**
+ * The value for the del_finished field.
+ * @var int
+ */
+ protected $del_finished = 0;
+
+ /**
+ * The value for the del_delayed field.
+ * @var int
+ */
+ protected $del_delayed = 0;
+
+ /**
+ * The value for the app_create_date field.
+ * @var int
+ */
+ protected $app_create_date;
+
+ /**
+ * The value for the app_finish_date field.
+ * @var int
+ */
+ protected $app_finish_date;
+
+ /**
+ * The value for the app_update_date field.
+ * @var int
+ */
+ protected $app_update_date;
+
+ /**
+ * The value for the app_overdue_percentage field.
+ * @var double
+ */
+ protected $app_overdue_percentage;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [del_index] column value.
+ *
+ * @return int
+ */
+ public function getDelIndex()
+ {
+
+ return $this->del_index;
+ }
+
+ /**
+ * Get the [app_number] column value.
+ *
+ * @return int
+ */
+ public function getAppNumber()
+ {
+
+ return $this->app_number;
+ }
+
+ /**
+ * Get the [app_status] column value.
+ *
+ * @return string
+ */
+ public function getAppStatus()
+ {
+
+ return $this->app_status;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [previous_usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getPreviousUsrUid()
+ {
+
+ return $this->previous_usr_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [optionally formatted] [del_delegate_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelDelegateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_delegate_date === null || $this->del_delegate_date === '') {
+ return null;
+ } elseif (!is_int($this->del_delegate_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_delegate_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " .
+ var_export($this->del_delegate_date, true));
+ }
+ } else {
+ $ts = $this->del_delegate_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [del_init_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelInitDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_init_date === null || $this->del_init_date === '') {
+ return null;
+ } elseif (!is_int($this->del_init_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_init_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " .
+ var_export($this->del_init_date, true));
+ }
+ } else {
+ $ts = $this->del_init_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [del_task_due_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelTaskDueDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_task_due_date === null || $this->del_task_due_date === '') {
+ return null;
+ } elseif (!is_int($this->del_task_due_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_task_due_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_task_due_date] as date/time value: " .
+ var_export($this->del_task_due_date, true));
+ }
+ } else {
+ $ts = $this->del_task_due_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [del_finish_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelFinishDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_finish_date === null || $this->del_finish_date === '') {
+ return null;
+ } elseif (!is_int($this->del_finish_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_finish_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_finish_date] as date/time value: " .
+ var_export($this->del_finish_date, true));
+ }
+ } else {
+ $ts = $this->del_finish_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [del_thread_status] column value.
+ *
+ * @return string
+ */
+ public function getDelThreadStatus()
+ {
+
+ return $this->del_thread_status;
+ }
+
+ /**
+ * Get the [app_thread_status] column value.
+ *
+ * @return string
+ */
+ public function getAppThreadStatus()
+ {
+
+ return $this->app_thread_status;
+ }
+
+ /**
+ * Get the [app_title] column value.
+ *
+ * @return string
+ */
+ public function getAppTitle()
+ {
+
+ return $this->app_title;
+ }
+
+ /**
+ * Get the [app_pro_title] column value.
+ *
+ * @return string
+ */
+ public function getAppProTitle()
+ {
+
+ return $this->app_pro_title;
+ }
+
+ /**
+ * Get the [app_tas_title] column value.
+ *
+ * @return string
+ */
+ public function getAppTasTitle()
+ {
+
+ return $this->app_tas_title;
+ }
+
+ /**
+ * Get the [app_current_user] column value.
+ *
+ * @return string
+ */
+ public function getAppCurrentUser()
+ {
+
+ return $this->app_current_user;
+ }
+
+ /**
+ * Get the [app_del_previous_user] column value.
+ *
+ * @return string
+ */
+ public function getAppDelPreviousUser()
+ {
+
+ return $this->app_del_previous_user;
+ }
+
+ /**
+ * Get the [del_priority] column value.
+ *
+ * @return string
+ */
+ public function getDelPriority()
+ {
+
+ return $this->del_priority;
+ }
+
+ /**
+ * Get the [del_duration] column value.
+ *
+ * @return double
+ */
+ public function getDelDuration()
+ {
+
+ return $this->del_duration;
+ }
+
+ /**
+ * Get the [del_queue_duration] column value.
+ *
+ * @return double
+ */
+ public function getDelQueueDuration()
+ {
+
+ return $this->del_queue_duration;
+ }
+
+ /**
+ * Get the [del_delay_duration] column value.
+ *
+ * @return double
+ */
+ public function getDelDelayDuration()
+ {
+
+ return $this->del_delay_duration;
+ }
+
+ /**
+ * Get the [del_started] column value.
+ *
+ * @return int
+ */
+ public function getDelStarted()
+ {
+
+ return $this->del_started;
+ }
+
+ /**
+ * Get the [del_finished] column value.
+ *
+ * @return int
+ */
+ public function getDelFinished()
+ {
+
+ return $this->del_finished;
+ }
+
+ /**
+ * Get the [del_delayed] column value.
+ *
+ * @return int
+ */
+ public function getDelDelayed()
+ {
+
+ return $this->del_delayed;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_create_date === null || $this->app_create_date === '') {
+ return null;
+ } elseif (!is_int($this->app_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_create_date] as date/time value: " .
+ var_export($this->app_create_date, true));
+ }
+ } else {
+ $ts = $this->app_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [app_finish_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppFinishDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_finish_date === null || $this->app_finish_date === '') {
+ return null;
+ } elseif (!is_int($this->app_finish_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_finish_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_finish_date] as date/time value: " .
+ var_export($this->app_finish_date, true));
+ }
+ } else {
+ $ts = $this->app_finish_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [app_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_update_date === null || $this->app_update_date === '') {
+ return null;
+ } elseif (!is_int($this->app_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_update_date] as date/time value: " .
+ var_export($this->app_update_date, true));
+ }
+ } else {
+ $ts = $this->app_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_overdue_percentage] column value.
+ *
+ * @return double
+ */
+ public function getAppOverduePercentage()
+ {
+
+ return $this->app_overdue_percentage;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndex($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->del_index !== $v || $v === 0) {
+ $this->del_index = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_INDEX;
+ }
+
+ } // setDelIndex()
+
+ /**
+ * Set the value of [app_number] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppNumber($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->app_number !== $v || $v === 0) {
+ $this->app_number = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_NUMBER;
+ }
+
+ } // setAppNumber()
+
+ /**
+ * Set the value of [app_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_status !== $v || $v === '') {
+ $this->app_status = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_STATUS;
+ }
+
+ } // setAppStatus()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [previous_usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setPreviousUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->previous_usr_uid !== $v || $v === '') {
+ $this->previous_usr_uid = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::PREVIOUS_USR_UID;
+ }
+
+ } // setPreviousUsrUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [del_delegate_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelDelegateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_delegate_date !== $ts) {
+ $this->del_delegate_date = $ts;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_DELEGATE_DATE;
+ }
+
+ } // setDelDelegateDate()
+
+ /**
+ * Set the value of [del_init_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelInitDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_init_date !== $ts) {
+ $this->del_init_date = $ts;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_INIT_DATE;
+ }
+
+ } // setDelInitDate()
+
+ /**
+ * Set the value of [del_task_due_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelTaskDueDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_task_due_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_task_due_date !== $ts) {
+ $this->del_task_due_date = $ts;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_TASK_DUE_DATE;
+ }
+
+ } // setDelTaskDueDate()
+
+ /**
+ * Set the value of [del_finish_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelFinishDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_finish_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_finish_date !== $ts) {
+ $this->del_finish_date = $ts;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_FINISH_DATE;
+ }
+
+ } // setDelFinishDate()
+
+ /**
+ * Set the value of [del_thread_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDelThreadStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->del_thread_status !== $v || $v === 'OPEN') {
+ $this->del_thread_status = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_THREAD_STATUS;
+ }
+
+ } // setDelThreadStatus()
+
+ /**
+ * Set the value of [app_thread_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppThreadStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_thread_status !== $v || $v === 'OPEN') {
+ $this->app_thread_status = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_THREAD_STATUS;
+ }
+
+ } // setAppThreadStatus()
+
+ /**
+ * Set the value of [app_title] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppTitle($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_title !== $v || $v === '') {
+ $this->app_title = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_TITLE;
+ }
+
+ } // setAppTitle()
+
+ /**
+ * Set the value of [app_pro_title] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppProTitle($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_pro_title !== $v || $v === '') {
+ $this->app_pro_title = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_PRO_TITLE;
+ }
+
+ } // setAppProTitle()
+
+ /**
+ * Set the value of [app_tas_title] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppTasTitle($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_tas_title !== $v || $v === '') {
+ $this->app_tas_title = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_TAS_TITLE;
+ }
+
+ } // setAppTasTitle()
+
+ /**
+ * Set the value of [app_current_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppCurrentUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_current_user !== $v || $v === '') {
+ $this->app_current_user = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_CURRENT_USER;
+ }
+
+ } // setAppCurrentUser()
+
+ /**
+ * Set the value of [app_del_previous_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDelPreviousUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_del_previous_user !== $v || $v === '') {
+ $this->app_del_previous_user = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_DEL_PREVIOUS_USER;
+ }
+
+ } // setAppDelPreviousUser()
+
+ /**
+ * Set the value of [del_priority] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDelPriority($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->del_priority !== $v || $v === '3') {
+ $this->del_priority = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_PRIORITY;
+ }
+
+ } // setDelPriority()
+
+ /**
+ * Set the value of [del_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setDelDuration($v)
+ {
+
+ if ($this->del_duration !== $v || $v === 0) {
+ $this->del_duration = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_DURATION;
+ }
+
+ } // setDelDuration()
+
+ /**
+ * Set the value of [del_queue_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setDelQueueDuration($v)
+ {
+
+ if ($this->del_queue_duration !== $v || $v === 0) {
+ $this->del_queue_duration = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_QUEUE_DURATION;
+ }
+
+ } // setDelQueueDuration()
+
+ /**
+ * Set the value of [del_delay_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setDelDelayDuration($v)
+ {
+
+ if ($this->del_delay_duration !== $v || $v === 0) {
+ $this->del_delay_duration = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_DELAY_DURATION;
+ }
+
+ } // setDelDelayDuration()
+
+ /**
+ * Set the value of [del_started] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelStarted($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->del_started !== $v || $v === 0) {
+ $this->del_started = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_STARTED;
+ }
+
+ } // setDelStarted()
+
+ /**
+ * Set the value of [del_finished] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelFinished($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->del_finished !== $v || $v === 0) {
+ $this->del_finished = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_FINISHED;
+ }
+
+ } // setDelFinished()
+
+ /**
+ * Set the value of [del_delayed] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelDelayed($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->del_delayed !== $v || $v === 0) {
+ $this->del_delayed = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::DEL_DELAYED;
+ }
+
+ } // setDelDelayed()
+
+ /**
+ * Set the value of [app_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_create_date !== $ts) {
+ $this->app_create_date = $ts;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_CREATE_DATE;
+ }
+
+ } // setAppCreateDate()
+
+ /**
+ * Set the value of [app_finish_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppFinishDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_finish_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_finish_date !== $ts) {
+ $this->app_finish_date = $ts;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_FINISH_DATE;
+ }
+
+ } // setAppFinishDate()
+
+ /**
+ * Set the value of [app_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_update_date !== $ts) {
+ $this->app_update_date = $ts;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_UPDATE_DATE;
+ }
+ } // setAppUpdateDate()
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppCacheViewPeer
- */
- protected static $peer;
+ /**
+ * Set the value of [app_overdue_percentage] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setAppOverduePercentage($v)
+ {
+ if ($this->app_overdue_percentage !== $v) {
+ $this->app_overdue_percentage = $v;
+ $this->modifiedColumns[] = AppCacheViewPeer::APP_OVERDUE_PERCENTAGE;
+ }
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
+ } // setAppOverduePercentage()
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->del_index = $rs->getInt($startcol + 1);
+
+ $this->app_number = $rs->getInt($startcol + 2);
+
+ $this->app_status = $rs->getString($startcol + 3);
+
+ $this->usr_uid = $rs->getString($startcol + 4);
+
+ $this->previous_usr_uid = $rs->getString($startcol + 5);
+
+ $this->tas_uid = $rs->getString($startcol + 6);
+
+ $this->pro_uid = $rs->getString($startcol + 7);
+
+ $this->del_delegate_date = $rs->getTimestamp($startcol + 8, null);
+
+ $this->del_init_date = $rs->getTimestamp($startcol + 9, null);
+
+ $this->del_task_due_date = $rs->getTimestamp($startcol + 10, null);
+
+ $this->del_finish_date = $rs->getTimestamp($startcol + 11, null);
+
+ $this->del_thread_status = $rs->getString($startcol + 12);
+
+ $this->app_thread_status = $rs->getString($startcol + 13);
+
+ $this->app_title = $rs->getString($startcol + 14);
+
+ $this->app_pro_title = $rs->getString($startcol + 15);
+
+ $this->app_tas_title = $rs->getString($startcol + 16);
+
+ $this->app_current_user = $rs->getString($startcol + 17);
+
+ $this->app_del_previous_user = $rs->getString($startcol + 18);
+
+ $this->del_priority = $rs->getString($startcol + 19);
+
+ $this->del_duration = $rs->getFloat($startcol + 20);
+
+ $this->del_queue_duration = $rs->getFloat($startcol + 21);
+
+ $this->del_delay_duration = $rs->getFloat($startcol + 22);
+
+ $this->del_started = $rs->getInt($startcol + 23);
+
+ $this->del_finished = $rs->getInt($startcol + 24);
+
+ $this->del_delayed = $rs->getInt($startcol + 25);
+
+ $this->app_create_date = $rs->getTimestamp($startcol + 26, null);
+
+ $this->app_finish_date = $rs->getTimestamp($startcol + 27, null);
+
+ $this->app_update_date = $rs->getTimestamp($startcol + 28, null);
+
+ $this->app_overdue_percentage = $rs->getFloat($startcol + 29);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 30; // 30 = AppCacheViewPeer::NUM_COLUMNS - AppCacheViewPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppCacheView object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppCacheViewPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppCacheViewPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppCacheViewPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppCacheViewPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppCacheViewPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppCacheViewPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppCacheViewPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getDelIndex();
+ break;
+ case 2:
+ return $this->getAppNumber();
+ break;
+ case 3:
+ return $this->getAppStatus();
+ break;
+ case 4:
+ return $this->getUsrUid();
+ break;
+ case 5:
+ return $this->getPreviousUsrUid();
+ break;
+ case 6:
+ return $this->getTasUid();
+ break;
+ case 7:
+ return $this->getProUid();
+ break;
+ case 8:
+ return $this->getDelDelegateDate();
+ break;
+ case 9:
+ return $this->getDelInitDate();
+ break;
+ case 10:
+ return $this->getDelTaskDueDate();
+ break;
+ case 11:
+ return $this->getDelFinishDate();
+ break;
+ case 12:
+ return $this->getDelThreadStatus();
+ break;
+ case 13:
+ return $this->getAppThreadStatus();
+ break;
+ case 14:
+ return $this->getAppTitle();
+ break;
+ case 15:
+ return $this->getAppProTitle();
+ break;
+ case 16:
+ return $this->getAppTasTitle();
+ break;
+ case 17:
+ return $this->getAppCurrentUser();
+ break;
+ case 18:
+ return $this->getAppDelPreviousUser();
+ break;
+ case 19:
+ return $this->getDelPriority();
+ break;
+ case 20:
+ return $this->getDelDuration();
+ break;
+ case 21:
+ return $this->getDelQueueDuration();
+ break;
+ case 22:
+ return $this->getDelDelayDuration();
+ break;
+ case 23:
+ return $this->getDelStarted();
+ break;
+ case 24:
+ return $this->getDelFinished();
+ break;
+ case 25:
+ return $this->getDelDelayed();
+ break;
+ case 26:
+ return $this->getAppCreateDate();
+ break;
+ case 27:
+ return $this->getAppFinishDate();
+ break;
+ case 28:
+ return $this->getAppUpdateDate();
+ break;
+ case 29:
+ return $this->getAppOverduePercentage();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppCacheViewPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getDelIndex(),
+ $keys[2] => $this->getAppNumber(),
+ $keys[3] => $this->getAppStatus(),
+ $keys[4] => $this->getUsrUid(),
+ $keys[5] => $this->getPreviousUsrUid(),
+ $keys[6] => $this->getTasUid(),
+ $keys[7] => $this->getProUid(),
+ $keys[8] => $this->getDelDelegateDate(),
+ $keys[9] => $this->getDelInitDate(),
+ $keys[10] => $this->getDelTaskDueDate(),
+ $keys[11] => $this->getDelFinishDate(),
+ $keys[12] => $this->getDelThreadStatus(),
+ $keys[13] => $this->getAppThreadStatus(),
+ $keys[14] => $this->getAppTitle(),
+ $keys[15] => $this->getAppProTitle(),
+ $keys[16] => $this->getAppTasTitle(),
+ $keys[17] => $this->getAppCurrentUser(),
+ $keys[18] => $this->getAppDelPreviousUser(),
+ $keys[19] => $this->getDelPriority(),
+ $keys[20] => $this->getDelDuration(),
+ $keys[21] => $this->getDelQueueDuration(),
+ $keys[22] => $this->getDelDelayDuration(),
+ $keys[23] => $this->getDelStarted(),
+ $keys[24] => $this->getDelFinished(),
+ $keys[25] => $this->getDelDelayed(),
+ $keys[26] => $this->getAppCreateDate(),
+ $keys[27] => $this->getAppFinishDate(),
+ $keys[28] => $this->getAppUpdateDate(),
+ $keys[29] => $this->getAppOverduePercentage(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppCacheViewPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setDelIndex($value);
+ break;
+ case 2:
+ $this->setAppNumber($value);
+ break;
+ case 3:
+ $this->setAppStatus($value);
+ break;
+ case 4:
+ $this->setUsrUid($value);
+ break;
+ case 5:
+ $this->setPreviousUsrUid($value);
+ break;
+ case 6:
+ $this->setTasUid($value);
+ break;
+ case 7:
+ $this->setProUid($value);
+ break;
+ case 8:
+ $this->setDelDelegateDate($value);
+ break;
+ case 9:
+ $this->setDelInitDate($value);
+ break;
+ case 10:
+ $this->setDelTaskDueDate($value);
+ break;
+ case 11:
+ $this->setDelFinishDate($value);
+ break;
+ case 12:
+ $this->setDelThreadStatus($value);
+ break;
+ case 13:
+ $this->setAppThreadStatus($value);
+ break;
+ case 14:
+ $this->setAppTitle($value);
+ break;
+ case 15:
+ $this->setAppProTitle($value);
+ break;
+ case 16:
+ $this->setAppTasTitle($value);
+ break;
+ case 17:
+ $this->setAppCurrentUser($value);
+ break;
+ case 18:
+ $this->setAppDelPreviousUser($value);
+ break;
+ case 19:
+ $this->setDelPriority($value);
+ break;
+ case 20:
+ $this->setDelDuration($value);
+ break;
+ case 21:
+ $this->setDelQueueDuration($value);
+ break;
+ case 22:
+ $this->setDelDelayDuration($value);
+ break;
+ case 23:
+ $this->setDelStarted($value);
+ break;
+ case 24:
+ $this->setDelFinished($value);
+ break;
+ case 25:
+ $this->setDelDelayed($value);
+ break;
+ case 26:
+ $this->setAppCreateDate($value);
+ break;
+ case 27:
+ $this->setAppFinishDate($value);
+ break;
+ case 28:
+ $this->setAppUpdateDate($value);
+ break;
+ case 29:
+ $this->setAppOverduePercentage($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppCacheViewPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDelIndex($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setAppNumber($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setAppStatus($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setUsrUid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setPreviousUsrUid($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setTasUid($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setProUid($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setDelDelegateDate($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setDelInitDate($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setDelTaskDueDate($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setDelFinishDate($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setDelThreadStatus($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setAppThreadStatus($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setAppTitle($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setAppProTitle($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setAppTasTitle($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setAppCurrentUser($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setAppDelPreviousUser($arr[$keys[18]]);
+ }
+
+ if (array_key_exists($keys[19], $arr)) {
+ $this->setDelPriority($arr[$keys[19]]);
+ }
+
+ if (array_key_exists($keys[20], $arr)) {
+ $this->setDelDuration($arr[$keys[20]]);
+ }
+
+ if (array_key_exists($keys[21], $arr)) {
+ $this->setDelQueueDuration($arr[$keys[21]]);
+ }
+
+ if (array_key_exists($keys[22], $arr)) {
+ $this->setDelDelayDuration($arr[$keys[22]]);
+ }
+
+ if (array_key_exists($keys[23], $arr)) {
+ $this->setDelStarted($arr[$keys[23]]);
+ }
+
+ if (array_key_exists($keys[24], $arr)) {
+ $this->setDelFinished($arr[$keys[24]]);
+ }
- /**
- * The value for the del_index field.
- * @var int
- */
- protected $del_index = 0;
+ if (array_key_exists($keys[25], $arr)) {
+ $this->setDelDelayed($arr[$keys[25]]);
+ }
+ if (array_key_exists($keys[26], $arr)) {
+ $this->setAppCreateDate($arr[$keys[26]]);
+ }
- /**
- * The value for the app_number field.
- * @var int
- */
- protected $app_number = 0;
+ if (array_key_exists($keys[27], $arr)) {
+ $this->setAppFinishDate($arr[$keys[27]]);
+ }
+ if (array_key_exists($keys[28], $arr)) {
+ $this->setAppUpdateDate($arr[$keys[28]]);
+ }
- /**
- * The value for the app_status field.
- * @var string
- */
- protected $app_status = '';
+ if (array_key_exists($keys[29], $arr)) {
+ $this->setAppOverduePercentage($arr[$keys[29]]);
+ }
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppCacheViewPeer::DATABASE_NAME);
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
+ if ($this->isColumnModified(AppCacheViewPeer::APP_UID)) {
+ $criteria->add(AppCacheViewPeer::APP_UID, $this->app_uid);
+ }
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_INDEX)) {
+ $criteria->add(AppCacheViewPeer::DEL_INDEX, $this->del_index);
+ }
- /**
- * The value for the previous_usr_uid field.
- * @var string
- */
- protected $previous_usr_uid = '';
+ if ($this->isColumnModified(AppCacheViewPeer::APP_NUMBER)) {
+ $criteria->add(AppCacheViewPeer::APP_NUMBER, $this->app_number);
+ }
+ if ($this->isColumnModified(AppCacheViewPeer::APP_STATUS)) {
+ $criteria->add(AppCacheViewPeer::APP_STATUS, $this->app_status);
+ }
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
+ if ($this->isColumnModified(AppCacheViewPeer::USR_UID)) {
+ $criteria->add(AppCacheViewPeer::USR_UID, $this->usr_uid);
+ }
+ if ($this->isColumnModified(AppCacheViewPeer::PREVIOUS_USR_UID)) {
+ $criteria->add(AppCacheViewPeer::PREVIOUS_USR_UID, $this->previous_usr_uid);
+ }
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ if ($this->isColumnModified(AppCacheViewPeer::TAS_UID)) {
+ $criteria->add(AppCacheViewPeer::TAS_UID, $this->tas_uid);
+ }
+ if ($this->isColumnModified(AppCacheViewPeer::PRO_UID)) {
+ $criteria->add(AppCacheViewPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_DELEGATE_DATE)) {
+ $criteria->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $this->del_delegate_date);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_INIT_DATE)) {
+ $criteria->add(AppCacheViewPeer::DEL_INIT_DATE, $this->del_init_date);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_TASK_DUE_DATE)) {
+ $criteria->add(AppCacheViewPeer::DEL_TASK_DUE_DATE, $this->del_task_due_date);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_FINISH_DATE)) {
+ $criteria->add(AppCacheViewPeer::DEL_FINISH_DATE, $this->del_finish_date);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_THREAD_STATUS)) {
+ $criteria->add(AppCacheViewPeer::DEL_THREAD_STATUS, $this->del_thread_status);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::APP_THREAD_STATUS)) {
+ $criteria->add(AppCacheViewPeer::APP_THREAD_STATUS, $this->app_thread_status);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::APP_TITLE)) {
+ $criteria->add(AppCacheViewPeer::APP_TITLE, $this->app_title);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::APP_PRO_TITLE)) {
+ $criteria->add(AppCacheViewPeer::APP_PRO_TITLE, $this->app_pro_title);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::APP_TAS_TITLE)) {
+ $criteria->add(AppCacheViewPeer::APP_TAS_TITLE, $this->app_tas_title);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::APP_CURRENT_USER)) {
+ $criteria->add(AppCacheViewPeer::APP_CURRENT_USER, $this->app_current_user);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::APP_DEL_PREVIOUS_USER)) {
+ $criteria->add(AppCacheViewPeer::APP_DEL_PREVIOUS_USER, $this->app_del_previous_user);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_PRIORITY)) {
+ $criteria->add(AppCacheViewPeer::DEL_PRIORITY, $this->del_priority);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_DURATION)) {
+ $criteria->add(AppCacheViewPeer::DEL_DURATION, $this->del_duration);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_QUEUE_DURATION)) {
+ $criteria->add(AppCacheViewPeer::DEL_QUEUE_DURATION, $this->del_queue_duration);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_DELAY_DURATION)) {
+ $criteria->add(AppCacheViewPeer::DEL_DELAY_DURATION, $this->del_delay_duration);
+ }
+
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_STARTED)) {
+ $criteria->add(AppCacheViewPeer::DEL_STARTED, $this->del_started);
+ }
- /**
- * The value for the del_delegate_date field.
- * @var int
- */
- protected $del_delegate_date;
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_FINISHED)) {
+ $criteria->add(AppCacheViewPeer::DEL_FINISHED, $this->del_finished);
+ }
+ if ($this->isColumnModified(AppCacheViewPeer::DEL_DELAYED)) {
+ $criteria->add(AppCacheViewPeer::DEL_DELAYED, $this->del_delayed);
+ }
- /**
- * The value for the del_init_date field.
- * @var int
- */
- protected $del_init_date;
+ if ($this->isColumnModified(AppCacheViewPeer::APP_CREATE_DATE)) {
+ $criteria->add(AppCacheViewPeer::APP_CREATE_DATE, $this->app_create_date);
+ }
+ if ($this->isColumnModified(AppCacheViewPeer::APP_FINISH_DATE)) {
+ $criteria->add(AppCacheViewPeer::APP_FINISH_DATE, $this->app_finish_date);
+ }
- /**
- * The value for the del_task_due_date field.
- * @var int
- */
- protected $del_task_due_date;
+ if ($this->isColumnModified(AppCacheViewPeer::APP_UPDATE_DATE)) {
+ $criteria->add(AppCacheViewPeer::APP_UPDATE_DATE, $this->app_update_date);
+ }
+ if ($this->isColumnModified(AppCacheViewPeer::APP_OVERDUE_PERCENTAGE)) {
+ $criteria->add(AppCacheViewPeer::APP_OVERDUE_PERCENTAGE, $this->app_overdue_percentage);
+ }
- /**
- * The value for the del_finish_date field.
- * @var int
- */
- protected $del_finish_date;
+ return $criteria;
+ }
- /**
- * The value for the del_thread_status field.
- * @var string
- */
- protected $del_thread_status = 'OPEN';
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppCacheViewPeer::DATABASE_NAME);
+ $criteria->add(AppCacheViewPeer::APP_UID, $this->app_uid);
+ $criteria->add(AppCacheViewPeer::DEL_INDEX, $this->del_index);
- /**
- * The value for the app_thread_status field.
- * @var string
- */
- protected $app_thread_status = 'OPEN';
+ return $criteria;
+ }
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
- /**
- * The value for the app_title field.
- * @var string
- */
- protected $app_title = '';
+ $pks[0] = $this->getAppUid();
+ $pks[1] = $this->getDelIndex();
- /**
- * The value for the app_pro_title field.
- * @var string
- */
- protected $app_pro_title = '';
+ return $pks;
+ }
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
- /**
- * The value for the app_tas_title field.
- * @var string
- */
- protected $app_tas_title = '';
+ $this->setAppUid($keys[0]);
+ $this->setDelIndex($keys[1]);
- /**
- * The value for the app_current_user field.
- * @var string
- */
- protected $app_current_user = '';
+ }
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppCacheView (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
- /**
- * The value for the app_del_previous_user field.
- * @var string
- */
- protected $app_del_previous_user = '';
+ $copyObj->setAppNumber($this->app_number);
+ $copyObj->setAppStatus($this->app_status);
- /**
- * The value for the del_priority field.
- * @var string
- */
- protected $del_priority = '3';
+ $copyObj->setUsrUid($this->usr_uid);
+ $copyObj->setPreviousUsrUid($this->previous_usr_uid);
- /**
- * The value for the del_duration field.
- * @var double
- */
- protected $del_duration = 0;
+ $copyObj->setTasUid($this->tas_uid);
+ $copyObj->setProUid($this->pro_uid);
- /**
- * The value for the del_queue_duration field.
- * @var double
- */
- protected $del_queue_duration = 0;
+ $copyObj->setDelDelegateDate($this->del_delegate_date);
+ $copyObj->setDelInitDate($this->del_init_date);
- /**
- * The value for the del_delay_duration field.
- * @var double
- */
- protected $del_delay_duration = 0;
+ $copyObj->setDelTaskDueDate($this->del_task_due_date);
+ $copyObj->setDelFinishDate($this->del_finish_date);
- /**
- * The value for the del_started field.
- * @var int
- */
- protected $del_started = 0;
+ $copyObj->setDelThreadStatus($this->del_thread_status);
+ $copyObj->setAppThreadStatus($this->app_thread_status);
- /**
- * The value for the del_finished field.
- * @var int
- */
- protected $del_finished = 0;
-
+ $copyObj->setAppTitle($this->app_title);
- /**
- * The value for the del_delayed field.
- * @var int
- */
- protected $del_delayed = 0;
-
-
- /**
- * The value for the app_create_date field.
- * @var int
- */
- protected $app_create_date;
-
-
- /**
- * The value for the app_finish_date field.
- * @var int
- */
- protected $app_finish_date;
-
-
- /**
- * The value for the app_update_date field.
- * @var int
- */
- protected $app_update_date;
-
-
- /**
- * The value for the app_overdue_percentage field.
- * @var double
- */
- protected $app_overdue_percentage;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [del_index] column value.
- *
- * @return int
- */
- public function getDelIndex()
- {
-
- return $this->del_index;
- }
-
- /**
- * Get the [app_number] column value.
- *
- * @return int
- */
- public function getAppNumber()
- {
-
- return $this->app_number;
- }
-
- /**
- * Get the [app_status] column value.
- *
- * @return string
- */
- public function getAppStatus()
- {
-
- return $this->app_status;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [previous_usr_uid] column value.
- *
- * @return string
- */
- public function getPreviousUsrUid()
- {
-
- return $this->previous_usr_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [optionally formatted] [del_delegate_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelDelegateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_delegate_date === null || $this->del_delegate_date === '') {
- return null;
- } elseif (!is_int($this->del_delegate_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_delegate_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " . var_export($this->del_delegate_date, true));
- }
- } else {
- $ts = $this->del_delegate_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [del_init_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelInitDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_init_date === null || $this->del_init_date === '') {
- return null;
- } elseif (!is_int($this->del_init_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_init_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " . var_export($this->del_init_date, true));
- }
- } else {
- $ts = $this->del_init_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [del_task_due_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelTaskDueDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_task_due_date === null || $this->del_task_due_date === '') {
- return null;
- } elseif (!is_int($this->del_task_due_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_task_due_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_task_due_date] as date/time value: " . var_export($this->del_task_due_date, true));
- }
- } else {
- $ts = $this->del_task_due_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [del_finish_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelFinishDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_finish_date === null || $this->del_finish_date === '') {
- return null;
- } elseif (!is_int($this->del_finish_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_finish_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_finish_date] as date/time value: " . var_export($this->del_finish_date, true));
- }
- } else {
- $ts = $this->del_finish_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [del_thread_status] column value.
- *
- * @return string
- */
- public function getDelThreadStatus()
- {
-
- return $this->del_thread_status;
- }
-
- /**
- * Get the [app_thread_status] column value.
- *
- * @return string
- */
- public function getAppThreadStatus()
- {
-
- return $this->app_thread_status;
- }
-
- /**
- * Get the [app_title] column value.
- *
- * @return string
- */
- public function getAppTitle()
- {
-
- return $this->app_title;
- }
-
- /**
- * Get the [app_pro_title] column value.
- *
- * @return string
- */
- public function getAppProTitle()
- {
-
- return $this->app_pro_title;
- }
-
- /**
- * Get the [app_tas_title] column value.
- *
- * @return string
- */
- public function getAppTasTitle()
- {
-
- return $this->app_tas_title;
- }
-
- /**
- * Get the [app_current_user] column value.
- *
- * @return string
- */
- public function getAppCurrentUser()
- {
-
- return $this->app_current_user;
- }
-
- /**
- * Get the [app_del_previous_user] column value.
- *
- * @return string
- */
- public function getAppDelPreviousUser()
- {
-
- return $this->app_del_previous_user;
- }
-
- /**
- * Get the [del_priority] column value.
- *
- * @return string
- */
- public function getDelPriority()
- {
-
- return $this->del_priority;
- }
-
- /**
- * Get the [del_duration] column value.
- *
- * @return double
- */
- public function getDelDuration()
- {
-
- return $this->del_duration;
- }
-
- /**
- * Get the [del_queue_duration] column value.
- *
- * @return double
- */
- public function getDelQueueDuration()
- {
-
- return $this->del_queue_duration;
- }
-
- /**
- * Get the [del_delay_duration] column value.
- *
- * @return double
- */
- public function getDelDelayDuration()
- {
-
- return $this->del_delay_duration;
- }
-
- /**
- * Get the [del_started] column value.
- *
- * @return int
- */
- public function getDelStarted()
- {
-
- return $this->del_started;
- }
-
- /**
- * Get the [del_finished] column value.
- *
- * @return int
- */
- public function getDelFinished()
- {
-
- return $this->del_finished;
- }
-
- /**
- * Get the [del_delayed] column value.
- *
- * @return int
- */
- public function getDelDelayed()
- {
-
- return $this->del_delayed;
- }
-
- /**
- * Get the [optionally formatted] [app_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_create_date === null || $this->app_create_date === '') {
- return null;
- } elseif (!is_int($this->app_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_create_date] as date/time value: " . var_export($this->app_create_date, true));
- }
- } else {
- $ts = $this->app_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [app_finish_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppFinishDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_finish_date === null || $this->app_finish_date === '') {
- return null;
- } elseif (!is_int($this->app_finish_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_finish_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_finish_date] as date/time value: " . var_export($this->app_finish_date, true));
- }
- } else {
- $ts = $this->app_finish_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [app_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_update_date === null || $this->app_update_date === '') {
- return null;
- } elseif (!is_int($this->app_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_update_date] as date/time value: " . var_export($this->app_update_date, true));
- }
- } else {
- $ts = $this->app_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [app_overdue_percentage] column value.
- *
- * @return double
- */
- public function getAppOverduePercentage()
- {
-
- return $this->app_overdue_percentage;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndex($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->del_index !== $v || $v === 0) {
- $this->del_index = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_INDEX;
- }
-
- } // setDelIndex()
-
- /**
- * Set the value of [app_number] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppNumber($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->app_number !== $v || $v === 0) {
- $this->app_number = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_NUMBER;
- }
-
- } // setAppNumber()
-
- /**
- * Set the value of [app_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_status !== $v || $v === '') {
- $this->app_status = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_STATUS;
- }
-
- } // setAppStatus()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [previous_usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setPreviousUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->previous_usr_uid !== $v || $v === '') {
- $this->previous_usr_uid = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::PREVIOUS_USR_UID;
- }
-
- } // setPreviousUsrUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [del_delegate_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelDelegateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_delegate_date !== $ts) {
- $this->del_delegate_date = $ts;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_DELEGATE_DATE;
- }
-
- } // setDelDelegateDate()
-
- /**
- * Set the value of [del_init_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelInitDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_init_date !== $ts) {
- $this->del_init_date = $ts;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_INIT_DATE;
- }
-
- } // setDelInitDate()
-
- /**
- * Set the value of [del_task_due_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelTaskDueDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_task_due_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_task_due_date !== $ts) {
- $this->del_task_due_date = $ts;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_TASK_DUE_DATE;
- }
-
- } // setDelTaskDueDate()
-
- /**
- * Set the value of [del_finish_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelFinishDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_finish_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_finish_date !== $ts) {
- $this->del_finish_date = $ts;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_FINISH_DATE;
- }
-
- } // setDelFinishDate()
-
- /**
- * Set the value of [del_thread_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDelThreadStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->del_thread_status !== $v || $v === 'OPEN') {
- $this->del_thread_status = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_THREAD_STATUS;
- }
-
- } // setDelThreadStatus()
-
- /**
- * Set the value of [app_thread_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppThreadStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_thread_status !== $v || $v === 'OPEN') {
- $this->app_thread_status = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_THREAD_STATUS;
- }
-
- } // setAppThreadStatus()
-
- /**
- * Set the value of [app_title] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppTitle($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_title !== $v || $v === '') {
- $this->app_title = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_TITLE;
- }
-
- } // setAppTitle()
-
- /**
- * Set the value of [app_pro_title] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppProTitle($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_pro_title !== $v || $v === '') {
- $this->app_pro_title = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_PRO_TITLE;
- }
-
- } // setAppProTitle()
-
- /**
- * Set the value of [app_tas_title] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppTasTitle($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_tas_title !== $v || $v === '') {
- $this->app_tas_title = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_TAS_TITLE;
- }
-
- } // setAppTasTitle()
-
- /**
- * Set the value of [app_current_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppCurrentUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_current_user !== $v || $v === '') {
- $this->app_current_user = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_CURRENT_USER;
- }
-
- } // setAppCurrentUser()
-
- /**
- * Set the value of [app_del_previous_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDelPreviousUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_del_previous_user !== $v || $v === '') {
- $this->app_del_previous_user = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_DEL_PREVIOUS_USER;
- }
-
- } // setAppDelPreviousUser()
-
- /**
- * Set the value of [del_priority] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDelPriority($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->del_priority !== $v || $v === '3') {
- $this->del_priority = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_PRIORITY;
- }
-
- } // setDelPriority()
-
- /**
- * Set the value of [del_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setDelDuration($v)
- {
-
- if ($this->del_duration !== $v || $v === 0) {
- $this->del_duration = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_DURATION;
- }
-
- } // setDelDuration()
-
- /**
- * Set the value of [del_queue_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setDelQueueDuration($v)
- {
-
- if ($this->del_queue_duration !== $v || $v === 0) {
- $this->del_queue_duration = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_QUEUE_DURATION;
- }
-
- } // setDelQueueDuration()
-
- /**
- * Set the value of [del_delay_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setDelDelayDuration($v)
- {
-
- if ($this->del_delay_duration !== $v || $v === 0) {
- $this->del_delay_duration = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_DELAY_DURATION;
- }
-
- } // setDelDelayDuration()
-
- /**
- * Set the value of [del_started] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelStarted($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->del_started !== $v || $v === 0) {
- $this->del_started = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_STARTED;
- }
-
- } // setDelStarted()
-
- /**
- * Set the value of [del_finished] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelFinished($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->del_finished !== $v || $v === 0) {
- $this->del_finished = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_FINISHED;
- }
-
- } // setDelFinished()
-
- /**
- * Set the value of [del_delayed] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelDelayed($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->del_delayed !== $v || $v === 0) {
- $this->del_delayed = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::DEL_DELAYED;
- }
-
- } // setDelDelayed()
-
- /**
- * Set the value of [app_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_create_date !== $ts) {
- $this->app_create_date = $ts;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_CREATE_DATE;
- }
-
- } // setAppCreateDate()
-
- /**
- * Set the value of [app_finish_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppFinishDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_finish_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_finish_date !== $ts) {
- $this->app_finish_date = $ts;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_FINISH_DATE;
- }
-
- } // setAppFinishDate()
-
- /**
- * Set the value of [app_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_update_date !== $ts) {
- $this->app_update_date = $ts;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_UPDATE_DATE;
- }
+ $copyObj->setAppProTitle($this->app_pro_title);
- } // setAppUpdateDate()
+ $copyObj->setAppTasTitle($this->app_tas_title);
- /**
- * Set the value of [app_overdue_percentage] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setAppOverduePercentage($v)
- {
+ $copyObj->setAppCurrentUser($this->app_current_user);
- if ($this->app_overdue_percentage !== $v) {
- $this->app_overdue_percentage = $v;
- $this->modifiedColumns[] = AppCacheViewPeer::APP_OVERDUE_PERCENTAGE;
- }
+ $copyObj->setAppDelPreviousUser($this->app_del_previous_user);
- } // setAppOverduePercentage()
+ $copyObj->setDelPriority($this->del_priority);
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
+ $copyObj->setDelDuration($this->del_duration);
- $this->del_index = $rs->getInt($startcol + 1);
+ $copyObj->setDelQueueDuration($this->del_queue_duration);
- $this->app_number = $rs->getInt($startcol + 2);
-
- $this->app_status = $rs->getString($startcol + 3);
-
- $this->usr_uid = $rs->getString($startcol + 4);
-
- $this->previous_usr_uid = $rs->getString($startcol + 5);
-
- $this->tas_uid = $rs->getString($startcol + 6);
-
- $this->pro_uid = $rs->getString($startcol + 7);
-
- $this->del_delegate_date = $rs->getTimestamp($startcol + 8, null);
-
- $this->del_init_date = $rs->getTimestamp($startcol + 9, null);
-
- $this->del_task_due_date = $rs->getTimestamp($startcol + 10, null);
-
- $this->del_finish_date = $rs->getTimestamp($startcol + 11, null);
-
- $this->del_thread_status = $rs->getString($startcol + 12);
-
- $this->app_thread_status = $rs->getString($startcol + 13);
-
- $this->app_title = $rs->getString($startcol + 14);
-
- $this->app_pro_title = $rs->getString($startcol + 15);
-
- $this->app_tas_title = $rs->getString($startcol + 16);
-
- $this->app_current_user = $rs->getString($startcol + 17);
-
- $this->app_del_previous_user = $rs->getString($startcol + 18);
-
- $this->del_priority = $rs->getString($startcol + 19);
-
- $this->del_duration = $rs->getFloat($startcol + 20);
-
- $this->del_queue_duration = $rs->getFloat($startcol + 21);
-
- $this->del_delay_duration = $rs->getFloat($startcol + 22);
-
- $this->del_started = $rs->getInt($startcol + 23);
-
- $this->del_finished = $rs->getInt($startcol + 24);
-
- $this->del_delayed = $rs->getInt($startcol + 25);
-
- $this->app_create_date = $rs->getTimestamp($startcol + 26, null);
-
- $this->app_finish_date = $rs->getTimestamp($startcol + 27, null);
-
- $this->app_update_date = $rs->getTimestamp($startcol + 28, null);
-
- $this->app_overdue_percentage = $rs->getFloat($startcol + 29);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 30; // 30 = AppCacheViewPeer::NUM_COLUMNS - AppCacheViewPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppCacheView object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppCacheViewPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppCacheViewPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppCacheViewPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppCacheViewPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppCacheViewPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppCacheViewPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppCacheViewPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getDelIndex();
- break;
- case 2:
- return $this->getAppNumber();
- break;
- case 3:
- return $this->getAppStatus();
- break;
- case 4:
- return $this->getUsrUid();
- break;
- case 5:
- return $this->getPreviousUsrUid();
- break;
- case 6:
- return $this->getTasUid();
- break;
- case 7:
- return $this->getProUid();
- break;
- case 8:
- return $this->getDelDelegateDate();
- break;
- case 9:
- return $this->getDelInitDate();
- break;
- case 10:
- return $this->getDelTaskDueDate();
- break;
- case 11:
- return $this->getDelFinishDate();
- break;
- case 12:
- return $this->getDelThreadStatus();
- break;
- case 13:
- return $this->getAppThreadStatus();
- break;
- case 14:
- return $this->getAppTitle();
- break;
- case 15:
- return $this->getAppProTitle();
- break;
- case 16:
- return $this->getAppTasTitle();
- break;
- case 17:
- return $this->getAppCurrentUser();
- break;
- case 18:
- return $this->getAppDelPreviousUser();
- break;
- case 19:
- return $this->getDelPriority();
- break;
- case 20:
- return $this->getDelDuration();
- break;
- case 21:
- return $this->getDelQueueDuration();
- break;
- case 22:
- return $this->getDelDelayDuration();
- break;
- case 23:
- return $this->getDelStarted();
- break;
- case 24:
- return $this->getDelFinished();
- break;
- case 25:
- return $this->getDelDelayed();
- break;
- case 26:
- return $this->getAppCreateDate();
- break;
- case 27:
- return $this->getAppFinishDate();
- break;
- case 28:
- return $this->getAppUpdateDate();
- break;
- case 29:
- return $this->getAppOverduePercentage();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppCacheViewPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getDelIndex(),
- $keys[2] => $this->getAppNumber(),
- $keys[3] => $this->getAppStatus(),
- $keys[4] => $this->getUsrUid(),
- $keys[5] => $this->getPreviousUsrUid(),
- $keys[6] => $this->getTasUid(),
- $keys[7] => $this->getProUid(),
- $keys[8] => $this->getDelDelegateDate(),
- $keys[9] => $this->getDelInitDate(),
- $keys[10] => $this->getDelTaskDueDate(),
- $keys[11] => $this->getDelFinishDate(),
- $keys[12] => $this->getDelThreadStatus(),
- $keys[13] => $this->getAppThreadStatus(),
- $keys[14] => $this->getAppTitle(),
- $keys[15] => $this->getAppProTitle(),
- $keys[16] => $this->getAppTasTitle(),
- $keys[17] => $this->getAppCurrentUser(),
- $keys[18] => $this->getAppDelPreviousUser(),
- $keys[19] => $this->getDelPriority(),
- $keys[20] => $this->getDelDuration(),
- $keys[21] => $this->getDelQueueDuration(),
- $keys[22] => $this->getDelDelayDuration(),
- $keys[23] => $this->getDelStarted(),
- $keys[24] => $this->getDelFinished(),
- $keys[25] => $this->getDelDelayed(),
- $keys[26] => $this->getAppCreateDate(),
- $keys[27] => $this->getAppFinishDate(),
- $keys[28] => $this->getAppUpdateDate(),
- $keys[29] => $this->getAppOverduePercentage(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppCacheViewPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setDelIndex($value);
- break;
- case 2:
- $this->setAppNumber($value);
- break;
- case 3:
- $this->setAppStatus($value);
- break;
- case 4:
- $this->setUsrUid($value);
- break;
- case 5:
- $this->setPreviousUsrUid($value);
- break;
- case 6:
- $this->setTasUid($value);
- break;
- case 7:
- $this->setProUid($value);
- break;
- case 8:
- $this->setDelDelegateDate($value);
- break;
- case 9:
- $this->setDelInitDate($value);
- break;
- case 10:
- $this->setDelTaskDueDate($value);
- break;
- case 11:
- $this->setDelFinishDate($value);
- break;
- case 12:
- $this->setDelThreadStatus($value);
- break;
- case 13:
- $this->setAppThreadStatus($value);
- break;
- case 14:
- $this->setAppTitle($value);
- break;
- case 15:
- $this->setAppProTitle($value);
- break;
- case 16:
- $this->setAppTasTitle($value);
- break;
- case 17:
- $this->setAppCurrentUser($value);
- break;
- case 18:
- $this->setAppDelPreviousUser($value);
- break;
- case 19:
- $this->setDelPriority($value);
- break;
- case 20:
- $this->setDelDuration($value);
- break;
- case 21:
- $this->setDelQueueDuration($value);
- break;
- case 22:
- $this->setDelDelayDuration($value);
- break;
- case 23:
- $this->setDelStarted($value);
- break;
- case 24:
- $this->setDelFinished($value);
- break;
- case 25:
- $this->setDelDelayed($value);
- break;
- case 26:
- $this->setAppCreateDate($value);
- break;
- case 27:
- $this->setAppFinishDate($value);
- break;
- case 28:
- $this->setAppUpdateDate($value);
- break;
- case 29:
- $this->setAppOverduePercentage($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppCacheViewPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDelIndex($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAppNumber($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setAppStatus($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setUsrUid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setPreviousUsrUid($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setTasUid($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setProUid($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setDelDelegateDate($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setDelInitDate($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setDelTaskDueDate($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setDelFinishDate($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setDelThreadStatus($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setAppThreadStatus($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setAppTitle($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setAppProTitle($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setAppTasTitle($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setAppCurrentUser($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setAppDelPreviousUser($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setDelPriority($arr[$keys[19]]);
- if (array_key_exists($keys[20], $arr)) $this->setDelDuration($arr[$keys[20]]);
- if (array_key_exists($keys[21], $arr)) $this->setDelQueueDuration($arr[$keys[21]]);
- if (array_key_exists($keys[22], $arr)) $this->setDelDelayDuration($arr[$keys[22]]);
- if (array_key_exists($keys[23], $arr)) $this->setDelStarted($arr[$keys[23]]);
- if (array_key_exists($keys[24], $arr)) $this->setDelFinished($arr[$keys[24]]);
- if (array_key_exists($keys[25], $arr)) $this->setDelDelayed($arr[$keys[25]]);
- if (array_key_exists($keys[26], $arr)) $this->setAppCreateDate($arr[$keys[26]]);
- if (array_key_exists($keys[27], $arr)) $this->setAppFinishDate($arr[$keys[27]]);
- if (array_key_exists($keys[28], $arr)) $this->setAppUpdateDate($arr[$keys[28]]);
- if (array_key_exists($keys[29], $arr)) $this->setAppOverduePercentage($arr[$keys[29]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppCacheViewPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppCacheViewPeer::APP_UID)) $criteria->add(AppCacheViewPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_INDEX)) $criteria->add(AppCacheViewPeer::DEL_INDEX, $this->del_index);
- if ($this->isColumnModified(AppCacheViewPeer::APP_NUMBER)) $criteria->add(AppCacheViewPeer::APP_NUMBER, $this->app_number);
- if ($this->isColumnModified(AppCacheViewPeer::APP_STATUS)) $criteria->add(AppCacheViewPeer::APP_STATUS, $this->app_status);
- if ($this->isColumnModified(AppCacheViewPeer::USR_UID)) $criteria->add(AppCacheViewPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(AppCacheViewPeer::PREVIOUS_USR_UID)) $criteria->add(AppCacheViewPeer::PREVIOUS_USR_UID, $this->previous_usr_uid);
- if ($this->isColumnModified(AppCacheViewPeer::TAS_UID)) $criteria->add(AppCacheViewPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(AppCacheViewPeer::PRO_UID)) $criteria->add(AppCacheViewPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_DELEGATE_DATE)) $criteria->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $this->del_delegate_date);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_INIT_DATE)) $criteria->add(AppCacheViewPeer::DEL_INIT_DATE, $this->del_init_date);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_TASK_DUE_DATE)) $criteria->add(AppCacheViewPeer::DEL_TASK_DUE_DATE, $this->del_task_due_date);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_FINISH_DATE)) $criteria->add(AppCacheViewPeer::DEL_FINISH_DATE, $this->del_finish_date);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_THREAD_STATUS)) $criteria->add(AppCacheViewPeer::DEL_THREAD_STATUS, $this->del_thread_status);
- if ($this->isColumnModified(AppCacheViewPeer::APP_THREAD_STATUS)) $criteria->add(AppCacheViewPeer::APP_THREAD_STATUS, $this->app_thread_status);
- if ($this->isColumnModified(AppCacheViewPeer::APP_TITLE)) $criteria->add(AppCacheViewPeer::APP_TITLE, $this->app_title);
- if ($this->isColumnModified(AppCacheViewPeer::APP_PRO_TITLE)) $criteria->add(AppCacheViewPeer::APP_PRO_TITLE, $this->app_pro_title);
- if ($this->isColumnModified(AppCacheViewPeer::APP_TAS_TITLE)) $criteria->add(AppCacheViewPeer::APP_TAS_TITLE, $this->app_tas_title);
- if ($this->isColumnModified(AppCacheViewPeer::APP_CURRENT_USER)) $criteria->add(AppCacheViewPeer::APP_CURRENT_USER, $this->app_current_user);
- if ($this->isColumnModified(AppCacheViewPeer::APP_DEL_PREVIOUS_USER)) $criteria->add(AppCacheViewPeer::APP_DEL_PREVIOUS_USER, $this->app_del_previous_user);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_PRIORITY)) $criteria->add(AppCacheViewPeer::DEL_PRIORITY, $this->del_priority);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_DURATION)) $criteria->add(AppCacheViewPeer::DEL_DURATION, $this->del_duration);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_QUEUE_DURATION)) $criteria->add(AppCacheViewPeer::DEL_QUEUE_DURATION, $this->del_queue_duration);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_DELAY_DURATION)) $criteria->add(AppCacheViewPeer::DEL_DELAY_DURATION, $this->del_delay_duration);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_STARTED)) $criteria->add(AppCacheViewPeer::DEL_STARTED, $this->del_started);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_FINISHED)) $criteria->add(AppCacheViewPeer::DEL_FINISHED, $this->del_finished);
- if ($this->isColumnModified(AppCacheViewPeer::DEL_DELAYED)) $criteria->add(AppCacheViewPeer::DEL_DELAYED, $this->del_delayed);
- if ($this->isColumnModified(AppCacheViewPeer::APP_CREATE_DATE)) $criteria->add(AppCacheViewPeer::APP_CREATE_DATE, $this->app_create_date);
- if ($this->isColumnModified(AppCacheViewPeer::APP_FINISH_DATE)) $criteria->add(AppCacheViewPeer::APP_FINISH_DATE, $this->app_finish_date);
- if ($this->isColumnModified(AppCacheViewPeer::APP_UPDATE_DATE)) $criteria->add(AppCacheViewPeer::APP_UPDATE_DATE, $this->app_update_date);
- if ($this->isColumnModified(AppCacheViewPeer::APP_OVERDUE_PERCENTAGE)) $criteria->add(AppCacheViewPeer::APP_OVERDUE_PERCENTAGE, $this->app_overdue_percentage);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppCacheViewPeer::DATABASE_NAME);
-
- $criteria->add(AppCacheViewPeer::APP_UID, $this->app_uid);
- $criteria->add(AppCacheViewPeer::DEL_INDEX, $this->del_index);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getAppUid();
-
- $pks[1] = $this->getDelIndex();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setAppUid($keys[0]);
-
- $this->setDelIndex($keys[1]);
-
- }
+ $copyObj->setDelDelayDuration($this->del_delay_duration);
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppCacheView (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppNumber($this->app_number);
-
- $copyObj->setAppStatus($this->app_status);
+ $copyObj->setDelStarted($this->del_started);
- $copyObj->setUsrUid($this->usr_uid);
+ $copyObj->setDelFinished($this->del_finished);
- $copyObj->setPreviousUsrUid($this->previous_usr_uid);
+ $copyObj->setDelDelayed($this->del_delayed);
- $copyObj->setTasUid($this->tas_uid);
+ $copyObj->setAppCreateDate($this->app_create_date);
- $copyObj->setProUid($this->pro_uid);
+ $copyObj->setAppFinishDate($this->app_finish_date);
- $copyObj->setDelDelegateDate($this->del_delegate_date);
+ $copyObj->setAppUpdateDate($this->app_update_date);
- $copyObj->setDelInitDate($this->del_init_date);
+ $copyObj->setAppOverduePercentage($this->app_overdue_percentage);
- $copyObj->setDelTaskDueDate($this->del_task_due_date);
- $copyObj->setDelFinishDate($this->del_finish_date);
+ $copyObj->setNew(true);
- $copyObj->setDelThreadStatus($this->del_thread_status);
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
- $copyObj->setAppThreadStatus($this->app_thread_status);
+ $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
- $copyObj->setAppTitle($this->app_title);
+ }
- $copyObj->setAppProTitle($this->app_pro_title);
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppCacheView Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
- $copyObj->setAppTasTitle($this->app_tas_title);
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppCacheViewPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppCacheViewPeer();
+ }
+ return self::$peer;
+ }
+}
- $copyObj->setAppCurrentUser($this->app_current_user);
-
- $copyObj->setAppDelPreviousUser($this->app_del_previous_user);
-
- $copyObj->setDelPriority($this->del_priority);
-
- $copyObj->setDelDuration($this->del_duration);
-
- $copyObj->setDelQueueDuration($this->del_queue_duration);
-
- $copyObj->setDelDelayDuration($this->del_delay_duration);
-
- $copyObj->setDelStarted($this->del_started);
-
- $copyObj->setDelFinished($this->del_finished);
-
- $copyObj->setDelDelayed($this->del_delayed);
-
- $copyObj->setAppCreateDate($this->app_create_date);
-
- $copyObj->setAppFinishDate($this->app_finish_date);
-
- $copyObj->setAppUpdateDate($this->app_update_date);
-
- $copyObj->setAppOverduePercentage($this->app_overdue_percentage);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppCacheView Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppCacheViewPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppCacheViewPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppCacheView
diff --git a/workflow/engine/classes/model/om/BaseAppCacheViewPeer.php b/workflow/engine/classes/model/om/BaseAppCacheViewPeer.php
index df3ab84d3..862712034 100755
--- a/workflow/engine/classes/model/om/BaseAppCacheViewPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppCacheViewPeer.php
@@ -12,690 +12,691 @@ include_once 'classes/model/AppCacheView.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppCacheViewPeer {
+abstract class BaseAppCacheViewPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'APP_CACHE_VIEW';
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_CACHE_VIEW';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppCacheView';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppCacheView';
- /** The total number of columns. */
- const NUM_COLUMNS = 30;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 30;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_CACHE_VIEW.APP_UID';
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_CACHE_VIEW.APP_UID';
- /** the column name for the DEL_INDEX field */
- const DEL_INDEX = 'APP_CACHE_VIEW.DEL_INDEX';
+ /** the column name for the DEL_INDEX field */
+ const DEL_INDEX = 'APP_CACHE_VIEW.DEL_INDEX';
- /** the column name for the APP_NUMBER field */
- const APP_NUMBER = 'APP_CACHE_VIEW.APP_NUMBER';
+ /** the column name for the APP_NUMBER field */
+ const APP_NUMBER = 'APP_CACHE_VIEW.APP_NUMBER';
- /** the column name for the APP_STATUS field */
- const APP_STATUS = 'APP_CACHE_VIEW.APP_STATUS';
+ /** the column name for the APP_STATUS field */
+ const APP_STATUS = 'APP_CACHE_VIEW.APP_STATUS';
- /** the column name for the USR_UID field */
- const USR_UID = 'APP_CACHE_VIEW.USR_UID';
+ /** the column name for the USR_UID field */
+ const USR_UID = 'APP_CACHE_VIEW.USR_UID';
- /** the column name for the PREVIOUS_USR_UID field */
- const PREVIOUS_USR_UID = 'APP_CACHE_VIEW.PREVIOUS_USR_UID';
+ /** the column name for the PREVIOUS_USR_UID field */
+ const PREVIOUS_USR_UID = 'APP_CACHE_VIEW.PREVIOUS_USR_UID';
- /** the column name for the TAS_UID field */
- const TAS_UID = 'APP_CACHE_VIEW.TAS_UID';
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'APP_CACHE_VIEW.TAS_UID';
- /** the column name for the PRO_UID field */
- const PRO_UID = 'APP_CACHE_VIEW.PRO_UID';
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'APP_CACHE_VIEW.PRO_UID';
- /** the column name for the DEL_DELEGATE_DATE field */
- const DEL_DELEGATE_DATE = 'APP_CACHE_VIEW.DEL_DELEGATE_DATE';
+ /** the column name for the DEL_DELEGATE_DATE field */
+ const DEL_DELEGATE_DATE = 'APP_CACHE_VIEW.DEL_DELEGATE_DATE';
- /** the column name for the DEL_INIT_DATE field */
- const DEL_INIT_DATE = 'APP_CACHE_VIEW.DEL_INIT_DATE';
+ /** the column name for the DEL_INIT_DATE field */
+ const DEL_INIT_DATE = 'APP_CACHE_VIEW.DEL_INIT_DATE';
- /** the column name for the DEL_TASK_DUE_DATE field */
- const DEL_TASK_DUE_DATE = 'APP_CACHE_VIEW.DEL_TASK_DUE_DATE';
+ /** the column name for the DEL_TASK_DUE_DATE field */
+ const DEL_TASK_DUE_DATE = 'APP_CACHE_VIEW.DEL_TASK_DUE_DATE';
- /** the column name for the DEL_FINISH_DATE field */
- const DEL_FINISH_DATE = 'APP_CACHE_VIEW.DEL_FINISH_DATE';
+ /** the column name for the DEL_FINISH_DATE field */
+ const DEL_FINISH_DATE = 'APP_CACHE_VIEW.DEL_FINISH_DATE';
- /** the column name for the DEL_THREAD_STATUS field */
- const DEL_THREAD_STATUS = 'APP_CACHE_VIEW.DEL_THREAD_STATUS';
+ /** the column name for the DEL_THREAD_STATUS field */
+ const DEL_THREAD_STATUS = 'APP_CACHE_VIEW.DEL_THREAD_STATUS';
- /** the column name for the APP_THREAD_STATUS field */
- const APP_THREAD_STATUS = 'APP_CACHE_VIEW.APP_THREAD_STATUS';
+ /** the column name for the APP_THREAD_STATUS field */
+ const APP_THREAD_STATUS = 'APP_CACHE_VIEW.APP_THREAD_STATUS';
- /** the column name for the APP_TITLE field */
- const APP_TITLE = 'APP_CACHE_VIEW.APP_TITLE';
+ /** the column name for the APP_TITLE field */
+ const APP_TITLE = 'APP_CACHE_VIEW.APP_TITLE';
- /** the column name for the APP_PRO_TITLE field */
- const APP_PRO_TITLE = 'APP_CACHE_VIEW.APP_PRO_TITLE';
+ /** the column name for the APP_PRO_TITLE field */
+ const APP_PRO_TITLE = 'APP_CACHE_VIEW.APP_PRO_TITLE';
+
+ /** the column name for the APP_TAS_TITLE field */
+ const APP_TAS_TITLE = 'APP_CACHE_VIEW.APP_TAS_TITLE';
+
+ /** the column name for the APP_CURRENT_USER field */
+ const APP_CURRENT_USER = 'APP_CACHE_VIEW.APP_CURRENT_USER';
+
+ /** the column name for the APP_DEL_PREVIOUS_USER field */
+ const APP_DEL_PREVIOUS_USER = 'APP_CACHE_VIEW.APP_DEL_PREVIOUS_USER';
+
+ /** the column name for the DEL_PRIORITY field */
+ const DEL_PRIORITY = 'APP_CACHE_VIEW.DEL_PRIORITY';
+
+ /** the column name for the DEL_DURATION field */
+ const DEL_DURATION = 'APP_CACHE_VIEW.DEL_DURATION';
+
+ /** the column name for the DEL_QUEUE_DURATION field */
+ const DEL_QUEUE_DURATION = 'APP_CACHE_VIEW.DEL_QUEUE_DURATION';
+
+ /** the column name for the DEL_DELAY_DURATION field */
+ const DEL_DELAY_DURATION = 'APP_CACHE_VIEW.DEL_DELAY_DURATION';
+
+ /** the column name for the DEL_STARTED field */
+ const DEL_STARTED = 'APP_CACHE_VIEW.DEL_STARTED';
+
+ /** the column name for the DEL_FINISHED field */
+ const DEL_FINISHED = 'APP_CACHE_VIEW.DEL_FINISHED';
+
+ /** the column name for the DEL_DELAYED field */
+ const DEL_DELAYED = 'APP_CACHE_VIEW.DEL_DELAYED';
+
+ /** the column name for the APP_CREATE_DATE field */
+ const APP_CREATE_DATE = 'APP_CACHE_VIEW.APP_CREATE_DATE';
+
+ /** the column name for the APP_FINISH_DATE field */
+ const APP_FINISH_DATE = 'APP_CACHE_VIEW.APP_FINISH_DATE';
+
+ /** the column name for the APP_UPDATE_DATE field */
+ const APP_UPDATE_DATE = 'APP_CACHE_VIEW.APP_UPDATE_DATE';
+
+ /** the column name for the APP_OVERDUE_PERCENTAGE field */
+ const APP_OVERDUE_PERCENTAGE = 'APP_CACHE_VIEW.APP_OVERDUE_PERCENTAGE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'AppNumber', 'AppStatus', 'UsrUid', 'PreviousUsrUid', 'TasUid', 'ProUid', 'DelDelegateDate', 'DelInitDate', 'DelTaskDueDate', 'DelFinishDate', 'DelThreadStatus', 'AppThreadStatus', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCurrentUser', 'AppDelPreviousUser', 'DelPriority', 'DelDuration', 'DelQueueDuration', 'DelDelayDuration', 'DelStarted', 'DelFinished', 'DelDelayed', 'AppCreateDate', 'AppFinishDate', 'AppUpdateDate', 'AppOverduePercentage', ),
+ BasePeer::TYPE_COLNAME => array (AppCacheViewPeer::APP_UID, AppCacheViewPeer::DEL_INDEX, AppCacheViewPeer::APP_NUMBER, AppCacheViewPeer::APP_STATUS, AppCacheViewPeer::USR_UID, AppCacheViewPeer::PREVIOUS_USR_UID, AppCacheViewPeer::TAS_UID, AppCacheViewPeer::PRO_UID, AppCacheViewPeer::DEL_DELEGATE_DATE, AppCacheViewPeer::DEL_INIT_DATE, AppCacheViewPeer::DEL_TASK_DUE_DATE, AppCacheViewPeer::DEL_FINISH_DATE, AppCacheViewPeer::DEL_THREAD_STATUS, AppCacheViewPeer::APP_THREAD_STATUS, AppCacheViewPeer::APP_TITLE, AppCacheViewPeer::APP_PRO_TITLE, AppCacheViewPeer::APP_TAS_TITLE, AppCacheViewPeer::APP_CURRENT_USER, AppCacheViewPeer::APP_DEL_PREVIOUS_USER, AppCacheViewPeer::DEL_PRIORITY, AppCacheViewPeer::DEL_DURATION, AppCacheViewPeer::DEL_QUEUE_DURATION, AppCacheViewPeer::DEL_DELAY_DURATION, AppCacheViewPeer::DEL_STARTED, AppCacheViewPeer::DEL_FINISHED, AppCacheViewPeer::DEL_DELAYED, AppCacheViewPeer::APP_CREATE_DATE, AppCacheViewPeer::APP_FINISH_DATE, AppCacheViewPeer::APP_UPDATE_DATE, AppCacheViewPeer::APP_OVERDUE_PERCENTAGE, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'APP_NUMBER', 'APP_STATUS', 'USR_UID', 'PREVIOUS_USR_UID', 'TAS_UID', 'PRO_UID', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_TASK_DUE_DATE', 'DEL_FINISH_DATE', 'DEL_THREAD_STATUS', 'APP_THREAD_STATUS', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CURRENT_USER', 'APP_DEL_PREVIOUS_USER', 'DEL_PRIORITY', 'DEL_DURATION', 'DEL_QUEUE_DURATION', 'DEL_DELAY_DURATION', 'DEL_STARTED', 'DEL_FINISHED', 'DEL_DELAYED', 'APP_CREATE_DATE', 'APP_FINISH_DATE', 'APP_UPDATE_DATE', 'APP_OVERDUE_PERCENTAGE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'AppNumber' => 2, 'AppStatus' => 3, 'UsrUid' => 4, 'PreviousUsrUid' => 5, 'TasUid' => 6, 'ProUid' => 7, 'DelDelegateDate' => 8, 'DelInitDate' => 9, 'DelTaskDueDate' => 10, 'DelFinishDate' => 11, 'DelThreadStatus' => 12, 'AppThreadStatus' => 13, 'AppTitle' => 14, 'AppProTitle' => 15, 'AppTasTitle' => 16, 'AppCurrentUser' => 17, 'AppDelPreviousUser' => 18, 'DelPriority' => 19, 'DelDuration' => 20, 'DelQueueDuration' => 21, 'DelDelayDuration' => 22, 'DelStarted' => 23, 'DelFinished' => 24, 'DelDelayed' => 25, 'AppCreateDate' => 26, 'AppFinishDate' => 27, 'AppUpdateDate' => 28, 'AppOverduePercentage' => 29, ),
+ BasePeer::TYPE_COLNAME => array (AppCacheViewPeer::APP_UID => 0, AppCacheViewPeer::DEL_INDEX => 1, AppCacheViewPeer::APP_NUMBER => 2, AppCacheViewPeer::APP_STATUS => 3, AppCacheViewPeer::USR_UID => 4, AppCacheViewPeer::PREVIOUS_USR_UID => 5, AppCacheViewPeer::TAS_UID => 6, AppCacheViewPeer::PRO_UID => 7, AppCacheViewPeer::DEL_DELEGATE_DATE => 8, AppCacheViewPeer::DEL_INIT_DATE => 9, AppCacheViewPeer::DEL_TASK_DUE_DATE => 10, AppCacheViewPeer::DEL_FINISH_DATE => 11, AppCacheViewPeer::DEL_THREAD_STATUS => 12, AppCacheViewPeer::APP_THREAD_STATUS => 13, AppCacheViewPeer::APP_TITLE => 14, AppCacheViewPeer::APP_PRO_TITLE => 15, AppCacheViewPeer::APP_TAS_TITLE => 16, AppCacheViewPeer::APP_CURRENT_USER => 17, AppCacheViewPeer::APP_DEL_PREVIOUS_USER => 18, AppCacheViewPeer::DEL_PRIORITY => 19, AppCacheViewPeer::DEL_DURATION => 20, AppCacheViewPeer::DEL_QUEUE_DURATION => 21, AppCacheViewPeer::DEL_DELAY_DURATION => 22, AppCacheViewPeer::DEL_STARTED => 23, AppCacheViewPeer::DEL_FINISHED => 24, AppCacheViewPeer::DEL_DELAYED => 25, AppCacheViewPeer::APP_CREATE_DATE => 26, AppCacheViewPeer::APP_FINISH_DATE => 27, AppCacheViewPeer::APP_UPDATE_DATE => 28, AppCacheViewPeer::APP_OVERDUE_PERCENTAGE => 29, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'APP_NUMBER' => 2, 'APP_STATUS' => 3, 'USR_UID' => 4, 'PREVIOUS_USR_UID' => 5, 'TAS_UID' => 6, 'PRO_UID' => 7, 'DEL_DELEGATE_DATE' => 8, 'DEL_INIT_DATE' => 9, 'DEL_TASK_DUE_DATE' => 10, 'DEL_FINISH_DATE' => 11, 'DEL_THREAD_STATUS' => 12, 'APP_THREAD_STATUS' => 13, 'APP_TITLE' => 14, 'APP_PRO_TITLE' => 15, 'APP_TAS_TITLE' => 16, 'APP_CURRENT_USER' => 17, 'APP_DEL_PREVIOUS_USER' => 18, 'DEL_PRIORITY' => 19, 'DEL_DURATION' => 20, 'DEL_QUEUE_DURATION' => 21, 'DEL_DELAY_DURATION' => 22, 'DEL_STARTED' => 23, 'DEL_FINISHED' => 24, 'DEL_DELAYED' => 25, 'APP_CREATE_DATE' => 26, 'APP_FINISH_DATE' => 27, 'APP_UPDATE_DATE' => 28, 'APP_OVERDUE_PERCENTAGE' => 29, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppCacheViewMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppCacheViewMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppCacheViewPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppCacheViewPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppCacheViewPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_INDEX);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_STATUS);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::USR_UID);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::PREVIOUS_USR_UID);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::TAS_UID);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::PRO_UID);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_DELEGATE_DATE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_INIT_DATE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_TASK_DUE_DATE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_FINISH_DATE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_THREAD_STATUS);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_THREAD_STATUS);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_TITLE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_TAS_TITLE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_CURRENT_USER);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_DEL_PREVIOUS_USER);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_PRIORITY);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_DURATION);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_QUEUE_DURATION);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_DELAY_DURATION);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_STARTED);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_FINISHED);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::DEL_DELAYED);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_CREATE_DATE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_FINISH_DATE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_UPDATE_DATE);
+
+ $criteria->addSelectColumn(AppCacheViewPeer::APP_OVERDUE_PERCENTAGE);
+
+ }
+
+ const COUNT = 'COUNT(APP_CACHE_VIEW.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_CACHE_VIEW.APP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppCacheViewPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppCacheViewPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppCacheViewPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppCacheView
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppCacheViewPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppCacheViewPeer::populateObjects(AppCacheViewPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppCacheViewPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppCacheViewPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppCacheViewPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppCacheView or Criteria object.
+ *
+ * @param mixed $values Criteria or AppCacheView object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppCacheView object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppCacheView or Criteria object.
+ *
+ * @param mixed $values Criteria or AppCacheView object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppCacheViewPeer::APP_UID);
+ $selectCriteria->add(AppCacheViewPeer::APP_UID, $criteria->remove(AppCacheViewPeer::APP_UID), $comparison);
+
+ $comparison = $criteria->getComparison(AppCacheViewPeer::DEL_INDEX);
+ $selectCriteria->add(AppCacheViewPeer::DEL_INDEX, $criteria->remove(AppCacheViewPeer::DEL_INDEX), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_CACHE_VIEW table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppCacheViewPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppCacheView or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppCacheView object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppCacheViewPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppCacheView) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
+
+ $criteria->add(AppCacheViewPeer::APP_UID, $vals[0], Criteria::IN);
+ $criteria->add(AppCacheViewPeer::DEL_INDEX, $vals[1], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppCacheView object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppCacheView $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppCacheView $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppCacheViewPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppCacheViewPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AppCacheViewPeer::DATABASE_NAME, AppCacheViewPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $app_uid
+ * @param int $del_index
+ * @param Connection $con
+ * @return AppCacheView
+ */
+ public static function retrieveByPK($app_uid, $del_index, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(AppCacheViewPeer::APP_UID, $app_uid);
+ $criteria->add(AppCacheViewPeer::DEL_INDEX, $del_index);
+ $v = AppCacheViewPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- /** the column name for the APP_TAS_TITLE field */
- const APP_TAS_TITLE = 'APP_CACHE_VIEW.APP_TAS_TITLE';
-
- /** the column name for the APP_CURRENT_USER field */
- const APP_CURRENT_USER = 'APP_CACHE_VIEW.APP_CURRENT_USER';
-
- /** the column name for the APP_DEL_PREVIOUS_USER field */
- const APP_DEL_PREVIOUS_USER = 'APP_CACHE_VIEW.APP_DEL_PREVIOUS_USER';
-
- /** the column name for the DEL_PRIORITY field */
- const DEL_PRIORITY = 'APP_CACHE_VIEW.DEL_PRIORITY';
-
- /** the column name for the DEL_DURATION field */
- const DEL_DURATION = 'APP_CACHE_VIEW.DEL_DURATION';
-
- /** the column name for the DEL_QUEUE_DURATION field */
- const DEL_QUEUE_DURATION = 'APP_CACHE_VIEW.DEL_QUEUE_DURATION';
-
- /** the column name for the DEL_DELAY_DURATION field */
- const DEL_DELAY_DURATION = 'APP_CACHE_VIEW.DEL_DELAY_DURATION';
-
- /** the column name for the DEL_STARTED field */
- const DEL_STARTED = 'APP_CACHE_VIEW.DEL_STARTED';
-
- /** the column name for the DEL_FINISHED field */
- const DEL_FINISHED = 'APP_CACHE_VIEW.DEL_FINISHED';
-
- /** the column name for the DEL_DELAYED field */
- const DEL_DELAYED = 'APP_CACHE_VIEW.DEL_DELAYED';
-
- /** the column name for the APP_CREATE_DATE field */
- const APP_CREATE_DATE = 'APP_CACHE_VIEW.APP_CREATE_DATE';
-
- /** the column name for the APP_FINISH_DATE field */
- const APP_FINISH_DATE = 'APP_CACHE_VIEW.APP_FINISH_DATE';
-
- /** the column name for the APP_UPDATE_DATE field */
- const APP_UPDATE_DATE = 'APP_CACHE_VIEW.APP_UPDATE_DATE';
-
- /** the column name for the APP_OVERDUE_PERCENTAGE field */
- const APP_OVERDUE_PERCENTAGE = 'APP_CACHE_VIEW.APP_OVERDUE_PERCENTAGE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'AppNumber', 'AppStatus', 'UsrUid', 'PreviousUsrUid', 'TasUid', 'ProUid', 'DelDelegateDate', 'DelInitDate', 'DelTaskDueDate', 'DelFinishDate', 'DelThreadStatus', 'AppThreadStatus', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCurrentUser', 'AppDelPreviousUser', 'DelPriority', 'DelDuration', 'DelQueueDuration', 'DelDelayDuration', 'DelStarted', 'DelFinished', 'DelDelayed', 'AppCreateDate', 'AppFinishDate', 'AppUpdateDate', 'AppOverduePercentage', ),
- BasePeer::TYPE_COLNAME => array (AppCacheViewPeer::APP_UID, AppCacheViewPeer::DEL_INDEX, AppCacheViewPeer::APP_NUMBER, AppCacheViewPeer::APP_STATUS, AppCacheViewPeer::USR_UID, AppCacheViewPeer::PREVIOUS_USR_UID, AppCacheViewPeer::TAS_UID, AppCacheViewPeer::PRO_UID, AppCacheViewPeer::DEL_DELEGATE_DATE, AppCacheViewPeer::DEL_INIT_DATE, AppCacheViewPeer::DEL_TASK_DUE_DATE, AppCacheViewPeer::DEL_FINISH_DATE, AppCacheViewPeer::DEL_THREAD_STATUS, AppCacheViewPeer::APP_THREAD_STATUS, AppCacheViewPeer::APP_TITLE, AppCacheViewPeer::APP_PRO_TITLE, AppCacheViewPeer::APP_TAS_TITLE, AppCacheViewPeer::APP_CURRENT_USER, AppCacheViewPeer::APP_DEL_PREVIOUS_USER, AppCacheViewPeer::DEL_PRIORITY, AppCacheViewPeer::DEL_DURATION, AppCacheViewPeer::DEL_QUEUE_DURATION, AppCacheViewPeer::DEL_DELAY_DURATION, AppCacheViewPeer::DEL_STARTED, AppCacheViewPeer::DEL_FINISHED, AppCacheViewPeer::DEL_DELAYED, AppCacheViewPeer::APP_CREATE_DATE, AppCacheViewPeer::APP_FINISH_DATE, AppCacheViewPeer::APP_UPDATE_DATE, AppCacheViewPeer::APP_OVERDUE_PERCENTAGE, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'APP_NUMBER', 'APP_STATUS', 'USR_UID', 'PREVIOUS_USR_UID', 'TAS_UID', 'PRO_UID', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_TASK_DUE_DATE', 'DEL_FINISH_DATE', 'DEL_THREAD_STATUS', 'APP_THREAD_STATUS', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CURRENT_USER', 'APP_DEL_PREVIOUS_USER', 'DEL_PRIORITY', 'DEL_DURATION', 'DEL_QUEUE_DURATION', 'DEL_DELAY_DURATION', 'DEL_STARTED', 'DEL_FINISHED', 'DEL_DELAYED', 'APP_CREATE_DATE', 'APP_FINISH_DATE', 'APP_UPDATE_DATE', 'APP_OVERDUE_PERCENTAGE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'AppNumber' => 2, 'AppStatus' => 3, 'UsrUid' => 4, 'PreviousUsrUid' => 5, 'TasUid' => 6, 'ProUid' => 7, 'DelDelegateDate' => 8, 'DelInitDate' => 9, 'DelTaskDueDate' => 10, 'DelFinishDate' => 11, 'DelThreadStatus' => 12, 'AppThreadStatus' => 13, 'AppTitle' => 14, 'AppProTitle' => 15, 'AppTasTitle' => 16, 'AppCurrentUser' => 17, 'AppDelPreviousUser' => 18, 'DelPriority' => 19, 'DelDuration' => 20, 'DelQueueDuration' => 21, 'DelDelayDuration' => 22, 'DelStarted' => 23, 'DelFinished' => 24, 'DelDelayed' => 25, 'AppCreateDate' => 26, 'AppFinishDate' => 27, 'AppUpdateDate' => 28, 'AppOverduePercentage' => 29, ),
- BasePeer::TYPE_COLNAME => array (AppCacheViewPeer::APP_UID => 0, AppCacheViewPeer::DEL_INDEX => 1, AppCacheViewPeer::APP_NUMBER => 2, AppCacheViewPeer::APP_STATUS => 3, AppCacheViewPeer::USR_UID => 4, AppCacheViewPeer::PREVIOUS_USR_UID => 5, AppCacheViewPeer::TAS_UID => 6, AppCacheViewPeer::PRO_UID => 7, AppCacheViewPeer::DEL_DELEGATE_DATE => 8, AppCacheViewPeer::DEL_INIT_DATE => 9, AppCacheViewPeer::DEL_TASK_DUE_DATE => 10, AppCacheViewPeer::DEL_FINISH_DATE => 11, AppCacheViewPeer::DEL_THREAD_STATUS => 12, AppCacheViewPeer::APP_THREAD_STATUS => 13, AppCacheViewPeer::APP_TITLE => 14, AppCacheViewPeer::APP_PRO_TITLE => 15, AppCacheViewPeer::APP_TAS_TITLE => 16, AppCacheViewPeer::APP_CURRENT_USER => 17, AppCacheViewPeer::APP_DEL_PREVIOUS_USER => 18, AppCacheViewPeer::DEL_PRIORITY => 19, AppCacheViewPeer::DEL_DURATION => 20, AppCacheViewPeer::DEL_QUEUE_DURATION => 21, AppCacheViewPeer::DEL_DELAY_DURATION => 22, AppCacheViewPeer::DEL_STARTED => 23, AppCacheViewPeer::DEL_FINISHED => 24, AppCacheViewPeer::DEL_DELAYED => 25, AppCacheViewPeer::APP_CREATE_DATE => 26, AppCacheViewPeer::APP_FINISH_DATE => 27, AppCacheViewPeer::APP_UPDATE_DATE => 28, AppCacheViewPeer::APP_OVERDUE_PERCENTAGE => 29, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'APP_NUMBER' => 2, 'APP_STATUS' => 3, 'USR_UID' => 4, 'PREVIOUS_USR_UID' => 5, 'TAS_UID' => 6, 'PRO_UID' => 7, 'DEL_DELEGATE_DATE' => 8, 'DEL_INIT_DATE' => 9, 'DEL_TASK_DUE_DATE' => 10, 'DEL_FINISH_DATE' => 11, 'DEL_THREAD_STATUS' => 12, 'APP_THREAD_STATUS' => 13, 'APP_TITLE' => 14, 'APP_PRO_TITLE' => 15, 'APP_TAS_TITLE' => 16, 'APP_CURRENT_USER' => 17, 'APP_DEL_PREVIOUS_USER' => 18, 'DEL_PRIORITY' => 19, 'DEL_DURATION' => 20, 'DEL_QUEUE_DURATION' => 21, 'DEL_DELAY_DURATION' => 22, 'DEL_STARTED' => 23, 'DEL_FINISHED' => 24, 'DEL_DELAYED' => 25, 'APP_CREATE_DATE' => 26, 'APP_FINISH_DATE' => 27, 'APP_UPDATE_DATE' => 28, 'APP_OVERDUE_PERCENTAGE' => 29, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppCacheViewMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppCacheViewMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppCacheViewPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppCacheViewPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppCacheViewPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_UID);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_INDEX);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_STATUS);
-
- $criteria->addSelectColumn(AppCacheViewPeer::USR_UID);
-
- $criteria->addSelectColumn(AppCacheViewPeer::PREVIOUS_USR_UID);
-
- $criteria->addSelectColumn(AppCacheViewPeer::TAS_UID);
-
- $criteria->addSelectColumn(AppCacheViewPeer::PRO_UID);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_DELEGATE_DATE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_INIT_DATE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_TASK_DUE_DATE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_FINISH_DATE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_THREAD_STATUS);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_THREAD_STATUS);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_TITLE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_TAS_TITLE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_CURRENT_USER);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_DEL_PREVIOUS_USER);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_PRIORITY);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_DURATION);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_QUEUE_DURATION);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_DELAY_DURATION);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_STARTED);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_FINISHED);
-
- $criteria->addSelectColumn(AppCacheViewPeer::DEL_DELAYED);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_CREATE_DATE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_FINISH_DATE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_UPDATE_DATE);
-
- $criteria->addSelectColumn(AppCacheViewPeer::APP_OVERDUE_PERCENTAGE);
-
- }
-
- const COUNT = 'COUNT(APP_CACHE_VIEW.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_CACHE_VIEW.APP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppCacheViewPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppCacheViewPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppCacheViewPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppCacheView
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppCacheViewPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppCacheViewPeer::populateObjects(AppCacheViewPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppCacheViewPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppCacheViewPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppCacheViewPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppCacheView or Criteria object.
- *
- * @param mixed $values Criteria or AppCacheView object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppCacheView object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppCacheView or Criteria object.
- *
- * @param mixed $values Criteria or AppCacheView object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppCacheViewPeer::APP_UID);
- $selectCriteria->add(AppCacheViewPeer::APP_UID, $criteria->remove(AppCacheViewPeer::APP_UID), $comparison);
-
- $comparison = $criteria->getComparison(AppCacheViewPeer::DEL_INDEX);
- $selectCriteria->add(AppCacheViewPeer::DEL_INDEX, $criteria->remove(AppCacheViewPeer::DEL_INDEX), $comparison);
-
- } else { // $values is AppCacheView object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_CACHE_VIEW table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppCacheViewPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppCacheView or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppCacheView object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppCacheViewPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppCacheView) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
-
- $criteria->add(AppCacheViewPeer::APP_UID, $vals[0], Criteria::IN);
- $criteria->add(AppCacheViewPeer::DEL_INDEX, $vals[1], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppCacheView object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppCacheView $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppCacheView $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppCacheViewPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppCacheViewPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AppCacheViewPeer::DATABASE_NAME, AppCacheViewPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $app_uid
- @param int $del_index
-
- * @param Connection $con
- * @return AppCacheView
- */
- public static function retrieveByPK( $app_uid, $del_index, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(AppCacheViewPeer::APP_UID, $app_uid);
- $criteria->add(AppCacheViewPeer::DEL_INDEX, $del_index);
- $v = AppCacheViewPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseAppCacheViewPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppCacheViewPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppCacheViewPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppCacheViewMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppCacheViewMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppCacheViewMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppCacheViewMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppDelay.php b/workflow/engine/classes/model/om/BaseAppDelay.php
index 7a703d7c4..f183a7fdc 100755
--- a/workflow/engine/classes/model/om/BaseAppDelay.php
+++ b/workflow/engine/classes/model/om/BaseAppDelay.php
@@ -16,1244 +16,1321 @@ include_once 'classes/model/AppDelayPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppDelay extends BaseObject implements Persistent {
+abstract class BaseAppDelay extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppDelayPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_delay_uid field.
+ * @var string
+ */
+ protected $app_delay_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '0';
+
+ /**
+ * The value for the app_thread_index field.
+ * @var int
+ */
+ protected $app_thread_index = 0;
+
+ /**
+ * The value for the app_del_index field.
+ * @var int
+ */
+ protected $app_del_index = 0;
+
+ /**
+ * The value for the app_type field.
+ * @var string
+ */
+ protected $app_type = '0';
+
+ /**
+ * The value for the app_status field.
+ * @var string
+ */
+ protected $app_status = '0';
+
+ /**
+ * The value for the app_next_task field.
+ * @var string
+ */
+ protected $app_next_task = '0';
+
+ /**
+ * The value for the app_delegation_user field.
+ * @var string
+ */
+ protected $app_delegation_user = '0';
+
+ /**
+ * The value for the app_enable_action_user field.
+ * @var string
+ */
+ protected $app_enable_action_user = '0';
+
+ /**
+ * The value for the app_enable_action_date field.
+ * @var int
+ */
+ protected $app_enable_action_date;
+
+ /**
+ * The value for the app_disable_action_user field.
+ * @var string
+ */
+ protected $app_disable_action_user = '0';
+
+ /**
+ * The value for the app_disable_action_date field.
+ * @var int
+ */
+ protected $app_disable_action_date;
+
+ /**
+ * The value for the app_automatic_disabled_date field.
+ * @var int
+ */
+ protected $app_automatic_disabled_date;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_delay_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppDelayUid()
+ {
+
+ return $this->app_delay_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [app_thread_index] column value.
+ *
+ * @return int
+ */
+ public function getAppThreadIndex()
+ {
+
+ return $this->app_thread_index;
+ }
+
+ /**
+ * Get the [app_del_index] column value.
+ *
+ * @return int
+ */
+ public function getAppDelIndex()
+ {
+
+ return $this->app_del_index;
+ }
+
+ /**
+ * Get the [app_type] column value.
+ *
+ * @return string
+ */
+ public function getAppType()
+ {
+
+ return $this->app_type;
+ }
+
+ /**
+ * Get the [app_status] column value.
+ *
+ * @return string
+ */
+ public function getAppStatus()
+ {
+
+ return $this->app_status;
+ }
+
+ /**
+ * Get the [app_next_task] column value.
+ *
+ * @return string
+ */
+ public function getAppNextTask()
+ {
+
+ return $this->app_next_task;
+ }
+
+ /**
+ * Get the [app_delegation_user] column value.
+ *
+ * @return string
+ */
+ public function getAppDelegationUser()
+ {
+
+ return $this->app_delegation_user;
+ }
+
+ /**
+ * Get the [app_enable_action_user] column value.
+ *
+ * @return string
+ */
+ public function getAppEnableActionUser()
+ {
+
+ return $this->app_enable_action_user;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_enable_action_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppEnableActionDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_enable_action_date === null || $this->app_enable_action_date === '') {
+ return null;
+ } elseif (!is_int($this->app_enable_action_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_enable_action_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_enable_action_date] as date/time value: " .
+ var_export($this->app_enable_action_date, true));
+ }
+ } else {
+ $ts = $this->app_enable_action_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_disable_action_user] column value.
+ *
+ * @return string
+ */
+ public function getAppDisableActionUser()
+ {
+
+ return $this->app_disable_action_user;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_disable_action_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppDisableActionDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_disable_action_date === null || $this->app_disable_action_date === '') {
+ return null;
+ } elseif (!is_int($this->app_disable_action_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_disable_action_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_disable_action_date] as date/time value: " .
+ var_export($this->app_disable_action_date, true));
+ }
+ } else {
+ $ts = $this->app_disable_action_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [app_automatic_disabled_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppAutomaticDisabledDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_automatic_disabled_date === null || $this->app_automatic_disabled_date === '') {
+ return null;
+ } elseif (!is_int($this->app_automatic_disabled_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_automatic_disabled_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_automatic_disabled_date] as date/time value: " .
+ var_export($this->app_automatic_disabled_date, true));
+ }
+ } else {
+ $ts = $this->app_automatic_disabled_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Set the value of [app_delay_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDelayUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_delay_uid !== $v || $v === '') {
+ $this->app_delay_uid = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_DELAY_UID;
+ }
+
+ } // setAppDelayUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = AppDelayPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '0') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [app_thread_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppThreadIndex($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->app_thread_index !== $v || $v === 0) {
+ $this->app_thread_index = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_THREAD_INDEX;
+ }
+
+ } // setAppThreadIndex()
+
+ /**
+ * Set the value of [app_del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppDelIndex($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->app_del_index !== $v || $v === 0) {
+ $this->app_del_index = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_DEL_INDEX;
+ }
+
+ } // setAppDelIndex()
+
+ /**
+ * Set the value of [app_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_type !== $v || $v === '0') {
+ $this->app_type = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_TYPE;
+ }
+
+ } // setAppType()
+
+ /**
+ * Set the value of [app_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_status !== $v || $v === '0') {
+ $this->app_status = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_STATUS;
+ }
+
+ } // setAppStatus()
+
+ /**
+ * Set the value of [app_next_task] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppNextTask($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_next_task !== $v || $v === '0') {
+ $this->app_next_task = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_NEXT_TASK;
+ }
+
+ } // setAppNextTask()
+
+ /**
+ * Set the value of [app_delegation_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDelegationUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_delegation_user !== $v || $v === '0') {
+ $this->app_delegation_user = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_DELEGATION_USER;
+ }
+
+ } // setAppDelegationUser()
+
+ /**
+ * Set the value of [app_enable_action_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppEnableActionUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_enable_action_user !== $v || $v === '0') {
+ $this->app_enable_action_user = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_ENABLE_ACTION_USER;
+ }
+
+ } // setAppEnableActionUser()
+
+ /**
+ * Set the value of [app_enable_action_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppEnableActionDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_enable_action_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_enable_action_date !== $ts) {
+ $this->app_enable_action_date = $ts;
+ $this->modifiedColumns[] = AppDelayPeer::APP_ENABLE_ACTION_DATE;
+ }
+
+ } // setAppEnableActionDate()
+
+ /**
+ * Set the value of [app_disable_action_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDisableActionUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_disable_action_user !== $v || $v === '0') {
+ $this->app_disable_action_user = $v;
+ $this->modifiedColumns[] = AppDelayPeer::APP_DISABLE_ACTION_USER;
+ }
+
+ } // setAppDisableActionUser()
+
+ /**
+ * Set the value of [app_disable_action_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppDisableActionDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_disable_action_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_disable_action_date !== $ts) {
+ $this->app_disable_action_date = $ts;
+ $this->modifiedColumns[] = AppDelayPeer::APP_DISABLE_ACTION_DATE;
+ }
+
+ } // setAppDisableActionDate()
+
+ /**
+ * Set the value of [app_automatic_disabled_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppAutomaticDisabledDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_automatic_disabled_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_automatic_disabled_date !== $ts) {
+ $this->app_automatic_disabled_date = $ts;
+ $this->modifiedColumns[] = AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE;
+ }
+
+ } // setAppAutomaticDisabledDate()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_delay_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->app_uid = $rs->getString($startcol + 2);
+
+ $this->app_thread_index = $rs->getInt($startcol + 3);
+
+ $this->app_del_index = $rs->getInt($startcol + 4);
+
+ $this->app_type = $rs->getString($startcol + 5);
+
+ $this->app_status = $rs->getString($startcol + 6);
+
+ $this->app_next_task = $rs->getString($startcol + 7);
+
+ $this->app_delegation_user = $rs->getString($startcol + 8);
+
+ $this->app_enable_action_user = $rs->getString($startcol + 9);
+
+ $this->app_enable_action_date = $rs->getTimestamp($startcol + 10, null);
+
+ $this->app_disable_action_user = $rs->getString($startcol + 11);
+
+ $this->app_disable_action_date = $rs->getTimestamp($startcol + 12, null);
+
+ $this->app_automatic_disabled_date = $rs->getTimestamp($startcol + 13, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 14; // 14 = AppDelayPeer::NUM_COLUMNS - AppDelayPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppDelay object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppDelayPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppDelayPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppDelayPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppDelayPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppDelayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppDelayUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getAppUid();
+ break;
+ case 3:
+ return $this->getAppThreadIndex();
+ break;
+ case 4:
+ return $this->getAppDelIndex();
+ break;
+ case 5:
+ return $this->getAppType();
+ break;
+ case 6:
+ return $this->getAppStatus();
+ break;
+ case 7:
+ return $this->getAppNextTask();
+ break;
+ case 8:
+ return $this->getAppDelegationUser();
+ break;
+ case 9:
+ return $this->getAppEnableActionUser();
+ break;
+ case 10:
+ return $this->getAppEnableActionDate();
+ break;
+ case 11:
+ return $this->getAppDisableActionUser();
+ break;
+ case 12:
+ return $this->getAppDisableActionDate();
+ break;
+ case 13:
+ return $this->getAppAutomaticDisabledDate();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppDelayPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppDelayUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getAppUid(),
+ $keys[3] => $this->getAppThreadIndex(),
+ $keys[4] => $this->getAppDelIndex(),
+ $keys[5] => $this->getAppType(),
+ $keys[6] => $this->getAppStatus(),
+ $keys[7] => $this->getAppNextTask(),
+ $keys[8] => $this->getAppDelegationUser(),
+ $keys[9] => $this->getAppEnableActionUser(),
+ $keys[10] => $this->getAppEnableActionDate(),
+ $keys[11] => $this->getAppDisableActionUser(),
+ $keys[12] => $this->getAppDisableActionDate(),
+ $keys[13] => $this->getAppAutomaticDisabledDate(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppDelayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppDelayUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setAppUid($value);
+ break;
+ case 3:
+ $this->setAppThreadIndex($value);
+ break;
+ case 4:
+ $this->setAppDelIndex($value);
+ break;
+ case 5:
+ $this->setAppType($value);
+ break;
+ case 6:
+ $this->setAppStatus($value);
+ break;
+ case 7:
+ $this->setAppNextTask($value);
+ break;
+ case 8:
+ $this->setAppDelegationUser($value);
+ break;
+ case 9:
+ $this->setAppEnableActionUser($value);
+ break;
+ case 10:
+ $this->setAppEnableActionDate($value);
+ break;
+ case 11:
+ $this->setAppDisableActionUser($value);
+ break;
+ case 12:
+ $this->setAppDisableActionDate($value);
+ break;
+ case 13:
+ $this->setAppAutomaticDisabledDate($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppDelayPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppDelayUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setAppUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setAppThreadIndex($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setAppDelIndex($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setAppType($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setAppStatus($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setAppNextTask($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setAppDelegationUser($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setAppEnableActionUser($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setAppEnableActionDate($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setAppDisableActionUser($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setAppDisableActionDate($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setAppAutomaticDisabledDate($arr[$keys[13]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppDelayPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppDelayPeer::APP_DELAY_UID)) {
+ $criteria->add(AppDelayPeer::APP_DELAY_UID, $this->app_delay_uid);
+ }
+
+ if ($this->isColumnModified(AppDelayPeer::PRO_UID)) {
+ $criteria->add(AppDelayPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(AppDelayPeer::APP_UID)) {
+ $criteria->add(AppDelayPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppDelayPeer::APP_THREAD_INDEX)) {
+ $criteria->add(AppDelayPeer::APP_THREAD_INDEX, $this->app_thread_index);
+ }
+
+ if ($this->isColumnModified(AppDelayPeer::APP_DEL_INDEX)) {
+ $criteria->add(AppDelayPeer::APP_DEL_INDEX, $this->app_del_index);
+ }
+
+ if ($this->isColumnModified(AppDelayPeer::APP_TYPE)) {
+ $criteria->add(AppDelayPeer::APP_TYPE, $this->app_type);
+ }
+
+ if ($this->isColumnModified(AppDelayPeer::APP_STATUS)) {
+ $criteria->add(AppDelayPeer::APP_STATUS, $this->app_status);
+ }
+
+ if ($this->isColumnModified(AppDelayPeer::APP_NEXT_TASK)) {
+ $criteria->add(AppDelayPeer::APP_NEXT_TASK, $this->app_next_task);
+ }
+ if ($this->isColumnModified(AppDelayPeer::APP_DELEGATION_USER)) {
+ $criteria->add(AppDelayPeer::APP_DELEGATION_USER, $this->app_delegation_user);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppDelayPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(AppDelayPeer::APP_ENABLE_ACTION_USER)) {
+ $criteria->add(AppDelayPeer::APP_ENABLE_ACTION_USER, $this->app_enable_action_user);
+ }
+ if ($this->isColumnModified(AppDelayPeer::APP_ENABLE_ACTION_DATE)) {
+ $criteria->add(AppDelayPeer::APP_ENABLE_ACTION_DATE, $this->app_enable_action_date);
+ }
- /**
- * The value for the app_delay_uid field.
- * @var string
- */
- protected $app_delay_uid = '';
+ if ($this->isColumnModified(AppDelayPeer::APP_DISABLE_ACTION_USER)) {
+ $criteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, $this->app_disable_action_user);
+ }
+ if ($this->isColumnModified(AppDelayPeer::APP_DISABLE_ACTION_DATE)) {
+ $criteria->add(AppDelayPeer::APP_DISABLE_ACTION_DATE, $this->app_disable_action_date);
+ }
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
+ if ($this->isColumnModified(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE)) {
+ $criteria->add(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, $this->app_automatic_disabled_date);
+ }
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '0';
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppDelayPeer::DATABASE_NAME);
+
+ $criteria->add(AppDelayPeer::APP_DELAY_UID, $this->app_delay_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getAppDelayUid();
+ }
+
+ /**
+ * Generic method to set the primary key (app_delay_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setAppDelayUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppDelay (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setAppUid($this->app_uid);
+
+ $copyObj->setAppThreadIndex($this->app_thread_index);
+
+ $copyObj->setAppDelIndex($this->app_del_index);
+
+ $copyObj->setAppType($this->app_type);
+
+ $copyObj->setAppStatus($this->app_status);
+
+ $copyObj->setAppNextTask($this->app_next_task);
+
+ $copyObj->setAppDelegationUser($this->app_delegation_user);
+
+ $copyObj->setAppEnableActionUser($this->app_enable_action_user);
+
+ $copyObj->setAppEnableActionDate($this->app_enable_action_date);
+
+ $copyObj->setAppDisableActionUser($this->app_disable_action_user);
+
+ $copyObj->setAppDisableActionDate($this->app_disable_action_date);
+
+ $copyObj->setAppAutomaticDisabledDate($this->app_automatic_disabled_date);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppDelayUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppDelay Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppDelayPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppDelayPeer();
+ }
+ return self::$peer;
+ }
+}
-
- /**
- * The value for the app_thread_index field.
- * @var int
- */
- protected $app_thread_index = 0;
-
-
- /**
- * The value for the app_del_index field.
- * @var int
- */
- protected $app_del_index = 0;
-
-
- /**
- * The value for the app_type field.
- * @var string
- */
- protected $app_type = '0';
-
-
- /**
- * The value for the app_status field.
- * @var string
- */
- protected $app_status = '0';
-
-
- /**
- * The value for the app_next_task field.
- * @var string
- */
- protected $app_next_task = '0';
-
-
- /**
- * The value for the app_delegation_user field.
- * @var string
- */
- protected $app_delegation_user = '0';
-
-
- /**
- * The value for the app_enable_action_user field.
- * @var string
- */
- protected $app_enable_action_user = '0';
-
-
- /**
- * The value for the app_enable_action_date field.
- * @var int
- */
- protected $app_enable_action_date;
-
-
- /**
- * The value for the app_disable_action_user field.
- * @var string
- */
- protected $app_disable_action_user = '0';
-
-
- /**
- * The value for the app_disable_action_date field.
- * @var int
- */
- protected $app_disable_action_date;
-
-
- /**
- * The value for the app_automatic_disabled_date field.
- * @var int
- */
- protected $app_automatic_disabled_date;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_delay_uid] column value.
- *
- * @return string
- */
- public function getAppDelayUid()
- {
-
- return $this->app_delay_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [app_thread_index] column value.
- *
- * @return int
- */
- public function getAppThreadIndex()
- {
-
- return $this->app_thread_index;
- }
-
- /**
- * Get the [app_del_index] column value.
- *
- * @return int
- */
- public function getAppDelIndex()
- {
-
- return $this->app_del_index;
- }
-
- /**
- * Get the [app_type] column value.
- *
- * @return string
- */
- public function getAppType()
- {
-
- return $this->app_type;
- }
-
- /**
- * Get the [app_status] column value.
- *
- * @return string
- */
- public function getAppStatus()
- {
-
- return $this->app_status;
- }
-
- /**
- * Get the [app_next_task] column value.
- *
- * @return string
- */
- public function getAppNextTask()
- {
-
- return $this->app_next_task;
- }
-
- /**
- * Get the [app_delegation_user] column value.
- *
- * @return string
- */
- public function getAppDelegationUser()
- {
-
- return $this->app_delegation_user;
- }
-
- /**
- * Get the [app_enable_action_user] column value.
- *
- * @return string
- */
- public function getAppEnableActionUser()
- {
-
- return $this->app_enable_action_user;
- }
-
- /**
- * Get the [optionally formatted] [app_enable_action_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppEnableActionDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_enable_action_date === null || $this->app_enable_action_date === '') {
- return null;
- } elseif (!is_int($this->app_enable_action_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_enable_action_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_enable_action_date] as date/time value: " . var_export($this->app_enable_action_date, true));
- }
- } else {
- $ts = $this->app_enable_action_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [app_disable_action_user] column value.
- *
- * @return string
- */
- public function getAppDisableActionUser()
- {
-
- return $this->app_disable_action_user;
- }
-
- /**
- * Get the [optionally formatted] [app_disable_action_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppDisableActionDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_disable_action_date === null || $this->app_disable_action_date === '') {
- return null;
- } elseif (!is_int($this->app_disable_action_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_disable_action_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_disable_action_date] as date/time value: " . var_export($this->app_disable_action_date, true));
- }
- } else {
- $ts = $this->app_disable_action_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [app_automatic_disabled_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppAutomaticDisabledDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_automatic_disabled_date === null || $this->app_automatic_disabled_date === '') {
- return null;
- } elseif (!is_int($this->app_automatic_disabled_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_automatic_disabled_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_automatic_disabled_date] as date/time value: " . var_export($this->app_automatic_disabled_date, true));
- }
- } else {
- $ts = $this->app_automatic_disabled_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [app_delay_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDelayUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_delay_uid !== $v || $v === '') {
- $this->app_delay_uid = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_DELAY_UID;
- }
-
- } // setAppDelayUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = AppDelayPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '0') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [app_thread_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppThreadIndex($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->app_thread_index !== $v || $v === 0) {
- $this->app_thread_index = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_THREAD_INDEX;
- }
-
- } // setAppThreadIndex()
-
- /**
- * Set the value of [app_del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppDelIndex($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->app_del_index !== $v || $v === 0) {
- $this->app_del_index = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_DEL_INDEX;
- }
-
- } // setAppDelIndex()
-
- /**
- * Set the value of [app_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_type !== $v || $v === '0') {
- $this->app_type = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_TYPE;
- }
-
- } // setAppType()
-
- /**
- * Set the value of [app_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_status !== $v || $v === '0') {
- $this->app_status = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_STATUS;
- }
-
- } // setAppStatus()
-
- /**
- * Set the value of [app_next_task] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppNextTask($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_next_task !== $v || $v === '0') {
- $this->app_next_task = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_NEXT_TASK;
- }
-
- } // setAppNextTask()
-
- /**
- * Set the value of [app_delegation_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDelegationUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_delegation_user !== $v || $v === '0') {
- $this->app_delegation_user = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_DELEGATION_USER;
- }
-
- } // setAppDelegationUser()
-
- /**
- * Set the value of [app_enable_action_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppEnableActionUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_enable_action_user !== $v || $v === '0') {
- $this->app_enable_action_user = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_ENABLE_ACTION_USER;
- }
-
- } // setAppEnableActionUser()
-
- /**
- * Set the value of [app_enable_action_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppEnableActionDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_enable_action_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_enable_action_date !== $ts) {
- $this->app_enable_action_date = $ts;
- $this->modifiedColumns[] = AppDelayPeer::APP_ENABLE_ACTION_DATE;
- }
-
- } // setAppEnableActionDate()
-
- /**
- * Set the value of [app_disable_action_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDisableActionUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_disable_action_user !== $v || $v === '0') {
- $this->app_disable_action_user = $v;
- $this->modifiedColumns[] = AppDelayPeer::APP_DISABLE_ACTION_USER;
- }
-
- } // setAppDisableActionUser()
-
- /**
- * Set the value of [app_disable_action_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppDisableActionDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_disable_action_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_disable_action_date !== $ts) {
- $this->app_disable_action_date = $ts;
- $this->modifiedColumns[] = AppDelayPeer::APP_DISABLE_ACTION_DATE;
- }
-
- } // setAppDisableActionDate()
-
- /**
- * Set the value of [app_automatic_disabled_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppAutomaticDisabledDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_automatic_disabled_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_automatic_disabled_date !== $ts) {
- $this->app_automatic_disabled_date = $ts;
- $this->modifiedColumns[] = AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE;
- }
-
- } // setAppAutomaticDisabledDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_delay_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->app_uid = $rs->getString($startcol + 2);
-
- $this->app_thread_index = $rs->getInt($startcol + 3);
-
- $this->app_del_index = $rs->getInt($startcol + 4);
-
- $this->app_type = $rs->getString($startcol + 5);
-
- $this->app_status = $rs->getString($startcol + 6);
-
- $this->app_next_task = $rs->getString($startcol + 7);
-
- $this->app_delegation_user = $rs->getString($startcol + 8);
-
- $this->app_enable_action_user = $rs->getString($startcol + 9);
-
- $this->app_enable_action_date = $rs->getTimestamp($startcol + 10, null);
-
- $this->app_disable_action_user = $rs->getString($startcol + 11);
-
- $this->app_disable_action_date = $rs->getTimestamp($startcol + 12, null);
-
- $this->app_automatic_disabled_date = $rs->getTimestamp($startcol + 13, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 14; // 14 = AppDelayPeer::NUM_COLUMNS - AppDelayPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppDelay object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppDelayPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppDelayPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppDelayPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppDelayPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppDelayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppDelayUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getAppUid();
- break;
- case 3:
- return $this->getAppThreadIndex();
- break;
- case 4:
- return $this->getAppDelIndex();
- break;
- case 5:
- return $this->getAppType();
- break;
- case 6:
- return $this->getAppStatus();
- break;
- case 7:
- return $this->getAppNextTask();
- break;
- case 8:
- return $this->getAppDelegationUser();
- break;
- case 9:
- return $this->getAppEnableActionUser();
- break;
- case 10:
- return $this->getAppEnableActionDate();
- break;
- case 11:
- return $this->getAppDisableActionUser();
- break;
- case 12:
- return $this->getAppDisableActionDate();
- break;
- case 13:
- return $this->getAppAutomaticDisabledDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppDelayPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppDelayUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getAppUid(),
- $keys[3] => $this->getAppThreadIndex(),
- $keys[4] => $this->getAppDelIndex(),
- $keys[5] => $this->getAppType(),
- $keys[6] => $this->getAppStatus(),
- $keys[7] => $this->getAppNextTask(),
- $keys[8] => $this->getAppDelegationUser(),
- $keys[9] => $this->getAppEnableActionUser(),
- $keys[10] => $this->getAppEnableActionDate(),
- $keys[11] => $this->getAppDisableActionUser(),
- $keys[12] => $this->getAppDisableActionDate(),
- $keys[13] => $this->getAppAutomaticDisabledDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppDelayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppDelayUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setAppUid($value);
- break;
- case 3:
- $this->setAppThreadIndex($value);
- break;
- case 4:
- $this->setAppDelIndex($value);
- break;
- case 5:
- $this->setAppType($value);
- break;
- case 6:
- $this->setAppStatus($value);
- break;
- case 7:
- $this->setAppNextTask($value);
- break;
- case 8:
- $this->setAppDelegationUser($value);
- break;
- case 9:
- $this->setAppEnableActionUser($value);
- break;
- case 10:
- $this->setAppEnableActionDate($value);
- break;
- case 11:
- $this->setAppDisableActionUser($value);
- break;
- case 12:
- $this->setAppDisableActionDate($value);
- break;
- case 13:
- $this->setAppAutomaticDisabledDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppDelayPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppDelayUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAppUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setAppThreadIndex($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setAppDelIndex($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setAppType($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setAppStatus($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setAppNextTask($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setAppDelegationUser($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setAppEnableActionUser($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setAppEnableActionDate($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setAppDisableActionUser($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setAppDisableActionDate($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setAppAutomaticDisabledDate($arr[$keys[13]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppDelayPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppDelayPeer::APP_DELAY_UID)) $criteria->add(AppDelayPeer::APP_DELAY_UID, $this->app_delay_uid);
- if ($this->isColumnModified(AppDelayPeer::PRO_UID)) $criteria->add(AppDelayPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(AppDelayPeer::APP_UID)) $criteria->add(AppDelayPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppDelayPeer::APP_THREAD_INDEX)) $criteria->add(AppDelayPeer::APP_THREAD_INDEX, $this->app_thread_index);
- if ($this->isColumnModified(AppDelayPeer::APP_DEL_INDEX)) $criteria->add(AppDelayPeer::APP_DEL_INDEX, $this->app_del_index);
- if ($this->isColumnModified(AppDelayPeer::APP_TYPE)) $criteria->add(AppDelayPeer::APP_TYPE, $this->app_type);
- if ($this->isColumnModified(AppDelayPeer::APP_STATUS)) $criteria->add(AppDelayPeer::APP_STATUS, $this->app_status);
- if ($this->isColumnModified(AppDelayPeer::APP_NEXT_TASK)) $criteria->add(AppDelayPeer::APP_NEXT_TASK, $this->app_next_task);
- if ($this->isColumnModified(AppDelayPeer::APP_DELEGATION_USER)) $criteria->add(AppDelayPeer::APP_DELEGATION_USER, $this->app_delegation_user);
- if ($this->isColumnModified(AppDelayPeer::APP_ENABLE_ACTION_USER)) $criteria->add(AppDelayPeer::APP_ENABLE_ACTION_USER, $this->app_enable_action_user);
- if ($this->isColumnModified(AppDelayPeer::APP_ENABLE_ACTION_DATE)) $criteria->add(AppDelayPeer::APP_ENABLE_ACTION_DATE, $this->app_enable_action_date);
- if ($this->isColumnModified(AppDelayPeer::APP_DISABLE_ACTION_USER)) $criteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, $this->app_disable_action_user);
- if ($this->isColumnModified(AppDelayPeer::APP_DISABLE_ACTION_DATE)) $criteria->add(AppDelayPeer::APP_DISABLE_ACTION_DATE, $this->app_disable_action_date);
- if ($this->isColumnModified(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE)) $criteria->add(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, $this->app_automatic_disabled_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppDelayPeer::DATABASE_NAME);
-
- $criteria->add(AppDelayPeer::APP_DELAY_UID, $this->app_delay_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getAppDelayUid();
- }
-
- /**
- * Generic method to set the primary key (app_delay_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setAppDelayUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppDelay (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setAppUid($this->app_uid);
-
- $copyObj->setAppThreadIndex($this->app_thread_index);
-
- $copyObj->setAppDelIndex($this->app_del_index);
-
- $copyObj->setAppType($this->app_type);
-
- $copyObj->setAppStatus($this->app_status);
-
- $copyObj->setAppNextTask($this->app_next_task);
-
- $copyObj->setAppDelegationUser($this->app_delegation_user);
-
- $copyObj->setAppEnableActionUser($this->app_enable_action_user);
-
- $copyObj->setAppEnableActionDate($this->app_enable_action_date);
-
- $copyObj->setAppDisableActionUser($this->app_disable_action_user);
-
- $copyObj->setAppDisableActionDate($this->app_disable_action_date);
-
- $copyObj->setAppAutomaticDisabledDate($this->app_automatic_disabled_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppDelayUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppDelay Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppDelayPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppDelayPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppDelay
diff --git a/workflow/engine/classes/model/om/BaseAppDelayPeer.php b/workflow/engine/classes/model/om/BaseAppDelayPeer.php
index f9f79b92e..1d12e7b6c 100755
--- a/workflow/engine/classes/model/om/BaseAppDelayPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppDelayPeer.php
@@ -12,619 +12,621 @@ include_once 'classes/model/AppDelay.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppDelayPeer {
+abstract class BaseAppDelayPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_DELAY';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppDelay';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 14;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_DELAY_UID field */
+ const APP_DELAY_UID = 'APP_DELAY.APP_DELAY_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'APP_DELAY.PRO_UID';
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_DELAY.APP_UID';
+
+ /** the column name for the APP_THREAD_INDEX field */
+ const APP_THREAD_INDEX = 'APP_DELAY.APP_THREAD_INDEX';
+
+ /** the column name for the APP_DEL_INDEX field */
+ const APP_DEL_INDEX = 'APP_DELAY.APP_DEL_INDEX';
+
+ /** the column name for the APP_TYPE field */
+ const APP_TYPE = 'APP_DELAY.APP_TYPE';
+
+ /** the column name for the APP_STATUS field */
+ const APP_STATUS = 'APP_DELAY.APP_STATUS';
+
+ /** the column name for the APP_NEXT_TASK field */
+ const APP_NEXT_TASK = 'APP_DELAY.APP_NEXT_TASK';
+
+ /** the column name for the APP_DELEGATION_USER field */
+ const APP_DELEGATION_USER = 'APP_DELAY.APP_DELEGATION_USER';
+
+ /** the column name for the APP_ENABLE_ACTION_USER field */
+ const APP_ENABLE_ACTION_USER = 'APP_DELAY.APP_ENABLE_ACTION_USER';
+
+ /** the column name for the APP_ENABLE_ACTION_DATE field */
+ const APP_ENABLE_ACTION_DATE = 'APP_DELAY.APP_ENABLE_ACTION_DATE';
+
+ /** the column name for the APP_DISABLE_ACTION_USER field */
+ const APP_DISABLE_ACTION_USER = 'APP_DELAY.APP_DISABLE_ACTION_USER';
+
+ /** the column name for the APP_DISABLE_ACTION_DATE field */
+ const APP_DISABLE_ACTION_DATE = 'APP_DELAY.APP_DISABLE_ACTION_DATE';
+
+ /** the column name for the APP_AUTOMATIC_DISABLED_DATE field */
+ const APP_AUTOMATIC_DISABLED_DATE = 'APP_DELAY.APP_AUTOMATIC_DISABLED_DATE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppDelayUid', 'ProUid', 'AppUid', 'AppThreadIndex', 'AppDelIndex', 'AppType', 'AppStatus', 'AppNextTask', 'AppDelegationUser', 'AppEnableActionUser', 'AppEnableActionDate', 'AppDisableActionUser', 'AppDisableActionDate', 'AppAutomaticDisabledDate', ),
+ BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID, AppDelayPeer::PRO_UID, AppDelayPeer::APP_UID, AppDelayPeer::APP_THREAD_INDEX, AppDelayPeer::APP_DEL_INDEX, AppDelayPeer::APP_TYPE, AppDelayPeer::APP_STATUS, AppDelayPeer::APP_NEXT_TASK, AppDelayPeer::APP_DELEGATION_USER, AppDelayPeer::APP_ENABLE_ACTION_USER, AppDelayPeer::APP_ENABLE_ACTION_DATE, AppDelayPeer::APP_DISABLE_ACTION_USER, AppDelayPeer::APP_DISABLE_ACTION_DATE, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID', 'PRO_UID', 'APP_UID', 'APP_THREAD_INDEX', 'APP_DEL_INDEX', 'APP_TYPE', 'APP_STATUS', 'APP_NEXT_TASK', 'APP_DELEGATION_USER', 'APP_ENABLE_ACTION_USER', 'APP_ENABLE_ACTION_DATE', 'APP_DISABLE_ACTION_USER', 'APP_DISABLE_ACTION_DATE', 'APP_AUTOMATIC_DISABLED_DATE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppDelayUid' => 0, 'ProUid' => 1, 'AppUid' => 2, 'AppThreadIndex' => 3, 'AppDelIndex' => 4, 'AppType' => 5, 'AppStatus' => 6, 'AppNextTask' => 7, 'AppDelegationUser' => 8, 'AppEnableActionUser' => 9, 'AppEnableActionDate' => 10, 'AppDisableActionUser' => 11, 'AppDisableActionDate' => 12, 'AppAutomaticDisabledDate' => 13, ),
+ BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID => 0, AppDelayPeer::PRO_UID => 1, AppDelayPeer::APP_UID => 2, AppDelayPeer::APP_THREAD_INDEX => 3, AppDelayPeer::APP_DEL_INDEX => 4, AppDelayPeer::APP_TYPE => 5, AppDelayPeer::APP_STATUS => 6, AppDelayPeer::APP_NEXT_TASK => 7, AppDelayPeer::APP_DELEGATION_USER => 8, AppDelayPeer::APP_ENABLE_ACTION_USER => 9, AppDelayPeer::APP_ENABLE_ACTION_DATE => 10, AppDelayPeer::APP_DISABLE_ACTION_USER => 11, AppDelayPeer::APP_DISABLE_ACTION_DATE => 12, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE => 13, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID' => 0, 'PRO_UID' => 1, 'APP_UID' => 2, 'APP_THREAD_INDEX' => 3, 'APP_DEL_INDEX' => 4, 'APP_TYPE' => 5, 'APP_STATUS' => 6, 'APP_NEXT_TASK' => 7, 'APP_DELEGATION_USER' => 8, 'APP_ENABLE_ACTION_USER' => 9, 'APP_ENABLE_ACTION_DATE' => 10, 'APP_DISABLE_ACTION_USER' => 11, 'APP_DISABLE_ACTION_DATE' => 12, 'APP_AUTOMATIC_DISABLED_DATE' => 13, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppDelayMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppDelayMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppDelayPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppDelayPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppDelayPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_DELAY_UID);
+
+ $criteria->addSelectColumn(AppDelayPeer::PRO_UID);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_THREAD_INDEX);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_TYPE);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_STATUS);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_NEXT_TASK);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_DELEGATION_USER);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_ENABLE_ACTION_USER);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_USER);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_DATE);
+
+ $criteria->addSelectColumn(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE);
+
+ }
+
+ const COUNT = 'COUNT(APP_DELAY.APP_DELAY_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_DELAY.APP_DELAY_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppDelayPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppDelayPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppDelayPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppDelay
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppDelayPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppDelayPeer::populateObjects(AppDelayPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppDelayPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppDelayPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppDelayPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppDelay or Criteria object.
+ *
+ * @param mixed $values Criteria or AppDelay object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppDelay object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppDelay or Criteria object.
+ *
+ * @param mixed $values Criteria or AppDelay object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppDelayPeer::APP_DELAY_UID);
+ $selectCriteria->add(AppDelayPeer::APP_DELAY_UID, $criteria->remove(AppDelayPeer::APP_DELAY_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_DELAY table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppDelayPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppDelay or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppDelay object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppDelay) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(AppDelayPeer::APP_DELAY_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppDelay object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppDelay $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppDelay $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppDelayPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppDelayPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AppDelayPeer::DATABASE_NAME, AppDelayPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return AppDelay
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(AppDelayPeer::DATABASE_NAME);
+
+ $criteria->add(AppDelayPeer::APP_DELAY_UID, $pk);
+
+
+ $v = AppDelayPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(AppDelayPeer::APP_DELAY_UID, $pks, Criteria::IN);
+ $objs = AppDelayPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'APP_DELAY';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppDelay';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 14;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_DELAY_UID field */
- const APP_DELAY_UID = 'APP_DELAY.APP_DELAY_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'APP_DELAY.PRO_UID';
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_DELAY.APP_UID';
-
- /** the column name for the APP_THREAD_INDEX field */
- const APP_THREAD_INDEX = 'APP_DELAY.APP_THREAD_INDEX';
-
- /** the column name for the APP_DEL_INDEX field */
- const APP_DEL_INDEX = 'APP_DELAY.APP_DEL_INDEX';
-
- /** the column name for the APP_TYPE field */
- const APP_TYPE = 'APP_DELAY.APP_TYPE';
-
- /** the column name for the APP_STATUS field */
- const APP_STATUS = 'APP_DELAY.APP_STATUS';
-
- /** the column name for the APP_NEXT_TASK field */
- const APP_NEXT_TASK = 'APP_DELAY.APP_NEXT_TASK';
-
- /** the column name for the APP_DELEGATION_USER field */
- const APP_DELEGATION_USER = 'APP_DELAY.APP_DELEGATION_USER';
-
- /** the column name for the APP_ENABLE_ACTION_USER field */
- const APP_ENABLE_ACTION_USER = 'APP_DELAY.APP_ENABLE_ACTION_USER';
-
- /** the column name for the APP_ENABLE_ACTION_DATE field */
- const APP_ENABLE_ACTION_DATE = 'APP_DELAY.APP_ENABLE_ACTION_DATE';
-
- /** the column name for the APP_DISABLE_ACTION_USER field */
- const APP_DISABLE_ACTION_USER = 'APP_DELAY.APP_DISABLE_ACTION_USER';
-
- /** the column name for the APP_DISABLE_ACTION_DATE field */
- const APP_DISABLE_ACTION_DATE = 'APP_DELAY.APP_DISABLE_ACTION_DATE';
-
- /** the column name for the APP_AUTOMATIC_DISABLED_DATE field */
- const APP_AUTOMATIC_DISABLED_DATE = 'APP_DELAY.APP_AUTOMATIC_DISABLED_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppDelayUid', 'ProUid', 'AppUid', 'AppThreadIndex', 'AppDelIndex', 'AppType', 'AppStatus', 'AppNextTask', 'AppDelegationUser', 'AppEnableActionUser', 'AppEnableActionDate', 'AppDisableActionUser', 'AppDisableActionDate', 'AppAutomaticDisabledDate', ),
- BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID, AppDelayPeer::PRO_UID, AppDelayPeer::APP_UID, AppDelayPeer::APP_THREAD_INDEX, AppDelayPeer::APP_DEL_INDEX, AppDelayPeer::APP_TYPE, AppDelayPeer::APP_STATUS, AppDelayPeer::APP_NEXT_TASK, AppDelayPeer::APP_DELEGATION_USER, AppDelayPeer::APP_ENABLE_ACTION_USER, AppDelayPeer::APP_ENABLE_ACTION_DATE, AppDelayPeer::APP_DISABLE_ACTION_USER, AppDelayPeer::APP_DISABLE_ACTION_DATE, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID', 'PRO_UID', 'APP_UID', 'APP_THREAD_INDEX', 'APP_DEL_INDEX', 'APP_TYPE', 'APP_STATUS', 'APP_NEXT_TASK', 'APP_DELEGATION_USER', 'APP_ENABLE_ACTION_USER', 'APP_ENABLE_ACTION_DATE', 'APP_DISABLE_ACTION_USER', 'APP_DISABLE_ACTION_DATE', 'APP_AUTOMATIC_DISABLED_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppDelayUid' => 0, 'ProUid' => 1, 'AppUid' => 2, 'AppThreadIndex' => 3, 'AppDelIndex' => 4, 'AppType' => 5, 'AppStatus' => 6, 'AppNextTask' => 7, 'AppDelegationUser' => 8, 'AppEnableActionUser' => 9, 'AppEnableActionDate' => 10, 'AppDisableActionUser' => 11, 'AppDisableActionDate' => 12, 'AppAutomaticDisabledDate' => 13, ),
- BasePeer::TYPE_COLNAME => array (AppDelayPeer::APP_DELAY_UID => 0, AppDelayPeer::PRO_UID => 1, AppDelayPeer::APP_UID => 2, AppDelayPeer::APP_THREAD_INDEX => 3, AppDelayPeer::APP_DEL_INDEX => 4, AppDelayPeer::APP_TYPE => 5, AppDelayPeer::APP_STATUS => 6, AppDelayPeer::APP_NEXT_TASK => 7, AppDelayPeer::APP_DELEGATION_USER => 8, AppDelayPeer::APP_ENABLE_ACTION_USER => 9, AppDelayPeer::APP_ENABLE_ACTION_DATE => 10, AppDelayPeer::APP_DISABLE_ACTION_USER => 11, AppDelayPeer::APP_DISABLE_ACTION_DATE => 12, AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE => 13, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_DELAY_UID' => 0, 'PRO_UID' => 1, 'APP_UID' => 2, 'APP_THREAD_INDEX' => 3, 'APP_DEL_INDEX' => 4, 'APP_TYPE' => 5, 'APP_STATUS' => 6, 'APP_NEXT_TASK' => 7, 'APP_DELEGATION_USER' => 8, 'APP_ENABLE_ACTION_USER' => 9, 'APP_ENABLE_ACTION_DATE' => 10, 'APP_DISABLE_ACTION_USER' => 11, 'APP_DISABLE_ACTION_DATE' => 12, 'APP_AUTOMATIC_DISABLED_DATE' => 13, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppDelayMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppDelayMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppDelayPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppDelayPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppDelayPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppDelayPeer::APP_DELAY_UID);
-
- $criteria->addSelectColumn(AppDelayPeer::PRO_UID);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_UID);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_THREAD_INDEX);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_TYPE);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_STATUS);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_NEXT_TASK);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_DELEGATION_USER);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_ENABLE_ACTION_USER);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_USER);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_DATE);
-
- $criteria->addSelectColumn(AppDelayPeer::APP_AUTOMATIC_DISABLED_DATE);
-
- }
-
- const COUNT = 'COUNT(APP_DELAY.APP_DELAY_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_DELAY.APP_DELAY_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppDelayPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppDelayPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppDelayPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppDelay
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppDelayPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppDelayPeer::populateObjects(AppDelayPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppDelayPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppDelayPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppDelayPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppDelay or Criteria object.
- *
- * @param mixed $values Criteria or AppDelay object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppDelay object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppDelay or Criteria object.
- *
- * @param mixed $values Criteria or AppDelay object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppDelayPeer::APP_DELAY_UID);
- $selectCriteria->add(AppDelayPeer::APP_DELAY_UID, $criteria->remove(AppDelayPeer::APP_DELAY_UID), $comparison);
-
- } else { // $values is AppDelay object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_DELAY table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppDelayPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppDelay or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppDelay object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppDelay) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(AppDelayPeer::APP_DELAY_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppDelay object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppDelay $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppDelay $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppDelayPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppDelayPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AppDelayPeer::DATABASE_NAME, AppDelayPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return AppDelay
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(AppDelayPeer::DATABASE_NAME);
-
- $criteria->add(AppDelayPeer::APP_DELAY_UID, $pk);
-
-
- $v = AppDelayPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(AppDelayPeer::APP_DELAY_UID, $pks, Criteria::IN);
- $objs = AppDelayPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseAppDelayPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppDelayPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppDelayPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppDelayMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppDelayMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppDelayMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppDelayMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppDelegation.php b/workflow/engine/classes/model/om/BaseAppDelegation.php
index 66efb3e3a..86d4bf651 100755
--- a/workflow/engine/classes/model/om/BaseAppDelegation.php
+++ b/workflow/engine/classes/model/om/BaseAppDelegation.php
@@ -16,1678 +16,1797 @@ include_once 'classes/model/AppDelegationPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppDelegation extends BaseObject implements Persistent {
+abstract class BaseAppDelegation extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppDelegationPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the del_index field.
+ * @var int
+ */
+ protected $del_index = 0;
+
+ /**
+ * The value for the del_previous field.
+ * @var int
+ */
+ protected $del_previous = 0;
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the del_type field.
+ * @var string
+ */
+ protected $del_type = 'NORMAL';
+
+ /**
+ * The value for the del_thread field.
+ * @var int
+ */
+ protected $del_thread = 0;
+
+ /**
+ * The value for the del_thread_status field.
+ * @var string
+ */
+ protected $del_thread_status = 'OPEN';
+
+ /**
+ * The value for the del_priority field.
+ * @var string
+ */
+ protected $del_priority = '3';
+
+ /**
+ * The value for the del_delegate_date field.
+ * @var int
+ */
+ protected $del_delegate_date;
+
+ /**
+ * The value for the del_init_date field.
+ * @var int
+ */
+ protected $del_init_date;
+
+ /**
+ * The value for the del_task_due_date field.
+ * @var int
+ */
+ protected $del_task_due_date;
+
+ /**
+ * The value for the del_finish_date field.
+ * @var int
+ */
+ protected $del_finish_date;
+
+ /**
+ * The value for the del_duration field.
+ * @var double
+ */
+ protected $del_duration = 0;
+
+ /**
+ * The value for the del_queue_duration field.
+ * @var double
+ */
+ protected $del_queue_duration = 0;
+
+ /**
+ * The value for the del_delay_duration field.
+ * @var double
+ */
+ protected $del_delay_duration = 0;
+
+ /**
+ * The value for the del_started field.
+ * @var int
+ */
+ protected $del_started = 0;
+
+ /**
+ * The value for the del_finished field.
+ * @var int
+ */
+ protected $del_finished = 0;
+
+ /**
+ * The value for the del_delayed field.
+ * @var int
+ */
+ protected $del_delayed = 0;
+
+ /**
+ * The value for the del_data field.
+ * @var string
+ */
+ protected $del_data;
+
+ /**
+ * The value for the app_overdue_percentage field.
+ * @var double
+ */
+ protected $app_overdue_percentage = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [del_index] column value.
+ *
+ * @return int
+ */
+ public function getDelIndex()
+ {
+
+ return $this->del_index;
+ }
+
+ /**
+ * Get the [del_previous] column value.
+ *
+ * @return int
+ */
+ public function getDelPrevious()
+ {
+
+ return $this->del_previous;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [del_type] column value.
+ *
+ * @return string
+ */
+ public function getDelType()
+ {
+
+ return $this->del_type;
+ }
+
+ /**
+ * Get the [del_thread] column value.
+ *
+ * @return int
+ */
+ public function getDelThread()
+ {
+
+ return $this->del_thread;
+ }
+
+ /**
+ * Get the [del_thread_status] column value.
+ *
+ * @return string
+ */
+ public function getDelThreadStatus()
+ {
+
+ return $this->del_thread_status;
+ }
+
+ /**
+ * Get the [del_priority] column value.
+ *
+ * @return string
+ */
+ public function getDelPriority()
+ {
+
+ return $this->del_priority;
+ }
+
+ /**
+ * Get the [optionally formatted] [del_delegate_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelDelegateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_delegate_date === null || $this->del_delegate_date === '') {
+ return null;
+ } elseif (!is_int($this->del_delegate_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_delegate_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " .
+ var_export($this->del_delegate_date, true));
+ }
+ } else {
+ $ts = $this->del_delegate_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [del_init_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelInitDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_init_date === null || $this->del_init_date === '') {
+ return null;
+ } elseif (!is_int($this->del_init_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_init_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " .
+ var_export($this->del_init_date, true));
+ }
+ } else {
+ $ts = $this->del_init_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [del_task_due_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelTaskDueDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_task_due_date === null || $this->del_task_due_date === '') {
+ return null;
+ } elseif (!is_int($this->del_task_due_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_task_due_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_task_due_date] as date/time value: " .
+ var_export($this->del_task_due_date, true));
+ }
+ } else {
+ $ts = $this->del_task_due_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [del_finish_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDelFinishDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->del_finish_date === null || $this->del_finish_date === '') {
+ return null;
+ } elseif (!is_int($this->del_finish_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->del_finish_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [del_finish_date] as date/time value: " .
+ var_export($this->del_finish_date, true));
+ }
+ } else {
+ $ts = $this->del_finish_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [del_duration] column value.
+ *
+ * @return double
+ */
+ public function getDelDuration()
+ {
+
+ return $this->del_duration;
+ }
+
+ /**
+ * Get the [del_queue_duration] column value.
+ *
+ * @return double
+ */
+ public function getDelQueueDuration()
+ {
+
+ return $this->del_queue_duration;
+ }
+
+ /**
+ * Get the [del_delay_duration] column value.
+ *
+ * @return double
+ */
+ public function getDelDelayDuration()
+ {
+
+ return $this->del_delay_duration;
+ }
+
+ /**
+ * Get the [del_started] column value.
+ *
+ * @return int
+ */
+ public function getDelStarted()
+ {
+
+ return $this->del_started;
+ }
+
+ /**
+ * Get the [del_finished] column value.
+ *
+ * @return int
+ */
+ public function getDelFinished()
+ {
+
+ return $this->del_finished;
+ }
+
+ /**
+ * Get the [del_delayed] column value.
+ *
+ * @return int
+ */
+ public function getDelDelayed()
+ {
+
+ return $this->del_delayed;
+ }
+
+ /**
+ * Get the [del_data] column value.
+ *
+ * @return string
+ */
+ public function getDelData()
+ {
+
+ return $this->del_data;
+ }
+
+ /**
+ * Get the [app_overdue_percentage] column value.
+ *
+ * @return double
+ */
+ public function getAppOverduePercentage()
+ {
+
+ return $this->app_overdue_percentage;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndex($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->del_index !== $v || $v === 0) {
+ $this->del_index = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_INDEX;
+ }
+
+ } // setDelIndex()
+
+ /**
+ * Set the value of [del_previous] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelPrevious($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->del_previous !== $v || $v === 0) {
+ $this->del_previous = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_PREVIOUS;
+ }
+
+ } // setDelPrevious()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [del_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDelType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->del_type !== $v || $v === 'NORMAL') {
+ $this->del_type = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_TYPE;
+ }
+
+ } // setDelType()
+
+ /**
+ * Set the value of [del_thread] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelThread($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->del_thread !== $v || $v === 0) {
+ $this->del_thread = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_THREAD;
+ }
+
+ } // setDelThread()
+
+ /**
+ * Set the value of [del_thread_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDelThreadStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->del_thread_status !== $v || $v === 'OPEN') {
+ $this->del_thread_status = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_THREAD_STATUS;
+ }
+
+ } // setDelThreadStatus()
+
+ /**
+ * Set the value of [del_priority] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDelPriority($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->del_priority !== $v || $v === '3') {
+ $this->del_priority = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_PRIORITY;
+ }
+
+ } // setDelPriority()
+
+ /**
+ * Set the value of [del_delegate_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelDelegateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_delegate_date !== $ts) {
+ $this->del_delegate_date = $ts;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_DELEGATE_DATE;
+ }
+
+ } // setDelDelegateDate()
+
+ /**
+ * Set the value of [del_init_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelInitDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_init_date !== $ts) {
+ $this->del_init_date = $ts;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_INIT_DATE;
+ }
+
+ } // setDelInitDate()
+
+ /**
+ * Set the value of [del_task_due_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelTaskDueDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_task_due_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_task_due_date !== $ts) {
+ $this->del_task_due_date = $ts;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_TASK_DUE_DATE;
+ }
+
+ } // setDelTaskDueDate()
+
+ /**
+ * Set the value of [del_finish_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelFinishDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [del_finish_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->del_finish_date !== $ts) {
+ $this->del_finish_date = $ts;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_FINISH_DATE;
+ }
+
+ } // setDelFinishDate()
+
+ /**
+ * Set the value of [del_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setDelDuration($v)
+ {
+
+ if ($this->del_duration !== $v || $v === 0) {
+ $this->del_duration = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_DURATION;
+ }
+
+ } // setDelDuration()
+
+ /**
+ * Set the value of [del_queue_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setDelQueueDuration($v)
+ {
+
+ if ($this->del_queue_duration !== $v || $v === 0) {
+ $this->del_queue_duration = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_QUEUE_DURATION;
+ }
+
+ } // setDelQueueDuration()
+
+ /**
+ * Set the value of [del_delay_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setDelDelayDuration($v)
+ {
+
+ if ($this->del_delay_duration !== $v || $v === 0) {
+ $this->del_delay_duration = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_DELAY_DURATION;
+ }
+
+ } // setDelDelayDuration()
+
+ /**
+ * Set the value of [del_started] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelStarted($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->del_started !== $v || $v === 0) {
+ $this->del_started = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_STARTED;
+ }
+
+ } // setDelStarted()
+
+ /**
+ * Set the value of [del_finished] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelFinished($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->del_finished !== $v || $v === 0) {
+ $this->del_finished = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_FINISHED;
+ }
+
+ } // setDelFinished()
+
+ /**
+ * Set the value of [del_delayed] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelDelayed($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->del_delayed !== $v || $v === 0) {
+ $this->del_delayed = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_DELAYED;
+ }
+
+ } // setDelDelayed()
+ /**
+ * Set the value of [del_data] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDelData($v)
+ {
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppDelegationPeer
- */
- protected static $peer;
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+ if ($this->del_data !== $v) {
+ $this->del_data = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::DEL_DATA;
+ }
+
+ } // setDelData()
+
+ /**
+ * Set the value of [app_overdue_percentage] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setAppOverduePercentage($v)
+ {
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
+ if ($this->app_overdue_percentage !== $v || $v === 0) {
+ $this->app_overdue_percentage = $v;
+ $this->modifiedColumns[] = AppDelegationPeer::APP_OVERDUE_PERCENTAGE;
+ }
+
+ } // setAppOverduePercentage()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->del_index = $rs->getInt($startcol + 1);
+
+ $this->del_previous = $rs->getInt($startcol + 2);
+
+ $this->pro_uid = $rs->getString($startcol + 3);
+
+ $this->tas_uid = $rs->getString($startcol + 4);
+
+ $this->usr_uid = $rs->getString($startcol + 5);
+
+ $this->del_type = $rs->getString($startcol + 6);
+
+ $this->del_thread = $rs->getInt($startcol + 7);
+
+ $this->del_thread_status = $rs->getString($startcol + 8);
+
+ $this->del_priority = $rs->getString($startcol + 9);
+
+ $this->del_delegate_date = $rs->getTimestamp($startcol + 10, null);
+
+ $this->del_init_date = $rs->getTimestamp($startcol + 11, null);
+
+ $this->del_task_due_date = $rs->getTimestamp($startcol + 12, null);
+
+ $this->del_finish_date = $rs->getTimestamp($startcol + 13, null);
+
+ $this->del_duration = $rs->getFloat($startcol + 14);
+
+ $this->del_queue_duration = $rs->getFloat($startcol + 15);
+
+ $this->del_delay_duration = $rs->getFloat($startcol + 16);
+
+ $this->del_started = $rs->getInt($startcol + 17);
+
+ $this->del_finished = $rs->getInt($startcol + 18);
+
+ $this->del_delayed = $rs->getInt($startcol + 19);
+
+ $this->del_data = $rs->getString($startcol + 20);
+
+ $this->app_overdue_percentage = $rs->getFloat($startcol + 21);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 22; // 22 = AppDelegationPeer::NUM_COLUMNS - AppDelegationPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppDelegation object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppDelegationPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppDelegationPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppDelegationPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppDelegationPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppDelegationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getDelIndex();
+ break;
+ case 2:
+ return $this->getDelPrevious();
+ break;
+ case 3:
+ return $this->getProUid();
+ break;
+ case 4:
+ return $this->getTasUid();
+ break;
+ case 5:
+ return $this->getUsrUid();
+ break;
+ case 6:
+ return $this->getDelType();
+ break;
+ case 7:
+ return $this->getDelThread();
+ break;
+ case 8:
+ return $this->getDelThreadStatus();
+ break;
+ case 9:
+ return $this->getDelPriority();
+ break;
+ case 10:
+ return $this->getDelDelegateDate();
+ break;
+ case 11:
+ return $this->getDelInitDate();
+ break;
+ case 12:
+ return $this->getDelTaskDueDate();
+ break;
+ case 13:
+ return $this->getDelFinishDate();
+ break;
+ case 14:
+ return $this->getDelDuration();
+ break;
+ case 15:
+ return $this->getDelQueueDuration();
+ break;
+ case 16:
+ return $this->getDelDelayDuration();
+ break;
+ case 17:
+ return $this->getDelStarted();
+ break;
+ case 18:
+ return $this->getDelFinished();
+ break;
+ case 19:
+ return $this->getDelDelayed();
+ break;
+ case 20:
+ return $this->getDelData();
+ break;
+ case 21:
+ return $this->getAppOverduePercentage();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppDelegationPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getDelIndex(),
+ $keys[2] => $this->getDelPrevious(),
+ $keys[3] => $this->getProUid(),
+ $keys[4] => $this->getTasUid(),
+ $keys[5] => $this->getUsrUid(),
+ $keys[6] => $this->getDelType(),
+ $keys[7] => $this->getDelThread(),
+ $keys[8] => $this->getDelThreadStatus(),
+ $keys[9] => $this->getDelPriority(),
+ $keys[10] => $this->getDelDelegateDate(),
+ $keys[11] => $this->getDelInitDate(),
+ $keys[12] => $this->getDelTaskDueDate(),
+ $keys[13] => $this->getDelFinishDate(),
+ $keys[14] => $this->getDelDuration(),
+ $keys[15] => $this->getDelQueueDuration(),
+ $keys[16] => $this->getDelDelayDuration(),
+ $keys[17] => $this->getDelStarted(),
+ $keys[18] => $this->getDelFinished(),
+ $keys[19] => $this->getDelDelayed(),
+ $keys[20] => $this->getDelData(),
+ $keys[21] => $this->getAppOverduePercentage(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppDelegationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setDelIndex($value);
+ break;
+ case 2:
+ $this->setDelPrevious($value);
+ break;
+ case 3:
+ $this->setProUid($value);
+ break;
+ case 4:
+ $this->setTasUid($value);
+ break;
+ case 5:
+ $this->setUsrUid($value);
+ break;
+ case 6:
+ $this->setDelType($value);
+ break;
+ case 7:
+ $this->setDelThread($value);
+ break;
+ case 8:
+ $this->setDelThreadStatus($value);
+ break;
+ case 9:
+ $this->setDelPriority($value);
+ break;
+ case 10:
+ $this->setDelDelegateDate($value);
+ break;
+ case 11:
+ $this->setDelInitDate($value);
+ break;
+ case 12:
+ $this->setDelTaskDueDate($value);
+ break;
+ case 13:
+ $this->setDelFinishDate($value);
+ break;
+ case 14:
+ $this->setDelDuration($value);
+ break;
+ case 15:
+ $this->setDelQueueDuration($value);
+ break;
+ case 16:
+ $this->setDelDelayDuration($value);
+ break;
+ case 17:
+ $this->setDelStarted($value);
+ break;
+ case 18:
+ $this->setDelFinished($value);
+ break;
+ case 19:
+ $this->setDelDelayed($value);
+ break;
+ case 20:
+ $this->setDelData($value);
+ break;
+ case 21:
+ $this->setAppOverduePercentage($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppDelegationPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDelIndex($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setDelPrevious($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setProUid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setTasUid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setUsrUid($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setDelType($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setDelThread($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setDelThreadStatus($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setDelPriority($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setDelDelegateDate($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setDelInitDate($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setDelTaskDueDate($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setDelFinishDate($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setDelDuration($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setDelQueueDuration($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setDelDelayDuration($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setDelStarted($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setDelFinished($arr[$keys[18]]);
+ }
+
+ if (array_key_exists($keys[19], $arr)) {
+ $this->setDelDelayed($arr[$keys[19]]);
+ }
+
+ if (array_key_exists($keys[20], $arr)) {
+ $this->setDelData($arr[$keys[20]]);
+ }
+
+ if (array_key_exists($keys[21], $arr)) {
+ $this->setAppOverduePercentage($arr[$keys[21]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppDelegationPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppDelegationPeer::APP_UID)) {
+ $criteria->add(AppDelegationPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_INDEX)) {
+ $criteria->add(AppDelegationPeer::DEL_INDEX, $this->del_index);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_PREVIOUS)) {
+ $criteria->add(AppDelegationPeer::DEL_PREVIOUS, $this->del_previous);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::PRO_UID)) {
+ $criteria->add(AppDelegationPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::TAS_UID)) {
+ $criteria->add(AppDelegationPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::USR_UID)) {
+ $criteria->add(AppDelegationPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_TYPE)) {
+ $criteria->add(AppDelegationPeer::DEL_TYPE, $this->del_type);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_THREAD)) {
+ $criteria->add(AppDelegationPeer::DEL_THREAD, $this->del_thread);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_THREAD_STATUS)) {
+ $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, $this->del_thread_status);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_PRIORITY)) {
+ $criteria->add(AppDelegationPeer::DEL_PRIORITY, $this->del_priority);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_DELEGATE_DATE)) {
+ $criteria->add(AppDelegationPeer::DEL_DELEGATE_DATE, $this->del_delegate_date);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_INIT_DATE)) {
+ $criteria->add(AppDelegationPeer::DEL_INIT_DATE, $this->del_init_date);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_TASK_DUE_DATE)) {
+ $criteria->add(AppDelegationPeer::DEL_TASK_DUE_DATE, $this->del_task_due_date);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_FINISH_DATE)) {
+ $criteria->add(AppDelegationPeer::DEL_FINISH_DATE, $this->del_finish_date);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_DURATION)) {
+ $criteria->add(AppDelegationPeer::DEL_DURATION, $this->del_duration);
+ }
+
+ if ($this->isColumnModified(AppDelegationPeer::DEL_QUEUE_DURATION)) {
+ $criteria->add(AppDelegationPeer::DEL_QUEUE_DURATION, $this->del_queue_duration);
+ }
+ if ($this->isColumnModified(AppDelegationPeer::DEL_DELAY_DURATION)) {
+ $criteria->add(AppDelegationPeer::DEL_DELAY_DURATION, $this->del_delay_duration);
+ }
- /**
- * The value for the del_index field.
- * @var int
- */
- protected $del_index = 0;
+ if ($this->isColumnModified(AppDelegationPeer::DEL_STARTED)) {
+ $criteria->add(AppDelegationPeer::DEL_STARTED, $this->del_started);
+ }
+ if ($this->isColumnModified(AppDelegationPeer::DEL_FINISHED)) {
+ $criteria->add(AppDelegationPeer::DEL_FINISHED, $this->del_finished);
+ }
- /**
- * The value for the del_previous field.
- * @var int
- */
- protected $del_previous = 0;
+ if ($this->isColumnModified(AppDelegationPeer::DEL_DELAYED)) {
+ $criteria->add(AppDelegationPeer::DEL_DELAYED, $this->del_delayed);
+ }
+ if ($this->isColumnModified(AppDelegationPeer::DEL_DATA)) {
+ $criteria->add(AppDelegationPeer::DEL_DATA, $this->del_data);
+ }
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ if ($this->isColumnModified(AppDelegationPeer::APP_OVERDUE_PERCENTAGE)) {
+ $criteria->add(AppDelegationPeer::APP_OVERDUE_PERCENTAGE, $this->app_overdue_percentage);
+ }
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppDelegationPeer::DATABASE_NAME);
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
+ $criteria->add(AppDelegationPeer::APP_UID, $this->app_uid);
+ $criteria->add(AppDelegationPeer::DEL_INDEX, $this->del_index);
+ return $criteria;
+ }
- /**
- * The value for the del_type field.
- * @var string
- */
- protected $del_type = 'NORMAL';
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+ $pks[0] = $this->getAppUid();
- /**
- * The value for the del_thread field.
- * @var int
- */
- protected $del_thread = 0;
+ $pks[1] = $this->getDelIndex();
+ return $pks;
+ }
- /**
- * The value for the del_thread_status field.
- * @var string
- */
- protected $del_thread_status = 'OPEN';
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+ $this->setAppUid($keys[0]);
- /**
- * The value for the del_priority field.
- * @var string
- */
- protected $del_priority = '3';
+ $this->setDelIndex($keys[1]);
+ }
- /**
- * The value for the del_delegate_date field.
- * @var int
- */
- protected $del_delegate_date;
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppDelegation (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+ $copyObj->setDelPrevious($this->del_previous);
- /**
- * The value for the del_init_date field.
- * @var int
- */
- protected $del_init_date;
+ $copyObj->setProUid($this->pro_uid);
+ $copyObj->setTasUid($this->tas_uid);
- /**
- * The value for the del_task_due_date field.
- * @var int
- */
- protected $del_task_due_date;
+ $copyObj->setUsrUid($this->usr_uid);
+ $copyObj->setDelType($this->del_type);
- /**
- * The value for the del_finish_date field.
- * @var int
- */
- protected $del_finish_date;
+ $copyObj->setDelThread($this->del_thread);
+ $copyObj->setDelThreadStatus($this->del_thread_status);
- /**
- * The value for the del_duration field.
- * @var double
- */
- protected $del_duration = 0;
+ $copyObj->setDelPriority($this->del_priority);
+ $copyObj->setDelDelegateDate($this->del_delegate_date);
- /**
- * The value for the del_queue_duration field.
- * @var double
- */
- protected $del_queue_duration = 0;
+ $copyObj->setDelInitDate($this->del_init_date);
+ $copyObj->setDelTaskDueDate($this->del_task_due_date);
- /**
- * The value for the del_delay_duration field.
- * @var double
- */
- protected $del_delay_duration = 0;
-
+ $copyObj->setDelFinishDate($this->del_finish_date);
- /**
- * The value for the del_started field.
- * @var int
- */
- protected $del_started = 0;
-
-
- /**
- * The value for the del_finished field.
- * @var int
- */
- protected $del_finished = 0;
-
-
- /**
- * The value for the del_delayed field.
- * @var int
- */
- protected $del_delayed = 0;
-
-
- /**
- * The value for the del_data field.
- * @var string
- */
- protected $del_data;
-
-
- /**
- * The value for the app_overdue_percentage field.
- * @var double
- */
- protected $app_overdue_percentage = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [del_index] column value.
- *
- * @return int
- */
- public function getDelIndex()
- {
-
- return $this->del_index;
- }
-
- /**
- * Get the [del_previous] column value.
- *
- * @return int
- */
- public function getDelPrevious()
- {
-
- return $this->del_previous;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [del_type] column value.
- *
- * @return string
- */
- public function getDelType()
- {
-
- return $this->del_type;
- }
-
- /**
- * Get the [del_thread] column value.
- *
- * @return int
- */
- public function getDelThread()
- {
-
- return $this->del_thread;
- }
-
- /**
- * Get the [del_thread_status] column value.
- *
- * @return string
- */
- public function getDelThreadStatus()
- {
-
- return $this->del_thread_status;
- }
-
- /**
- * Get the [del_priority] column value.
- *
- * @return string
- */
- public function getDelPriority()
- {
-
- return $this->del_priority;
- }
-
- /**
- * Get the [optionally formatted] [del_delegate_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelDelegateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_delegate_date === null || $this->del_delegate_date === '') {
- return null;
- } elseif (!is_int($this->del_delegate_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_delegate_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " . var_export($this->del_delegate_date, true));
- }
- } else {
- $ts = $this->del_delegate_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [del_init_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelInitDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_init_date === null || $this->del_init_date === '') {
- return null;
- } elseif (!is_int($this->del_init_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_init_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " . var_export($this->del_init_date, true));
- }
- } else {
- $ts = $this->del_init_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [del_task_due_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelTaskDueDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_task_due_date === null || $this->del_task_due_date === '') {
- return null;
- } elseif (!is_int($this->del_task_due_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_task_due_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_task_due_date] as date/time value: " . var_export($this->del_task_due_date, true));
- }
- } else {
- $ts = $this->del_task_due_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [del_finish_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDelFinishDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->del_finish_date === null || $this->del_finish_date === '') {
- return null;
- } elseif (!is_int($this->del_finish_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->del_finish_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [del_finish_date] as date/time value: " . var_export($this->del_finish_date, true));
- }
- } else {
- $ts = $this->del_finish_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [del_duration] column value.
- *
- * @return double
- */
- public function getDelDuration()
- {
-
- return $this->del_duration;
- }
-
- /**
- * Get the [del_queue_duration] column value.
- *
- * @return double
- */
- public function getDelQueueDuration()
- {
-
- return $this->del_queue_duration;
- }
-
- /**
- * Get the [del_delay_duration] column value.
- *
- * @return double
- */
- public function getDelDelayDuration()
- {
-
- return $this->del_delay_duration;
- }
-
- /**
- * Get the [del_started] column value.
- *
- * @return int
- */
- public function getDelStarted()
- {
-
- return $this->del_started;
- }
-
- /**
- * Get the [del_finished] column value.
- *
- * @return int
- */
- public function getDelFinished()
- {
-
- return $this->del_finished;
- }
-
- /**
- * Get the [del_delayed] column value.
- *
- * @return int
- */
- public function getDelDelayed()
- {
-
- return $this->del_delayed;
- }
-
- /**
- * Get the [del_data] column value.
- *
- * @return string
- */
- public function getDelData()
- {
-
- return $this->del_data;
- }
-
- /**
- * Get the [app_overdue_percentage] column value.
- *
- * @return double
- */
- public function getAppOverduePercentage()
- {
-
- return $this->app_overdue_percentage;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppDelegationPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndex($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->del_index !== $v || $v === 0) {
- $this->del_index = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_INDEX;
- }
-
- } // setDelIndex()
-
- /**
- * Set the value of [del_previous] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelPrevious($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->del_previous !== $v || $v === 0) {
- $this->del_previous = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_PREVIOUS;
- }
-
- } // setDelPrevious()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = AppDelegationPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = AppDelegationPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = AppDelegationPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [del_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDelType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->del_type !== $v || $v === 'NORMAL') {
- $this->del_type = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_TYPE;
- }
-
- } // setDelType()
-
- /**
- * Set the value of [del_thread] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelThread($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->del_thread !== $v || $v === 0) {
- $this->del_thread = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_THREAD;
- }
-
- } // setDelThread()
-
- /**
- * Set the value of [del_thread_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDelThreadStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->del_thread_status !== $v || $v === 'OPEN') {
- $this->del_thread_status = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_THREAD_STATUS;
- }
-
- } // setDelThreadStatus()
-
- /**
- * Set the value of [del_priority] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDelPriority($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->del_priority !== $v || $v === '3') {
- $this->del_priority = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_PRIORITY;
- }
-
- } // setDelPriority()
-
- /**
- * Set the value of [del_delegate_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelDelegateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_delegate_date !== $ts) {
- $this->del_delegate_date = $ts;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_DELEGATE_DATE;
- }
-
- } // setDelDelegateDate()
-
- /**
- * Set the value of [del_init_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelInitDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_init_date !== $ts) {
- $this->del_init_date = $ts;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_INIT_DATE;
- }
-
- } // setDelInitDate()
-
- /**
- * Set the value of [del_task_due_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelTaskDueDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_task_due_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_task_due_date !== $ts) {
- $this->del_task_due_date = $ts;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_TASK_DUE_DATE;
- }
-
- } // setDelTaskDueDate()
-
- /**
- * Set the value of [del_finish_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelFinishDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [del_finish_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->del_finish_date !== $ts) {
- $this->del_finish_date = $ts;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_FINISH_DATE;
- }
-
- } // setDelFinishDate()
-
- /**
- * Set the value of [del_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setDelDuration($v)
- {
-
- if ($this->del_duration !== $v || $v === 0) {
- $this->del_duration = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_DURATION;
- }
-
- } // setDelDuration()
-
- /**
- * Set the value of [del_queue_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setDelQueueDuration($v)
- {
-
- if ($this->del_queue_duration !== $v || $v === 0) {
- $this->del_queue_duration = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_QUEUE_DURATION;
- }
-
- } // setDelQueueDuration()
-
- /**
- * Set the value of [del_delay_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setDelDelayDuration($v)
- {
-
- if ($this->del_delay_duration !== $v || $v === 0) {
- $this->del_delay_duration = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_DELAY_DURATION;
- }
-
- } // setDelDelayDuration()
-
- /**
- * Set the value of [del_started] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelStarted($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->del_started !== $v || $v === 0) {
- $this->del_started = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_STARTED;
- }
-
- } // setDelStarted()
-
- /**
- * Set the value of [del_finished] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelFinished($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->del_finished !== $v || $v === 0) {
- $this->del_finished = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_FINISHED;
- }
-
- } // setDelFinished()
-
- /**
- * Set the value of [del_delayed] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelDelayed($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->del_delayed !== $v || $v === 0) {
- $this->del_delayed = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_DELAYED;
- }
-
- } // setDelDelayed()
+ $copyObj->setDelDuration($this->del_duration);
- /**
- * Set the value of [del_data] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDelData($v)
- {
+ $copyObj->setDelQueueDuration($this->del_queue_duration);
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
+ $copyObj->setDelDelayDuration($this->del_delay_duration);
- if ($this->del_data !== $v) {
- $this->del_data = $v;
- $this->modifiedColumns[] = AppDelegationPeer::DEL_DATA;
- }
-
- } // setDelData()
-
- /**
- * Set the value of [app_overdue_percentage] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setAppOverduePercentage($v)
- {
+ $copyObj->setDelStarted($this->del_started);
- if ($this->app_overdue_percentage !== $v || $v === 0) {
- $this->app_overdue_percentage = $v;
- $this->modifiedColumns[] = AppDelegationPeer::APP_OVERDUE_PERCENTAGE;
- }
-
- } // setAppOverduePercentage()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->del_index = $rs->getInt($startcol + 1);
-
- $this->del_previous = $rs->getInt($startcol + 2);
-
- $this->pro_uid = $rs->getString($startcol + 3);
-
- $this->tas_uid = $rs->getString($startcol + 4);
-
- $this->usr_uid = $rs->getString($startcol + 5);
-
- $this->del_type = $rs->getString($startcol + 6);
-
- $this->del_thread = $rs->getInt($startcol + 7);
-
- $this->del_thread_status = $rs->getString($startcol + 8);
-
- $this->del_priority = $rs->getString($startcol + 9);
-
- $this->del_delegate_date = $rs->getTimestamp($startcol + 10, null);
-
- $this->del_init_date = $rs->getTimestamp($startcol + 11, null);
-
- $this->del_task_due_date = $rs->getTimestamp($startcol + 12, null);
-
- $this->del_finish_date = $rs->getTimestamp($startcol + 13, null);
-
- $this->del_duration = $rs->getFloat($startcol + 14);
-
- $this->del_queue_duration = $rs->getFloat($startcol + 15);
-
- $this->del_delay_duration = $rs->getFloat($startcol + 16);
-
- $this->del_started = $rs->getInt($startcol + 17);
-
- $this->del_finished = $rs->getInt($startcol + 18);
-
- $this->del_delayed = $rs->getInt($startcol + 19);
-
- $this->del_data = $rs->getString($startcol + 20);
-
- $this->app_overdue_percentage = $rs->getFloat($startcol + 21);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 22; // 22 = AppDelegationPeer::NUM_COLUMNS - AppDelegationPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppDelegation object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppDelegationPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppDelegationPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppDelegationPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppDelegationPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppDelegationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getDelIndex();
- break;
- case 2:
- return $this->getDelPrevious();
- break;
- case 3:
- return $this->getProUid();
- break;
- case 4:
- return $this->getTasUid();
- break;
- case 5:
- return $this->getUsrUid();
- break;
- case 6:
- return $this->getDelType();
- break;
- case 7:
- return $this->getDelThread();
- break;
- case 8:
- return $this->getDelThreadStatus();
- break;
- case 9:
- return $this->getDelPriority();
- break;
- case 10:
- return $this->getDelDelegateDate();
- break;
- case 11:
- return $this->getDelInitDate();
- break;
- case 12:
- return $this->getDelTaskDueDate();
- break;
- case 13:
- return $this->getDelFinishDate();
- break;
- case 14:
- return $this->getDelDuration();
- break;
- case 15:
- return $this->getDelQueueDuration();
- break;
- case 16:
- return $this->getDelDelayDuration();
- break;
- case 17:
- return $this->getDelStarted();
- break;
- case 18:
- return $this->getDelFinished();
- break;
- case 19:
- return $this->getDelDelayed();
- break;
- case 20:
- return $this->getDelData();
- break;
- case 21:
- return $this->getAppOverduePercentage();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppDelegationPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getDelIndex(),
- $keys[2] => $this->getDelPrevious(),
- $keys[3] => $this->getProUid(),
- $keys[4] => $this->getTasUid(),
- $keys[5] => $this->getUsrUid(),
- $keys[6] => $this->getDelType(),
- $keys[7] => $this->getDelThread(),
- $keys[8] => $this->getDelThreadStatus(),
- $keys[9] => $this->getDelPriority(),
- $keys[10] => $this->getDelDelegateDate(),
- $keys[11] => $this->getDelInitDate(),
- $keys[12] => $this->getDelTaskDueDate(),
- $keys[13] => $this->getDelFinishDate(),
- $keys[14] => $this->getDelDuration(),
- $keys[15] => $this->getDelQueueDuration(),
- $keys[16] => $this->getDelDelayDuration(),
- $keys[17] => $this->getDelStarted(),
- $keys[18] => $this->getDelFinished(),
- $keys[19] => $this->getDelDelayed(),
- $keys[20] => $this->getDelData(),
- $keys[21] => $this->getAppOverduePercentage(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppDelegationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setDelIndex($value);
- break;
- case 2:
- $this->setDelPrevious($value);
- break;
- case 3:
- $this->setProUid($value);
- break;
- case 4:
- $this->setTasUid($value);
- break;
- case 5:
- $this->setUsrUid($value);
- break;
- case 6:
- $this->setDelType($value);
- break;
- case 7:
- $this->setDelThread($value);
- break;
- case 8:
- $this->setDelThreadStatus($value);
- break;
- case 9:
- $this->setDelPriority($value);
- break;
- case 10:
- $this->setDelDelegateDate($value);
- break;
- case 11:
- $this->setDelInitDate($value);
- break;
- case 12:
- $this->setDelTaskDueDate($value);
- break;
- case 13:
- $this->setDelFinishDate($value);
- break;
- case 14:
- $this->setDelDuration($value);
- break;
- case 15:
- $this->setDelQueueDuration($value);
- break;
- case 16:
- $this->setDelDelayDuration($value);
- break;
- case 17:
- $this->setDelStarted($value);
- break;
- case 18:
- $this->setDelFinished($value);
- break;
- case 19:
- $this->setDelDelayed($value);
- break;
- case 20:
- $this->setDelData($value);
- break;
- case 21:
- $this->setAppOverduePercentage($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppDelegationPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDelIndex($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setDelPrevious($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setProUid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setTasUid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setUsrUid($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setDelType($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setDelThread($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setDelThreadStatus($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setDelPriority($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setDelDelegateDate($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setDelInitDate($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setDelTaskDueDate($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setDelFinishDate($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setDelDuration($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setDelQueueDuration($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setDelDelayDuration($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setDelStarted($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setDelFinished($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setDelDelayed($arr[$keys[19]]);
- if (array_key_exists($keys[20], $arr)) $this->setDelData($arr[$keys[20]]);
- if (array_key_exists($keys[21], $arr)) $this->setAppOverduePercentage($arr[$keys[21]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppDelegationPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppDelegationPeer::APP_UID)) $criteria->add(AppDelegationPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppDelegationPeer::DEL_INDEX)) $criteria->add(AppDelegationPeer::DEL_INDEX, $this->del_index);
- if ($this->isColumnModified(AppDelegationPeer::DEL_PREVIOUS)) $criteria->add(AppDelegationPeer::DEL_PREVIOUS, $this->del_previous);
- if ($this->isColumnModified(AppDelegationPeer::PRO_UID)) $criteria->add(AppDelegationPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(AppDelegationPeer::TAS_UID)) $criteria->add(AppDelegationPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(AppDelegationPeer::USR_UID)) $criteria->add(AppDelegationPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(AppDelegationPeer::DEL_TYPE)) $criteria->add(AppDelegationPeer::DEL_TYPE, $this->del_type);
- if ($this->isColumnModified(AppDelegationPeer::DEL_THREAD)) $criteria->add(AppDelegationPeer::DEL_THREAD, $this->del_thread);
- if ($this->isColumnModified(AppDelegationPeer::DEL_THREAD_STATUS)) $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, $this->del_thread_status);
- if ($this->isColumnModified(AppDelegationPeer::DEL_PRIORITY)) $criteria->add(AppDelegationPeer::DEL_PRIORITY, $this->del_priority);
- if ($this->isColumnModified(AppDelegationPeer::DEL_DELEGATE_DATE)) $criteria->add(AppDelegationPeer::DEL_DELEGATE_DATE, $this->del_delegate_date);
- if ($this->isColumnModified(AppDelegationPeer::DEL_INIT_DATE)) $criteria->add(AppDelegationPeer::DEL_INIT_DATE, $this->del_init_date);
- if ($this->isColumnModified(AppDelegationPeer::DEL_TASK_DUE_DATE)) $criteria->add(AppDelegationPeer::DEL_TASK_DUE_DATE, $this->del_task_due_date);
- if ($this->isColumnModified(AppDelegationPeer::DEL_FINISH_DATE)) $criteria->add(AppDelegationPeer::DEL_FINISH_DATE, $this->del_finish_date);
- if ($this->isColumnModified(AppDelegationPeer::DEL_DURATION)) $criteria->add(AppDelegationPeer::DEL_DURATION, $this->del_duration);
- if ($this->isColumnModified(AppDelegationPeer::DEL_QUEUE_DURATION)) $criteria->add(AppDelegationPeer::DEL_QUEUE_DURATION, $this->del_queue_duration);
- if ($this->isColumnModified(AppDelegationPeer::DEL_DELAY_DURATION)) $criteria->add(AppDelegationPeer::DEL_DELAY_DURATION, $this->del_delay_duration);
- if ($this->isColumnModified(AppDelegationPeer::DEL_STARTED)) $criteria->add(AppDelegationPeer::DEL_STARTED, $this->del_started);
- if ($this->isColumnModified(AppDelegationPeer::DEL_FINISHED)) $criteria->add(AppDelegationPeer::DEL_FINISHED, $this->del_finished);
- if ($this->isColumnModified(AppDelegationPeer::DEL_DELAYED)) $criteria->add(AppDelegationPeer::DEL_DELAYED, $this->del_delayed);
- if ($this->isColumnModified(AppDelegationPeer::DEL_DATA)) $criteria->add(AppDelegationPeer::DEL_DATA, $this->del_data);
- if ($this->isColumnModified(AppDelegationPeer::APP_OVERDUE_PERCENTAGE)) $criteria->add(AppDelegationPeer::APP_OVERDUE_PERCENTAGE, $this->app_overdue_percentage);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppDelegationPeer::DATABASE_NAME);
-
- $criteria->add(AppDelegationPeer::APP_UID, $this->app_uid);
- $criteria->add(AppDelegationPeer::DEL_INDEX, $this->del_index);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getAppUid();
-
- $pks[1] = $this->getDelIndex();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setAppUid($keys[0]);
-
- $this->setDelIndex($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppDelegation (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setDelPrevious($this->del_previous);
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setDelType($this->del_type);
-
- $copyObj->setDelThread($this->del_thread);
-
- $copyObj->setDelThreadStatus($this->del_thread_status);
-
- $copyObj->setDelPriority($this->del_priority);
-
- $copyObj->setDelDelegateDate($this->del_delegate_date);
-
- $copyObj->setDelInitDate($this->del_init_date);
-
- $copyObj->setDelTaskDueDate($this->del_task_due_date);
+ $copyObj->setDelFinished($this->del_finished);
- $copyObj->setDelFinishDate($this->del_finish_date);
+ $copyObj->setDelDelayed($this->del_delayed);
- $copyObj->setDelDuration($this->del_duration);
+ $copyObj->setDelData($this->del_data);
- $copyObj->setDelQueueDuration($this->del_queue_duration);
+ $copyObj->setAppOverduePercentage($this->app_overdue_percentage);
- $copyObj->setDelDelayDuration($this->del_delay_duration);
- $copyObj->setDelStarted($this->del_started);
+ $copyObj->setNew(true);
- $copyObj->setDelFinished($this->del_finished);
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
- $copyObj->setDelDelayed($this->del_delayed);
+ $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
- $copyObj->setDelData($this->del_data);
+ }
- $copyObj->setAppOverduePercentage($this->app_overdue_percentage);
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppDelegation Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppDelegationPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppDelegationPeer();
+ }
+ return self::$peer;
+ }
+}
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppDelegation Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppDelegationPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppDelegationPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppDelegation
diff --git a/workflow/engine/classes/model/om/BaseAppDelegationPeer.php b/workflow/engine/classes/model/om/BaseAppDelegationPeer.php
index e3bcb511c..23cac59ad 100755
--- a/workflow/engine/classes/model/om/BaseAppDelegationPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppDelegationPeer.php
@@ -12,659 +12,660 @@ include_once 'classes/model/AppDelegation.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppDelegationPeer {
+abstract class BaseAppDelegationPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'APP_DELEGATION';
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_DELEGATION';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppDelegation';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppDelegation';
- /** The total number of columns. */
- const NUM_COLUMNS = 22;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 22;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_DELEGATION.APP_UID';
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_DELEGATION.APP_UID';
- /** the column name for the DEL_INDEX field */
- const DEL_INDEX = 'APP_DELEGATION.DEL_INDEX';
+ /** the column name for the DEL_INDEX field */
+ const DEL_INDEX = 'APP_DELEGATION.DEL_INDEX';
- /** the column name for the DEL_PREVIOUS field */
- const DEL_PREVIOUS = 'APP_DELEGATION.DEL_PREVIOUS';
+ /** the column name for the DEL_PREVIOUS field */
+ const DEL_PREVIOUS = 'APP_DELEGATION.DEL_PREVIOUS';
- /** the column name for the PRO_UID field */
- const PRO_UID = 'APP_DELEGATION.PRO_UID';
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'APP_DELEGATION.PRO_UID';
- /** the column name for the TAS_UID field */
- const TAS_UID = 'APP_DELEGATION.TAS_UID';
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'APP_DELEGATION.TAS_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'APP_DELEGATION.USR_UID';
+
+ /** the column name for the DEL_TYPE field */
+ const DEL_TYPE = 'APP_DELEGATION.DEL_TYPE';
+
+ /** the column name for the DEL_THREAD field */
+ const DEL_THREAD = 'APP_DELEGATION.DEL_THREAD';
+
+ /** the column name for the DEL_THREAD_STATUS field */
+ const DEL_THREAD_STATUS = 'APP_DELEGATION.DEL_THREAD_STATUS';
+
+ /** the column name for the DEL_PRIORITY field */
+ const DEL_PRIORITY = 'APP_DELEGATION.DEL_PRIORITY';
+
+ /** the column name for the DEL_DELEGATE_DATE field */
+ const DEL_DELEGATE_DATE = 'APP_DELEGATION.DEL_DELEGATE_DATE';
+
+ /** the column name for the DEL_INIT_DATE field */
+ const DEL_INIT_DATE = 'APP_DELEGATION.DEL_INIT_DATE';
+
+ /** the column name for the DEL_TASK_DUE_DATE field */
+ const DEL_TASK_DUE_DATE = 'APP_DELEGATION.DEL_TASK_DUE_DATE';
+
+ /** the column name for the DEL_FINISH_DATE field */
+ const DEL_FINISH_DATE = 'APP_DELEGATION.DEL_FINISH_DATE';
+
+ /** the column name for the DEL_DURATION field */
+ const DEL_DURATION = 'APP_DELEGATION.DEL_DURATION';
+
+ /** the column name for the DEL_QUEUE_DURATION field */
+ const DEL_QUEUE_DURATION = 'APP_DELEGATION.DEL_QUEUE_DURATION';
+
+ /** the column name for the DEL_DELAY_DURATION field */
+ const DEL_DELAY_DURATION = 'APP_DELEGATION.DEL_DELAY_DURATION';
+
+ /** the column name for the DEL_STARTED field */
+ const DEL_STARTED = 'APP_DELEGATION.DEL_STARTED';
+
+ /** the column name for the DEL_FINISHED field */
+ const DEL_FINISHED = 'APP_DELEGATION.DEL_FINISHED';
+
+ /** the column name for the DEL_DELAYED field */
+ const DEL_DELAYED = 'APP_DELEGATION.DEL_DELAYED';
+
+ /** the column name for the DEL_DATA field */
+ const DEL_DATA = 'APP_DELEGATION.DEL_DATA';
+
+ /** the column name for the APP_OVERDUE_PERCENTAGE field */
+ const APP_OVERDUE_PERCENTAGE = 'APP_DELEGATION.APP_OVERDUE_PERCENTAGE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'DelPrevious', 'ProUid', 'TasUid', 'UsrUid', 'DelType', 'DelThread', 'DelThreadStatus', 'DelPriority', 'DelDelegateDate', 'DelInitDate', 'DelTaskDueDate', 'DelFinishDate', 'DelDuration', 'DelQueueDuration', 'DelDelayDuration', 'DelStarted', 'DelFinished', 'DelDelayed', 'DelData', 'AppOverduePercentage', ),
+ BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID, AppDelegationPeer::DEL_INDEX, AppDelegationPeer::DEL_PREVIOUS, AppDelegationPeer::PRO_UID, AppDelegationPeer::TAS_UID, AppDelegationPeer::USR_UID, AppDelegationPeer::DEL_TYPE, AppDelegationPeer::DEL_THREAD, AppDelegationPeer::DEL_THREAD_STATUS, AppDelegationPeer::DEL_PRIORITY, AppDelegationPeer::DEL_DELEGATE_DATE, AppDelegationPeer::DEL_INIT_DATE, AppDelegationPeer::DEL_TASK_DUE_DATE, AppDelegationPeer::DEL_FINISH_DATE, AppDelegationPeer::DEL_DURATION, AppDelegationPeer::DEL_QUEUE_DURATION, AppDelegationPeer::DEL_DELAY_DURATION, AppDelegationPeer::DEL_STARTED, AppDelegationPeer::DEL_FINISHED, AppDelegationPeer::DEL_DELAYED, AppDelegationPeer::DEL_DATA, AppDelegationPeer::APP_OVERDUE_PERCENTAGE, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'DEL_PREVIOUS', 'PRO_UID', 'TAS_UID', 'USR_UID', 'DEL_TYPE', 'DEL_THREAD', 'DEL_THREAD_STATUS', 'DEL_PRIORITY', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_TASK_DUE_DATE', 'DEL_FINISH_DATE', 'DEL_DURATION', 'DEL_QUEUE_DURATION', 'DEL_DELAY_DURATION', 'DEL_STARTED', 'DEL_FINISHED', 'DEL_DELAYED', 'DEL_DATA', 'APP_OVERDUE_PERCENTAGE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'DelPrevious' => 2, 'ProUid' => 3, 'TasUid' => 4, 'UsrUid' => 5, 'DelType' => 6, 'DelThread' => 7, 'DelThreadStatus' => 8, 'DelPriority' => 9, 'DelDelegateDate' => 10, 'DelInitDate' => 11, 'DelTaskDueDate' => 12, 'DelFinishDate' => 13, 'DelDuration' => 14, 'DelQueueDuration' => 15, 'DelDelayDuration' => 16, 'DelStarted' => 17, 'DelFinished' => 18, 'DelDelayed' => 19, 'DelData' => 20, 'AppOverduePercentage' => 21, ),
+ BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID => 0, AppDelegationPeer::DEL_INDEX => 1, AppDelegationPeer::DEL_PREVIOUS => 2, AppDelegationPeer::PRO_UID => 3, AppDelegationPeer::TAS_UID => 4, AppDelegationPeer::USR_UID => 5, AppDelegationPeer::DEL_TYPE => 6, AppDelegationPeer::DEL_THREAD => 7, AppDelegationPeer::DEL_THREAD_STATUS => 8, AppDelegationPeer::DEL_PRIORITY => 9, AppDelegationPeer::DEL_DELEGATE_DATE => 10, AppDelegationPeer::DEL_INIT_DATE => 11, AppDelegationPeer::DEL_TASK_DUE_DATE => 12, AppDelegationPeer::DEL_FINISH_DATE => 13, AppDelegationPeer::DEL_DURATION => 14, AppDelegationPeer::DEL_QUEUE_DURATION => 15, AppDelegationPeer::DEL_DELAY_DURATION => 16, AppDelegationPeer::DEL_STARTED => 17, AppDelegationPeer::DEL_FINISHED => 18, AppDelegationPeer::DEL_DELAYED => 19, AppDelegationPeer::DEL_DATA => 20, AppDelegationPeer::APP_OVERDUE_PERCENTAGE => 21, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'DEL_PREVIOUS' => 2, 'PRO_UID' => 3, 'TAS_UID' => 4, 'USR_UID' => 5, 'DEL_TYPE' => 6, 'DEL_THREAD' => 7, 'DEL_THREAD_STATUS' => 8, 'DEL_PRIORITY' => 9, 'DEL_DELEGATE_DATE' => 10, 'DEL_INIT_DATE' => 11, 'DEL_TASK_DUE_DATE' => 12, 'DEL_FINISH_DATE' => 13, 'DEL_DURATION' => 14, 'DEL_QUEUE_DURATION' => 15, 'DEL_DELAY_DURATION' => 16, 'DEL_STARTED' => 17, 'DEL_FINISHED' => 18, 'DEL_DELAYED' => 19, 'DEL_DATA' => 20, 'APP_OVERDUE_PERCENTAGE' => 21, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppDelegationMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppDelegationMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppDelegationPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppDelegationPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppDelegationPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppDelegationPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
+
+ $criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
+
+ $criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
+
+ $criteria->addSelectColumn(AppDelegationPeer::USR_UID);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_TYPE);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_THREAD);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_THREAD_STATUS);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_PRIORITY);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_DURATION);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_STARTED);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
+
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_DATA);
+
+ $criteria->addSelectColumn(AppDelegationPeer::APP_OVERDUE_PERCENTAGE);
+
+ }
+
+ const COUNT = 'COUNT(APP_DELEGATION.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_DELEGATION.APP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppDelegationPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppDelegationPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppDelegationPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppDelegation
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppDelegationPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppDelegationPeer::populateObjects(AppDelegationPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppDelegationPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppDelegationPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppDelegationPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppDelegation or Criteria object.
+ *
+ * @param mixed $values Criteria or AppDelegation object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppDelegation object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppDelegation or Criteria object.
+ *
+ * @param mixed $values Criteria or AppDelegation object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppDelegationPeer::APP_UID);
+ $selectCriteria->add(AppDelegationPeer::APP_UID, $criteria->remove(AppDelegationPeer::APP_UID), $comparison);
+
+ $comparison = $criteria->getComparison(AppDelegationPeer::DEL_INDEX);
+ $selectCriteria->add(AppDelegationPeer::DEL_INDEX, $criteria->remove(AppDelegationPeer::DEL_INDEX), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_DELEGATION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppDelegationPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppDelegation or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppDelegation object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppDelegation) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
+
+ $criteria->add(AppDelegationPeer::APP_UID, $vals[0], Criteria::IN);
+ $criteria->add(AppDelegationPeer::DEL_INDEX, $vals[1], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppDelegation object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppDelegation $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppDelegation $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppDelegationPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppDelegationPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDelegationPeer::DEL_TYPE))
+ $columns[AppDelegationPeer::DEL_TYPE] = $obj->getDelType();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDelegationPeer::DEL_PRIORITY))
+ $columns[AppDelegationPeer::DEL_PRIORITY] = $obj->getDelPriority();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDelegationPeer::DEL_THREAD_STATUS))
+ $columns[AppDelegationPeer::DEL_THREAD_STATUS] = $obj->getDelThreadStatus();
+
+ }
+
+ return BasePeer::doValidate(AppDelegationPeer::DATABASE_NAME, AppDelegationPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $app_uid
+ * @param int $del_index
+ * @param Connection $con
+ * @return AppDelegation
+ */
+ public static function retrieveByPK($app_uid, $del_index, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(AppDelegationPeer::APP_UID, $app_uid);
+ $criteria->add(AppDelegationPeer::DEL_INDEX, $del_index);
+ $v = AppDelegationPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- /** the column name for the USR_UID field */
- const USR_UID = 'APP_DELEGATION.USR_UID';
-
- /** the column name for the DEL_TYPE field */
- const DEL_TYPE = 'APP_DELEGATION.DEL_TYPE';
-
- /** the column name for the DEL_THREAD field */
- const DEL_THREAD = 'APP_DELEGATION.DEL_THREAD';
-
- /** the column name for the DEL_THREAD_STATUS field */
- const DEL_THREAD_STATUS = 'APP_DELEGATION.DEL_THREAD_STATUS';
-
- /** the column name for the DEL_PRIORITY field */
- const DEL_PRIORITY = 'APP_DELEGATION.DEL_PRIORITY';
-
- /** the column name for the DEL_DELEGATE_DATE field */
- const DEL_DELEGATE_DATE = 'APP_DELEGATION.DEL_DELEGATE_DATE';
-
- /** the column name for the DEL_INIT_DATE field */
- const DEL_INIT_DATE = 'APP_DELEGATION.DEL_INIT_DATE';
-
- /** the column name for the DEL_TASK_DUE_DATE field */
- const DEL_TASK_DUE_DATE = 'APP_DELEGATION.DEL_TASK_DUE_DATE';
-
- /** the column name for the DEL_FINISH_DATE field */
- const DEL_FINISH_DATE = 'APP_DELEGATION.DEL_FINISH_DATE';
-
- /** the column name for the DEL_DURATION field */
- const DEL_DURATION = 'APP_DELEGATION.DEL_DURATION';
-
- /** the column name for the DEL_QUEUE_DURATION field */
- const DEL_QUEUE_DURATION = 'APP_DELEGATION.DEL_QUEUE_DURATION';
-
- /** the column name for the DEL_DELAY_DURATION field */
- const DEL_DELAY_DURATION = 'APP_DELEGATION.DEL_DELAY_DURATION';
-
- /** the column name for the DEL_STARTED field */
- const DEL_STARTED = 'APP_DELEGATION.DEL_STARTED';
-
- /** the column name for the DEL_FINISHED field */
- const DEL_FINISHED = 'APP_DELEGATION.DEL_FINISHED';
-
- /** the column name for the DEL_DELAYED field */
- const DEL_DELAYED = 'APP_DELEGATION.DEL_DELAYED';
-
- /** the column name for the DEL_DATA field */
- const DEL_DATA = 'APP_DELEGATION.DEL_DATA';
-
- /** the column name for the APP_OVERDUE_PERCENTAGE field */
- const APP_OVERDUE_PERCENTAGE = 'APP_DELEGATION.APP_OVERDUE_PERCENTAGE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'DelPrevious', 'ProUid', 'TasUid', 'UsrUid', 'DelType', 'DelThread', 'DelThreadStatus', 'DelPriority', 'DelDelegateDate', 'DelInitDate', 'DelTaskDueDate', 'DelFinishDate', 'DelDuration', 'DelQueueDuration', 'DelDelayDuration', 'DelStarted', 'DelFinished', 'DelDelayed', 'DelData', 'AppOverduePercentage', ),
- BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID, AppDelegationPeer::DEL_INDEX, AppDelegationPeer::DEL_PREVIOUS, AppDelegationPeer::PRO_UID, AppDelegationPeer::TAS_UID, AppDelegationPeer::USR_UID, AppDelegationPeer::DEL_TYPE, AppDelegationPeer::DEL_THREAD, AppDelegationPeer::DEL_THREAD_STATUS, AppDelegationPeer::DEL_PRIORITY, AppDelegationPeer::DEL_DELEGATE_DATE, AppDelegationPeer::DEL_INIT_DATE, AppDelegationPeer::DEL_TASK_DUE_DATE, AppDelegationPeer::DEL_FINISH_DATE, AppDelegationPeer::DEL_DURATION, AppDelegationPeer::DEL_QUEUE_DURATION, AppDelegationPeer::DEL_DELAY_DURATION, AppDelegationPeer::DEL_STARTED, AppDelegationPeer::DEL_FINISHED, AppDelegationPeer::DEL_DELAYED, AppDelegationPeer::DEL_DATA, AppDelegationPeer::APP_OVERDUE_PERCENTAGE, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'DEL_PREVIOUS', 'PRO_UID', 'TAS_UID', 'USR_UID', 'DEL_TYPE', 'DEL_THREAD', 'DEL_THREAD_STATUS', 'DEL_PRIORITY', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_TASK_DUE_DATE', 'DEL_FINISH_DATE', 'DEL_DURATION', 'DEL_QUEUE_DURATION', 'DEL_DELAY_DURATION', 'DEL_STARTED', 'DEL_FINISHED', 'DEL_DELAYED', 'DEL_DATA', 'APP_OVERDUE_PERCENTAGE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'DelPrevious' => 2, 'ProUid' => 3, 'TasUid' => 4, 'UsrUid' => 5, 'DelType' => 6, 'DelThread' => 7, 'DelThreadStatus' => 8, 'DelPriority' => 9, 'DelDelegateDate' => 10, 'DelInitDate' => 11, 'DelTaskDueDate' => 12, 'DelFinishDate' => 13, 'DelDuration' => 14, 'DelQueueDuration' => 15, 'DelDelayDuration' => 16, 'DelStarted' => 17, 'DelFinished' => 18, 'DelDelayed' => 19, 'DelData' => 20, 'AppOverduePercentage' => 21, ),
- BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID => 0, AppDelegationPeer::DEL_INDEX => 1, AppDelegationPeer::DEL_PREVIOUS => 2, AppDelegationPeer::PRO_UID => 3, AppDelegationPeer::TAS_UID => 4, AppDelegationPeer::USR_UID => 5, AppDelegationPeer::DEL_TYPE => 6, AppDelegationPeer::DEL_THREAD => 7, AppDelegationPeer::DEL_THREAD_STATUS => 8, AppDelegationPeer::DEL_PRIORITY => 9, AppDelegationPeer::DEL_DELEGATE_DATE => 10, AppDelegationPeer::DEL_INIT_DATE => 11, AppDelegationPeer::DEL_TASK_DUE_DATE => 12, AppDelegationPeer::DEL_FINISH_DATE => 13, AppDelegationPeer::DEL_DURATION => 14, AppDelegationPeer::DEL_QUEUE_DURATION => 15, AppDelegationPeer::DEL_DELAY_DURATION => 16, AppDelegationPeer::DEL_STARTED => 17, AppDelegationPeer::DEL_FINISHED => 18, AppDelegationPeer::DEL_DELAYED => 19, AppDelegationPeer::DEL_DATA => 20, AppDelegationPeer::APP_OVERDUE_PERCENTAGE => 21, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'DEL_PREVIOUS' => 2, 'PRO_UID' => 3, 'TAS_UID' => 4, 'USR_UID' => 5, 'DEL_TYPE' => 6, 'DEL_THREAD' => 7, 'DEL_THREAD_STATUS' => 8, 'DEL_PRIORITY' => 9, 'DEL_DELEGATE_DATE' => 10, 'DEL_INIT_DATE' => 11, 'DEL_TASK_DUE_DATE' => 12, 'DEL_FINISH_DATE' => 13, 'DEL_DURATION' => 14, 'DEL_QUEUE_DURATION' => 15, 'DEL_DELAY_DURATION' => 16, 'DEL_STARTED' => 17, 'DEL_FINISHED' => 18, 'DEL_DELAYED' => 19, 'DEL_DATA' => 20, 'APP_OVERDUE_PERCENTAGE' => 21, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppDelegationMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppDelegationMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppDelegationPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppDelegationPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppDelegationPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppDelegationPeer::APP_UID);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
-
- $criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
-
- $criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
-
- $criteria->addSelectColumn(AppDelegationPeer::USR_UID);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_TYPE);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_THREAD);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_THREAD_STATUS);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_PRIORITY);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_DURATION);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_STARTED);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
-
- $criteria->addSelectColumn(AppDelegationPeer::DEL_DATA);
-
- $criteria->addSelectColumn(AppDelegationPeer::APP_OVERDUE_PERCENTAGE);
-
- }
-
- const COUNT = 'COUNT(APP_DELEGATION.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_DELEGATION.APP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppDelegationPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppDelegationPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppDelegationPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppDelegation
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppDelegationPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppDelegationPeer::populateObjects(AppDelegationPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppDelegationPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppDelegationPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppDelegationPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppDelegation or Criteria object.
- *
- * @param mixed $values Criteria or AppDelegation object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppDelegation object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppDelegation or Criteria object.
- *
- * @param mixed $values Criteria or AppDelegation object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppDelegationPeer::APP_UID);
- $selectCriteria->add(AppDelegationPeer::APP_UID, $criteria->remove(AppDelegationPeer::APP_UID), $comparison);
-
- $comparison = $criteria->getComparison(AppDelegationPeer::DEL_INDEX);
- $selectCriteria->add(AppDelegationPeer::DEL_INDEX, $criteria->remove(AppDelegationPeer::DEL_INDEX), $comparison);
-
- } else { // $values is AppDelegation object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_DELEGATION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppDelegationPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppDelegation or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppDelegation object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppDelegation) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
-
- $criteria->add(AppDelegationPeer::APP_UID, $vals[0], Criteria::IN);
- $criteria->add(AppDelegationPeer::DEL_INDEX, $vals[1], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppDelegation object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppDelegation $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppDelegation $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppDelegationPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppDelegationPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(AppDelegationPeer::DEL_TYPE))
- $columns[AppDelegationPeer::DEL_TYPE] = $obj->getDelType();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDelegationPeer::DEL_PRIORITY))
- $columns[AppDelegationPeer::DEL_PRIORITY] = $obj->getDelPriority();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDelegationPeer::DEL_THREAD_STATUS))
- $columns[AppDelegationPeer::DEL_THREAD_STATUS] = $obj->getDelThreadStatus();
-
- }
-
- return BasePeer::doValidate(AppDelegationPeer::DATABASE_NAME, AppDelegationPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $app_uid
- @param int $del_index
-
- * @param Connection $con
- * @return AppDelegation
- */
- public static function retrieveByPK( $app_uid, $del_index, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(AppDelegationPeer::APP_UID, $app_uid);
- $criteria->add(AppDelegationPeer::DEL_INDEX, $del_index);
- $v = AppDelegationPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseAppDelegationPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppDelegationPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppDelegationPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppDelegationMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppDelegationMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppDelegationMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppDelegationMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppDocument.php b/workflow/engine/classes/model/om/BaseAppDocument.php
index 77466611f..35147cc42 100755
--- a/workflow/engine/classes/model/om/BaseAppDocument.php
+++ b/workflow/engine/classes/model/om/BaseAppDocument.php
@@ -16,1234 +16,1367 @@ include_once 'classes/model/AppDocumentPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppDocument extends BaseObject implements Persistent {
+abstract class BaseAppDocument extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppDocumentPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_doc_uid field.
+ * @var string
+ */
+ protected $app_doc_uid = '';
+
+ /**
+ * The value for the doc_version field.
+ * @var int
+ */
+ protected $doc_version = 1;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the del_index field.
+ * @var int
+ */
+ protected $del_index = 0;
+
+ /**
+ * The value for the doc_uid field.
+ * @var string
+ */
+ protected $doc_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the app_doc_type field.
+ * @var string
+ */
+ protected $app_doc_type = '';
+
+ /**
+ * The value for the app_doc_create_date field.
+ * @var int
+ */
+ protected $app_doc_create_date;
+
+ /**
+ * The value for the app_doc_index field.
+ * @var int
+ */
+ protected $app_doc_index;
+
+ /**
+ * The value for the folder_uid field.
+ * @var string
+ */
+ protected $folder_uid = '';
+
+ /**
+ * The value for the app_doc_plugin field.
+ * @var string
+ */
+ protected $app_doc_plugin = '';
+
+ /**
+ * The value for the app_doc_tags field.
+ * @var string
+ */
+ protected $app_doc_tags;
+
+ /**
+ * The value for the app_doc_status field.
+ * @var string
+ */
+ protected $app_doc_status = 'ACTIVE';
+
+ /**
+ * The value for the app_doc_status_date field.
+ * @var int
+ */
+ protected $app_doc_status_date;
+
+ /**
+ * The value for the app_doc_fieldname field.
+ * @var string
+ */
+ protected $app_doc_fieldname;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_doc_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppDocUid()
+ {
+
+ return $this->app_doc_uid;
+ }
+
+ /**
+ * Get the [doc_version] column value.
+ *
+ * @return int
+ */
+ public function getDocVersion()
+ {
+
+ return $this->doc_version;
+ }
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [del_index] column value.
+ *
+ * @return int
+ */
+ public function getDelIndex()
+ {
+
+ return $this->del_index;
+ }
+
+ /**
+ * Get the [doc_uid] column value.
+ *
+ * @return string
+ */
+ public function getDocUid()
+ {
+
+ return $this->doc_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [app_doc_type] column value.
+ *
+ * @return string
+ */
+ public function getAppDocType()
+ {
+
+ return $this->app_doc_type;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_doc_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppDocCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_doc_create_date === null || $this->app_doc_create_date === '') {
+ return null;
+ } elseif (!is_int($this->app_doc_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_doc_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_doc_create_date] as date/time value: " .
+ var_export($this->app_doc_create_date, true));
+ }
+ } else {
+ $ts = $this->app_doc_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_doc_index] column value.
+ *
+ * @return int
+ */
+ public function getAppDocIndex()
+ {
+
+ return $this->app_doc_index;
+ }
+
+ /**
+ * Get the [folder_uid] column value.
+ *
+ * @return string
+ */
+ public function getFolderUid()
+ {
+
+ return $this->folder_uid;
+ }
+
+ /**
+ * Get the [app_doc_plugin] column value.
+ *
+ * @return string
+ */
+ public function getAppDocPlugin()
+ {
+
+ return $this->app_doc_plugin;
+ }
+
+ /**
+ * Get the [app_doc_tags] column value.
+ *
+ * @return string
+ */
+ public function getAppDocTags()
+ {
+
+ return $this->app_doc_tags;
+ }
+
+ /**
+ * Get the [app_doc_status] column value.
+ *
+ * @return string
+ */
+ public function getAppDocStatus()
+ {
+
+ return $this->app_doc_status;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_doc_status_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppDocStatusDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_doc_status_date === null || $this->app_doc_status_date === '') {
+ return null;
+ } elseif (!is_int($this->app_doc_status_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_doc_status_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_doc_status_date] as date/time value: " .
+ var_export($this->app_doc_status_date, true));
+ }
+ } else {
+ $ts = $this->app_doc_status_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_doc_fieldname] column value.
+ *
+ * @return string
+ */
+ public function getAppDocFieldname()
+ {
+
+ return $this->app_doc_fieldname;
+ }
+
+ /**
+ * Set the value of [app_doc_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDocUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_doc_uid !== $v || $v === '') {
+ $this->app_doc_uid = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_UID;
+ }
+
+ } // setAppDocUid()
+
+ /**
+ * Set the value of [doc_version] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDocVersion($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->doc_version !== $v || $v === 1) {
+ $this->doc_version = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::DOC_VERSION;
+ }
+
+ } // setDocVersion()
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndex($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->del_index !== $v || $v === 0) {
+ $this->del_index = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::DEL_INDEX;
+ }
+
+ } // setDelIndex()
+
+ /**
+ * Set the value of [doc_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDocUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->doc_uid !== $v || $v === '') {
+ $this->doc_uid = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::DOC_UID;
+ }
+
+ } // setDocUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [app_doc_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDocType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_doc_type !== $v || $v === '') {
+ $this->app_doc_type = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_TYPE;
+ }
+
+ } // setAppDocType()
+
+ /**
+ * Set the value of [app_doc_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppDocCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_doc_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_doc_create_date !== $ts) {
+ $this->app_doc_create_date = $ts;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_CREATE_DATE;
+ }
+
+ } // setAppDocCreateDate()
+
+ /**
+ * Set the value of [app_doc_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppDocIndex($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->app_doc_index !== $v) {
+ $this->app_doc_index = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_INDEX;
+ }
+
+ } // setAppDocIndex()
+
+ /**
+ * Set the value of [folder_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFolderUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->folder_uid !== $v || $v === '') {
+ $this->folder_uid = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::FOLDER_UID;
+ }
+
+ } // setFolderUid()
+
+ /**
+ * Set the value of [app_doc_plugin] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDocPlugin($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_doc_plugin !== $v || $v === '') {
+ $this->app_doc_plugin = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_PLUGIN;
+ }
+
+ } // setAppDocPlugin()
+
+ /**
+ * Set the value of [app_doc_tags] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDocTags($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_doc_tags !== $v) {
+ $this->app_doc_tags = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_TAGS;
+ }
+
+ } // setAppDocTags()
+
+ /**
+ * Set the value of [app_doc_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDocStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_doc_status !== $v || $v === 'ACTIVE') {
+ $this->app_doc_status = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_STATUS;
+ }
+
+ } // setAppDocStatus()
+
+ /**
+ * Set the value of [app_doc_status_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppDocStatusDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_doc_status_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_doc_status_date !== $ts) {
+ $this->app_doc_status_date = $ts;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_STATUS_DATE;
+ }
+
+ } // setAppDocStatusDate()
+
+ /**
+ * Set the value of [app_doc_fieldname] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppDocFieldname($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_doc_fieldname !== $v) {
+ $this->app_doc_fieldname = $v;
+ $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_FIELDNAME;
+ }
+
+ } // setAppDocFieldname()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_doc_uid = $rs->getString($startcol + 0);
+
+ $this->doc_version = $rs->getInt($startcol + 1);
+
+ $this->app_uid = $rs->getString($startcol + 2);
+
+ $this->del_index = $rs->getInt($startcol + 3);
+
+ $this->doc_uid = $rs->getString($startcol + 4);
+
+ $this->usr_uid = $rs->getString($startcol + 5);
+
+ $this->app_doc_type = $rs->getString($startcol + 6);
+
+ $this->app_doc_create_date = $rs->getTimestamp($startcol + 7, null);
+
+ $this->app_doc_index = $rs->getInt($startcol + 8);
+
+ $this->folder_uid = $rs->getString($startcol + 9);
+
+ $this->app_doc_plugin = $rs->getString($startcol + 10);
+
+ $this->app_doc_tags = $rs->getString($startcol + 11);
+
+ $this->app_doc_status = $rs->getString($startcol + 12);
+
+ $this->app_doc_status_date = $rs->getTimestamp($startcol + 13, null);
+
+ $this->app_doc_fieldname = $rs->getString($startcol + 14);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 15; // 15 = AppDocumentPeer::NUM_COLUMNS - AppDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppDocument object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppDocumentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppDocumentPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppDocumentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppDocumentPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppDocumentPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppDocumentPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppDocUid();
+ break;
+ case 1:
+ return $this->getDocVersion();
+ break;
+ case 2:
+ return $this->getAppUid();
+ break;
+ case 3:
+ return $this->getDelIndex();
+ break;
+ case 4:
+ return $this->getDocUid();
+ break;
+ case 5:
+ return $this->getUsrUid();
+ break;
+ case 6:
+ return $this->getAppDocType();
+ break;
+ case 7:
+ return $this->getAppDocCreateDate();
+ break;
+ case 8:
+ return $this->getAppDocIndex();
+ break;
+ case 9:
+ return $this->getFolderUid();
+ break;
+ case 10:
+ return $this->getAppDocPlugin();
+ break;
+ case 11:
+ return $this->getAppDocTags();
+ break;
+ case 12:
+ return $this->getAppDocStatus();
+ break;
+ case 13:
+ return $this->getAppDocStatusDate();
+ break;
+ case 14:
+ return $this->getAppDocFieldname();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppDocumentPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppDocUid(),
+ $keys[1] => $this->getDocVersion(),
+ $keys[2] => $this->getAppUid(),
+ $keys[3] => $this->getDelIndex(),
+ $keys[4] => $this->getDocUid(),
+ $keys[5] => $this->getUsrUid(),
+ $keys[6] => $this->getAppDocType(),
+ $keys[7] => $this->getAppDocCreateDate(),
+ $keys[8] => $this->getAppDocIndex(),
+ $keys[9] => $this->getFolderUid(),
+ $keys[10] => $this->getAppDocPlugin(),
+ $keys[11] => $this->getAppDocTags(),
+ $keys[12] => $this->getAppDocStatus(),
+ $keys[13] => $this->getAppDocStatusDate(),
+ $keys[14] => $this->getAppDocFieldname(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppDocUid($value);
+ break;
+ case 1:
+ $this->setDocVersion($value);
+ break;
+ case 2:
+ $this->setAppUid($value);
+ break;
+ case 3:
+ $this->setDelIndex($value);
+ break;
+ case 4:
+ $this->setDocUid($value);
+ break;
+ case 5:
+ $this->setUsrUid($value);
+ break;
+ case 6:
+ $this->setAppDocType($value);
+ break;
+ case 7:
+ $this->setAppDocCreateDate($value);
+ break;
+ case 8:
+ $this->setAppDocIndex($value);
+ break;
+ case 9:
+ $this->setFolderUid($value);
+ break;
+ case 10:
+ $this->setAppDocPlugin($value);
+ break;
+ case 11:
+ $this->setAppDocTags($value);
+ break;
+ case 12:
+ $this->setAppDocStatus($value);
+ break;
+ case 13:
+ $this->setAppDocStatusDate($value);
+ break;
+ case 14:
+ $this->setAppDocFieldname($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppDocumentPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppDocUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDocVersion($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setAppUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDelIndex($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setDocUid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setUsrUid($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setAppDocType($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setAppDocCreateDate($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setAppDocIndex($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setFolderUid($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setAppDocPlugin($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setAppDocTags($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setAppDocStatus($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setAppDocStatusDate($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setAppDocFieldname($arr[$keys[14]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppDocumentPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_UID)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_UID, $this->app_doc_uid);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::DOC_VERSION)) {
+ $criteria->add(AppDocumentPeer::DOC_VERSION, $this->doc_version);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::APP_UID)) {
+ $criteria->add(AppDocumentPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::DEL_INDEX)) {
+ $criteria->add(AppDocumentPeer::DEL_INDEX, $this->del_index);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::DOC_UID)) {
+ $criteria->add(AppDocumentPeer::DOC_UID, $this->doc_uid);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::USR_UID)) {
+ $criteria->add(AppDocumentPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_TYPE)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_TYPE, $this->app_doc_type);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_CREATE_DATE)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_CREATE_DATE, $this->app_doc_create_date);
+ }
+
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_INDEX)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_INDEX, $this->app_doc_index);
+ }
+ if ($this->isColumnModified(AppDocumentPeer::FOLDER_UID)) {
+ $criteria->add(AppDocumentPeer::FOLDER_UID, $this->folder_uid);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppDocumentPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_PLUGIN)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_PLUGIN, $this->app_doc_plugin);
+ }
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_TAGS)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_TAGS, $this->app_doc_tags);
+ }
- /**
- * The value for the app_doc_uid field.
- * @var string
- */
- protected $app_doc_uid = '';
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_STATUS)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_STATUS, $this->app_doc_status);
+ }
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_STATUS_DATE)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_STATUS_DATE, $this->app_doc_status_date);
+ }
- /**
- * The value for the doc_version field.
- * @var int
- */
- protected $doc_version = 1;
+ if ($this->isColumnModified(AppDocumentPeer::APP_DOC_FIELDNAME)) {
+ $criteria->add(AppDocumentPeer::APP_DOC_FIELDNAME, $this->app_doc_fieldname);
+ }
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppDocumentPeer::DATABASE_NAME);
- /**
- * The value for the del_index field.
- * @var int
- */
- protected $del_index = 0;
+ $criteria->add(AppDocumentPeer::APP_DOC_UID, $this->app_doc_uid);
+ $criteria->add(AppDocumentPeer::DOC_VERSION, $this->doc_version);
+ return $criteria;
+ }
- /**
- * The value for the doc_uid field.
- * @var string
- */
- protected $doc_uid = '';
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+ $pks[0] = $this->getAppDocUid();
+
+ $pks[1] = $this->getDocVersion();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
+ $this->setAppDocUid($keys[0]);
+
+ $this->setDocVersion($keys[1]);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppDocument (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
- /**
- * The value for the app_doc_type field.
- * @var string
- */
- protected $app_doc_type = '';
-
-
- /**
- * The value for the app_doc_create_date field.
- * @var int
- */
- protected $app_doc_create_date;
+ $copyObj->setAppUid($this->app_uid);
+ $copyObj->setDelIndex($this->del_index);
- /**
- * The value for the app_doc_index field.
- * @var int
- */
- protected $app_doc_index;
-
-
- /**
- * The value for the folder_uid field.
- * @var string
- */
- protected $folder_uid = '';
-
-
- /**
- * The value for the app_doc_plugin field.
- * @var string
- */
- protected $app_doc_plugin = '';
-
-
- /**
- * The value for the app_doc_tags field.
- * @var string
- */
- protected $app_doc_tags;
-
-
- /**
- * The value for the app_doc_status field.
- * @var string
- */
- protected $app_doc_status = 'ACTIVE';
-
-
- /**
- * The value for the app_doc_status_date field.
- * @var int
- */
- protected $app_doc_status_date;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_doc_uid] column value.
- *
- * @return string
- */
- public function getAppDocUid()
- {
-
- return $this->app_doc_uid;
- }
-
- /**
- * Get the [doc_version] column value.
- *
- * @return int
- */
- public function getDocVersion()
- {
-
- return $this->doc_version;
- }
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [del_index] column value.
- *
- * @return int
- */
- public function getDelIndex()
- {
-
- return $this->del_index;
- }
-
- /**
- * Get the [doc_uid] column value.
- *
- * @return string
- */
- public function getDocUid()
- {
-
- return $this->doc_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [app_doc_type] column value.
- *
- * @return string
- */
- public function getAppDocType()
- {
-
- return $this->app_doc_type;
- }
-
- /**
- * Get the [optionally formatted] [app_doc_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppDocCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_doc_create_date === null || $this->app_doc_create_date === '') {
- return null;
- } elseif (!is_int($this->app_doc_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_doc_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_doc_create_date] as date/time value: " . var_export($this->app_doc_create_date, true));
- }
- } else {
- $ts = $this->app_doc_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [app_doc_index] column value.
- *
- * @return int
- */
- public function getAppDocIndex()
- {
-
- return $this->app_doc_index;
- }
-
- /**
- * Get the [folder_uid] column value.
- *
- * @return string
- */
- public function getFolderUid()
- {
-
- return $this->folder_uid;
- }
-
- /**
- * Get the [app_doc_plugin] column value.
- *
- * @return string
- */
- public function getAppDocPlugin()
- {
-
- return $this->app_doc_plugin;
- }
-
- /**
- * Get the [app_doc_tags] column value.
- *
- * @return string
- */
- public function getAppDocTags()
- {
-
- return $this->app_doc_tags;
- }
-
- /**
- * Get the [app_doc_status] column value.
- *
- * @return string
- */
- public function getAppDocStatus()
- {
-
- return $this->app_doc_status;
- }
-
- /**
- * Get the [optionally formatted] [app_doc_status_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppDocStatusDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_doc_status_date === null || $this->app_doc_status_date === '') {
- return null;
- } elseif (!is_int($this->app_doc_status_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_doc_status_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_doc_status_date] as date/time value: " . var_export($this->app_doc_status_date, true));
- }
- } else {
- $ts = $this->app_doc_status_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [app_doc_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDocUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_doc_uid !== $v || $v === '') {
- $this->app_doc_uid = $v;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_UID;
- }
-
- } // setAppDocUid()
-
- /**
- * Set the value of [doc_version] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDocVersion($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->doc_version !== $v || $v === 1) {
- $this->doc_version = $v;
- $this->modifiedColumns[] = AppDocumentPeer::DOC_VERSION;
- }
-
- } // setDocVersion()
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppDocumentPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndex($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->del_index !== $v || $v === 0) {
- $this->del_index = $v;
- $this->modifiedColumns[] = AppDocumentPeer::DEL_INDEX;
- }
-
- } // setDelIndex()
-
- /**
- * Set the value of [doc_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDocUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->doc_uid !== $v || $v === '') {
- $this->doc_uid = $v;
- $this->modifiedColumns[] = AppDocumentPeer::DOC_UID;
- }
-
- } // setDocUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = AppDocumentPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [app_doc_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDocType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_doc_type !== $v || $v === '') {
- $this->app_doc_type = $v;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_TYPE;
- }
-
- } // setAppDocType()
-
- /**
- * Set the value of [app_doc_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppDocCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_doc_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_doc_create_date !== $ts) {
- $this->app_doc_create_date = $ts;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_CREATE_DATE;
- }
-
- } // setAppDocCreateDate()
-
- /**
- * Set the value of [app_doc_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppDocIndex($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->app_doc_index !== $v) {
- $this->app_doc_index = $v;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_INDEX;
- }
-
- } // setAppDocIndex()
-
- /**
- * Set the value of [folder_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFolderUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->folder_uid !== $v || $v === '') {
- $this->folder_uid = $v;
- $this->modifiedColumns[] = AppDocumentPeer::FOLDER_UID;
- }
-
- } // setFolderUid()
-
- /**
- * Set the value of [app_doc_plugin] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDocPlugin($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_doc_plugin !== $v || $v === '') {
- $this->app_doc_plugin = $v;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_PLUGIN;
- }
-
- } // setAppDocPlugin()
-
- /**
- * Set the value of [app_doc_tags] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDocTags($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_doc_tags !== $v) {
- $this->app_doc_tags = $v;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_TAGS;
- }
-
- } // setAppDocTags()
-
- /**
- * Set the value of [app_doc_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppDocStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_doc_status !== $v || $v === 'ACTIVE') {
- $this->app_doc_status = $v;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_STATUS;
- }
-
- } // setAppDocStatus()
-
- /**
- * Set the value of [app_doc_status_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppDocStatusDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_doc_status_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_doc_status_date !== $ts) {
- $this->app_doc_status_date = $ts;
- $this->modifiedColumns[] = AppDocumentPeer::APP_DOC_STATUS_DATE;
- }
-
- } // setAppDocStatusDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_doc_uid = $rs->getString($startcol + 0);
-
- $this->doc_version = $rs->getInt($startcol + 1);
-
- $this->app_uid = $rs->getString($startcol + 2);
-
- $this->del_index = $rs->getInt($startcol + 3);
-
- $this->doc_uid = $rs->getString($startcol + 4);
-
- $this->usr_uid = $rs->getString($startcol + 5);
-
- $this->app_doc_type = $rs->getString($startcol + 6);
-
- $this->app_doc_create_date = $rs->getTimestamp($startcol + 7, null);
-
- $this->app_doc_index = $rs->getInt($startcol + 8);
-
- $this->folder_uid = $rs->getString($startcol + 9);
-
- $this->app_doc_plugin = $rs->getString($startcol + 10);
-
- $this->app_doc_tags = $rs->getString($startcol + 11);
-
- $this->app_doc_status = $rs->getString($startcol + 12);
-
- $this->app_doc_status_date = $rs->getTimestamp($startcol + 13, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 14; // 14 = AppDocumentPeer::NUM_COLUMNS - AppDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppDocument object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppDocumentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppDocumentPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppDocumentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppDocumentPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppDocumentPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppDocumentPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppDocUid();
- break;
- case 1:
- return $this->getDocVersion();
- break;
- case 2:
- return $this->getAppUid();
- break;
- case 3:
- return $this->getDelIndex();
- break;
- case 4:
- return $this->getDocUid();
- break;
- case 5:
- return $this->getUsrUid();
- break;
- case 6:
- return $this->getAppDocType();
- break;
- case 7:
- return $this->getAppDocCreateDate();
- break;
- case 8:
- return $this->getAppDocIndex();
- break;
- case 9:
- return $this->getFolderUid();
- break;
- case 10:
- return $this->getAppDocPlugin();
- break;
- case 11:
- return $this->getAppDocTags();
- break;
- case 12:
- return $this->getAppDocStatus();
- break;
- case 13:
- return $this->getAppDocStatusDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppDocumentPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppDocUid(),
- $keys[1] => $this->getDocVersion(),
- $keys[2] => $this->getAppUid(),
- $keys[3] => $this->getDelIndex(),
- $keys[4] => $this->getDocUid(),
- $keys[5] => $this->getUsrUid(),
- $keys[6] => $this->getAppDocType(),
- $keys[7] => $this->getAppDocCreateDate(),
- $keys[8] => $this->getAppDocIndex(),
- $keys[9] => $this->getFolderUid(),
- $keys[10] => $this->getAppDocPlugin(),
- $keys[11] => $this->getAppDocTags(),
- $keys[12] => $this->getAppDocStatus(),
- $keys[13] => $this->getAppDocStatusDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppDocUid($value);
- break;
- case 1:
- $this->setDocVersion($value);
- break;
- case 2:
- $this->setAppUid($value);
- break;
- case 3:
- $this->setDelIndex($value);
- break;
- case 4:
- $this->setDocUid($value);
- break;
- case 5:
- $this->setUsrUid($value);
- break;
- case 6:
- $this->setAppDocType($value);
- break;
- case 7:
- $this->setAppDocCreateDate($value);
- break;
- case 8:
- $this->setAppDocIndex($value);
- break;
- case 9:
- $this->setFolderUid($value);
- break;
- case 10:
- $this->setAppDocPlugin($value);
- break;
- case 11:
- $this->setAppDocTags($value);
- break;
- case 12:
- $this->setAppDocStatus($value);
- break;
- case 13:
- $this->setAppDocStatusDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppDocumentPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppDocUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDocVersion($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAppUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDelIndex($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDocUid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setUsrUid($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setAppDocType($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setAppDocCreateDate($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setAppDocIndex($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setFolderUid($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setAppDocPlugin($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setAppDocTags($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setAppDocStatus($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setAppDocStatusDate($arr[$keys[13]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppDocumentPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_UID)) $criteria->add(AppDocumentPeer::APP_DOC_UID, $this->app_doc_uid);
- if ($this->isColumnModified(AppDocumentPeer::DOC_VERSION)) $criteria->add(AppDocumentPeer::DOC_VERSION, $this->doc_version);
- if ($this->isColumnModified(AppDocumentPeer::APP_UID)) $criteria->add(AppDocumentPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppDocumentPeer::DEL_INDEX)) $criteria->add(AppDocumentPeer::DEL_INDEX, $this->del_index);
- if ($this->isColumnModified(AppDocumentPeer::DOC_UID)) $criteria->add(AppDocumentPeer::DOC_UID, $this->doc_uid);
- if ($this->isColumnModified(AppDocumentPeer::USR_UID)) $criteria->add(AppDocumentPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_TYPE)) $criteria->add(AppDocumentPeer::APP_DOC_TYPE, $this->app_doc_type);
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_CREATE_DATE)) $criteria->add(AppDocumentPeer::APP_DOC_CREATE_DATE, $this->app_doc_create_date);
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_INDEX)) $criteria->add(AppDocumentPeer::APP_DOC_INDEX, $this->app_doc_index);
- if ($this->isColumnModified(AppDocumentPeer::FOLDER_UID)) $criteria->add(AppDocumentPeer::FOLDER_UID, $this->folder_uid);
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_PLUGIN)) $criteria->add(AppDocumentPeer::APP_DOC_PLUGIN, $this->app_doc_plugin);
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_TAGS)) $criteria->add(AppDocumentPeer::APP_DOC_TAGS, $this->app_doc_tags);
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_STATUS)) $criteria->add(AppDocumentPeer::APP_DOC_STATUS, $this->app_doc_status);
- if ($this->isColumnModified(AppDocumentPeer::APP_DOC_STATUS_DATE)) $criteria->add(AppDocumentPeer::APP_DOC_STATUS_DATE, $this->app_doc_status_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppDocumentPeer::DATABASE_NAME);
-
- $criteria->add(AppDocumentPeer::APP_DOC_UID, $this->app_doc_uid);
- $criteria->add(AppDocumentPeer::DOC_VERSION, $this->doc_version);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getAppDocUid();
-
- $pks[1] = $this->getDocVersion();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setAppDocUid($keys[0]);
-
- $this->setDocVersion($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppDocument (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppUid($this->app_uid);
-
- $copyObj->setDelIndex($this->del_index);
-
- $copyObj->setDocUid($this->doc_uid);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setAppDocType($this->app_doc_type);
-
- $copyObj->setAppDocCreateDate($this->app_doc_create_date);
-
- $copyObj->setAppDocIndex($this->app_doc_index);
-
- $copyObj->setFolderUid($this->folder_uid);
-
- $copyObj->setAppDocPlugin($this->app_doc_plugin);
-
- $copyObj->setAppDocTags($this->app_doc_tags);
-
- $copyObj->setAppDocStatus($this->app_doc_status);
-
- $copyObj->setAppDocStatusDate($this->app_doc_status_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppDocUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setDocVersion('1'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppDocument Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppDocumentPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppDocumentPeer();
- }
- return self::$peer;
- }
+ $copyObj->setDocUid($this->doc_uid);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+ $copyObj->setAppDocType($this->app_doc_type);
+
+ $copyObj->setAppDocCreateDate($this->app_doc_create_date);
+
+ $copyObj->setAppDocIndex($this->app_doc_index);
+
+ $copyObj->setFolderUid($this->folder_uid);
+
+ $copyObj->setAppDocPlugin($this->app_doc_plugin);
+
+ $copyObj->setAppDocTags($this->app_doc_tags);
+
+ $copyObj->setAppDocStatus($this->app_doc_status);
+
+ $copyObj->setAppDocStatusDate($this->app_doc_status_date);
+
+ $copyObj->setAppDocFieldname($this->app_doc_fieldname);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppDocUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setDocVersion('1'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppDocument Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppDocumentPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppDocumentPeer();
+ }
+ return self::$peer;
+ }
+}
-} // BaseAppDocument
diff --git a/workflow/engine/classes/model/om/BaseAppDocumentPeer.php b/workflow/engine/classes/model/om/BaseAppDocumentPeer.php
index 1865faf32..d2ace555d 100755
--- a/workflow/engine/classes/model/om/BaseAppDocumentPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppDocumentPeer.php
@@ -12,634 +12,640 @@ include_once 'classes/model/AppDocument.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppDocumentPeer {
+abstract class BaseAppDocumentPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_DOCUMENT';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppDocument';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 15;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_DOC_UID field */
+ const APP_DOC_UID = 'APP_DOCUMENT.APP_DOC_UID';
+
+ /** the column name for the DOC_VERSION field */
+ const DOC_VERSION = 'APP_DOCUMENT.DOC_VERSION';
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_DOCUMENT.APP_UID';
+
+ /** the column name for the DEL_INDEX field */
+ const DEL_INDEX = 'APP_DOCUMENT.DEL_INDEX';
+
+ /** the column name for the DOC_UID field */
+ const DOC_UID = 'APP_DOCUMENT.DOC_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'APP_DOCUMENT.USR_UID';
+
+ /** the column name for the APP_DOC_TYPE field */
+ const APP_DOC_TYPE = 'APP_DOCUMENT.APP_DOC_TYPE';
+
+ /** the column name for the APP_DOC_CREATE_DATE field */
+ const APP_DOC_CREATE_DATE = 'APP_DOCUMENT.APP_DOC_CREATE_DATE';
+
+ /** the column name for the APP_DOC_INDEX field */
+ const APP_DOC_INDEX = 'APP_DOCUMENT.APP_DOC_INDEX';
+
+ /** the column name for the FOLDER_UID field */
+ const FOLDER_UID = 'APP_DOCUMENT.FOLDER_UID';
+
+ /** the column name for the APP_DOC_PLUGIN field */
+ const APP_DOC_PLUGIN = 'APP_DOCUMENT.APP_DOC_PLUGIN';
+
+ /** the column name for the APP_DOC_TAGS field */
+ const APP_DOC_TAGS = 'APP_DOCUMENT.APP_DOC_TAGS';
+
+ /** the column name for the APP_DOC_STATUS field */
+ const APP_DOC_STATUS = 'APP_DOCUMENT.APP_DOC_STATUS';
+
+ /** the column name for the APP_DOC_STATUS_DATE field */
+ const APP_DOC_STATUS_DATE = 'APP_DOCUMENT.APP_DOC_STATUS_DATE';
+
+ /** the column name for the APP_DOC_FIELDNAME field */
+ const APP_DOC_FIELDNAME = 'APP_DOCUMENT.APP_DOC_FIELDNAME';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppDocUid', 'DocVersion', 'AppUid', 'DelIndex', 'DocUid', 'UsrUid', 'AppDocType', 'AppDocCreateDate', 'AppDocIndex', 'FolderUid', 'AppDocPlugin', 'AppDocTags', 'AppDocStatus', 'AppDocStatusDate', 'AppDocFieldname', ),
+ BasePeer::TYPE_COLNAME => array (AppDocumentPeer::APP_DOC_UID, AppDocumentPeer::DOC_VERSION, AppDocumentPeer::APP_UID, AppDocumentPeer::DEL_INDEX, AppDocumentPeer::DOC_UID, AppDocumentPeer::USR_UID, AppDocumentPeer::APP_DOC_TYPE, AppDocumentPeer::APP_DOC_CREATE_DATE, AppDocumentPeer::APP_DOC_INDEX, AppDocumentPeer::FOLDER_UID, AppDocumentPeer::APP_DOC_PLUGIN, AppDocumentPeer::APP_DOC_TAGS, AppDocumentPeer::APP_DOC_STATUS, AppDocumentPeer::APP_DOC_STATUS_DATE, AppDocumentPeer::APP_DOC_FIELDNAME, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_DOC_UID', 'DOC_VERSION', 'APP_UID', 'DEL_INDEX', 'DOC_UID', 'USR_UID', 'APP_DOC_TYPE', 'APP_DOC_CREATE_DATE', 'APP_DOC_INDEX', 'FOLDER_UID', 'APP_DOC_PLUGIN', 'APP_DOC_TAGS', 'APP_DOC_STATUS', 'APP_DOC_STATUS_DATE', 'APP_DOC_FIELDNAME', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppDocUid' => 0, 'DocVersion' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'DocUid' => 4, 'UsrUid' => 5, 'AppDocType' => 6, 'AppDocCreateDate' => 7, 'AppDocIndex' => 8, 'FolderUid' => 9, 'AppDocPlugin' => 10, 'AppDocTags' => 11, 'AppDocStatus' => 12, 'AppDocStatusDate' => 13, 'AppDocFieldname' => 14, ),
+ BasePeer::TYPE_COLNAME => array (AppDocumentPeer::APP_DOC_UID => 0, AppDocumentPeer::DOC_VERSION => 1, AppDocumentPeer::APP_UID => 2, AppDocumentPeer::DEL_INDEX => 3, AppDocumentPeer::DOC_UID => 4, AppDocumentPeer::USR_UID => 5, AppDocumentPeer::APP_DOC_TYPE => 6, AppDocumentPeer::APP_DOC_CREATE_DATE => 7, AppDocumentPeer::APP_DOC_INDEX => 8, AppDocumentPeer::FOLDER_UID => 9, AppDocumentPeer::APP_DOC_PLUGIN => 10, AppDocumentPeer::APP_DOC_TAGS => 11, AppDocumentPeer::APP_DOC_STATUS => 12, AppDocumentPeer::APP_DOC_STATUS_DATE => 13, AppDocumentPeer::APP_DOC_FIELDNAME => 14, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_DOC_UID' => 0, 'DOC_VERSION' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'DOC_UID' => 4, 'USR_UID' => 5, 'APP_DOC_TYPE' => 6, 'APP_DOC_CREATE_DATE' => 7, 'APP_DOC_INDEX' => 8, 'FOLDER_UID' => 9, 'APP_DOC_PLUGIN' => 10, 'APP_DOC_TAGS' => 11, 'APP_DOC_STATUS' => 12, 'APP_DOC_STATUS_DATE' => 13, 'APP_DOC_FIELDNAME' => 14, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppDocumentMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppDocumentMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppDocumentPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppDocumentPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppDocumentPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_UID);
+
+ $criteria->addSelectColumn(AppDocumentPeer::DOC_VERSION);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppDocumentPeer::DEL_INDEX);
+
+ $criteria->addSelectColumn(AppDocumentPeer::DOC_UID);
+
+ $criteria->addSelectColumn(AppDocumentPeer::USR_UID);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_INDEX);
+
+ $criteria->addSelectColumn(AppDocumentPeer::FOLDER_UID);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_PLUGIN);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_TAGS);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_STATUS);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_STATUS_DATE);
+
+ $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_FIELDNAME);
+
+ }
+
+ const COUNT = 'COUNT(APP_DOCUMENT.APP_DOC_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_DOCUMENT.APP_DOC_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppDocumentPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppDocumentPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppDocumentPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppDocument
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppDocumentPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppDocumentPeer::populateObjects(AppDocumentPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppDocumentPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppDocumentPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppDocumentPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppDocument or Criteria object.
+ *
+ * @param mixed $values Criteria or AppDocument object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppDocument object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppDocument or Criteria object.
+ *
+ * @param mixed $values Criteria or AppDocument object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppDocumentPeer::APP_DOC_UID);
+ $selectCriteria->add(AppDocumentPeer::APP_DOC_UID, $criteria->remove(AppDocumentPeer::APP_DOC_UID), $comparison);
+
+ $comparison = $criteria->getComparison(AppDocumentPeer::DOC_VERSION);
+ $selectCriteria->add(AppDocumentPeer::DOC_VERSION, $criteria->remove(AppDocumentPeer::DOC_VERSION), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_DOCUMENT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppDocumentPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppDocument or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppDocument object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppDocumentPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppDocument) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
+
+ $criteria->add(AppDocumentPeer::APP_DOC_UID, $vals[0], Criteria::IN);
+ $criteria->add(AppDocumentPeer::DOC_VERSION, $vals[1], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppDocument object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppDocument $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppDocument $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppDocumentPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppDocumentPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_UID))
+ $columns[AppDocumentPeer::APP_DOC_UID] = $obj->getAppDocUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_UID))
+ $columns[AppDocumentPeer::APP_UID] = $obj->getAppUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::DEL_INDEX))
+ $columns[AppDocumentPeer::DEL_INDEX] = $obj->getDelIndex();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::DOC_UID))
+ $columns[AppDocumentPeer::DOC_UID] = $obj->getDocUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::USR_UID))
+ $columns[AppDocumentPeer::USR_UID] = $obj->getUsrUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_TYPE))
+ $columns[AppDocumentPeer::APP_DOC_TYPE] = $obj->getAppDocType();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_CREATE_DATE))
+ $columns[AppDocumentPeer::APP_DOC_CREATE_DATE] = $obj->getAppDocCreateDate();
+
+ if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_STATUS))
+ $columns[AppDocumentPeer::APP_DOC_STATUS] = $obj->getAppDocStatus();
+
+ }
+
+ return BasePeer::doValidate(AppDocumentPeer::DATABASE_NAME, AppDocumentPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $app_doc_uid
+ * @param int $doc_version
+ * @param Connection $con
+ * @return AppDocument
+ */
+ public static function retrieveByPK($app_doc_uid, $doc_version, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(AppDocumentPeer::APP_DOC_UID, $app_doc_uid);
+ $criteria->add(AppDocumentPeer::DOC_VERSION, $doc_version);
+ $v = AppDocumentPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'APP_DOCUMENT';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppDocument';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 14;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_DOC_UID field */
- const APP_DOC_UID = 'APP_DOCUMENT.APP_DOC_UID';
-
- /** the column name for the DOC_VERSION field */
- const DOC_VERSION = 'APP_DOCUMENT.DOC_VERSION';
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_DOCUMENT.APP_UID';
-
- /** the column name for the DEL_INDEX field */
- const DEL_INDEX = 'APP_DOCUMENT.DEL_INDEX';
-
- /** the column name for the DOC_UID field */
- const DOC_UID = 'APP_DOCUMENT.DOC_UID';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'APP_DOCUMENT.USR_UID';
-
- /** the column name for the APP_DOC_TYPE field */
- const APP_DOC_TYPE = 'APP_DOCUMENT.APP_DOC_TYPE';
-
- /** the column name for the APP_DOC_CREATE_DATE field */
- const APP_DOC_CREATE_DATE = 'APP_DOCUMENT.APP_DOC_CREATE_DATE';
-
- /** the column name for the APP_DOC_INDEX field */
- const APP_DOC_INDEX = 'APP_DOCUMENT.APP_DOC_INDEX';
-
- /** the column name for the FOLDER_UID field */
- const FOLDER_UID = 'APP_DOCUMENT.FOLDER_UID';
-
- /** the column name for the APP_DOC_PLUGIN field */
- const APP_DOC_PLUGIN = 'APP_DOCUMENT.APP_DOC_PLUGIN';
-
- /** the column name for the APP_DOC_TAGS field */
- const APP_DOC_TAGS = 'APP_DOCUMENT.APP_DOC_TAGS';
-
- /** the column name for the APP_DOC_STATUS field */
- const APP_DOC_STATUS = 'APP_DOCUMENT.APP_DOC_STATUS';
-
- /** the column name for the APP_DOC_STATUS_DATE field */
- const APP_DOC_STATUS_DATE = 'APP_DOCUMENT.APP_DOC_STATUS_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppDocUid', 'DocVersion', 'AppUid', 'DelIndex', 'DocUid', 'UsrUid', 'AppDocType', 'AppDocCreateDate', 'AppDocIndex', 'FolderUid', 'AppDocPlugin', 'AppDocTags', 'AppDocStatus', 'AppDocStatusDate', ),
- BasePeer::TYPE_COLNAME => array (AppDocumentPeer::APP_DOC_UID, AppDocumentPeer::DOC_VERSION, AppDocumentPeer::APP_UID, AppDocumentPeer::DEL_INDEX, AppDocumentPeer::DOC_UID, AppDocumentPeer::USR_UID, AppDocumentPeer::APP_DOC_TYPE, AppDocumentPeer::APP_DOC_CREATE_DATE, AppDocumentPeer::APP_DOC_INDEX, AppDocumentPeer::FOLDER_UID, AppDocumentPeer::APP_DOC_PLUGIN, AppDocumentPeer::APP_DOC_TAGS, AppDocumentPeer::APP_DOC_STATUS, AppDocumentPeer::APP_DOC_STATUS_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_DOC_UID', 'DOC_VERSION', 'APP_UID', 'DEL_INDEX', 'DOC_UID', 'USR_UID', 'APP_DOC_TYPE', 'APP_DOC_CREATE_DATE', 'APP_DOC_INDEX', 'FOLDER_UID', 'APP_DOC_PLUGIN', 'APP_DOC_TAGS', 'APP_DOC_STATUS', 'APP_DOC_STATUS_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppDocUid' => 0, 'DocVersion' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'DocUid' => 4, 'UsrUid' => 5, 'AppDocType' => 6, 'AppDocCreateDate' => 7, 'AppDocIndex' => 8, 'FolderUid' => 9, 'AppDocPlugin' => 10, 'AppDocTags' => 11, 'AppDocStatus' => 12, 'AppDocStatusDate' => 13, ),
- BasePeer::TYPE_COLNAME => array (AppDocumentPeer::APP_DOC_UID => 0, AppDocumentPeer::DOC_VERSION => 1, AppDocumentPeer::APP_UID => 2, AppDocumentPeer::DEL_INDEX => 3, AppDocumentPeer::DOC_UID => 4, AppDocumentPeer::USR_UID => 5, AppDocumentPeer::APP_DOC_TYPE => 6, AppDocumentPeer::APP_DOC_CREATE_DATE => 7, AppDocumentPeer::APP_DOC_INDEX => 8, AppDocumentPeer::FOLDER_UID => 9, AppDocumentPeer::APP_DOC_PLUGIN => 10, AppDocumentPeer::APP_DOC_TAGS => 11, AppDocumentPeer::APP_DOC_STATUS => 12, AppDocumentPeer::APP_DOC_STATUS_DATE => 13, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_DOC_UID' => 0, 'DOC_VERSION' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'DOC_UID' => 4, 'USR_UID' => 5, 'APP_DOC_TYPE' => 6, 'APP_DOC_CREATE_DATE' => 7, 'APP_DOC_INDEX' => 8, 'FOLDER_UID' => 9, 'APP_DOC_PLUGIN' => 10, 'APP_DOC_TAGS' => 11, 'APP_DOC_STATUS' => 12, 'APP_DOC_STATUS_DATE' => 13, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppDocumentMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppDocumentMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppDocumentPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppDocumentPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppDocumentPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_UID);
-
- $criteria->addSelectColumn(AppDocumentPeer::DOC_VERSION);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_UID);
-
- $criteria->addSelectColumn(AppDocumentPeer::DEL_INDEX);
-
- $criteria->addSelectColumn(AppDocumentPeer::DOC_UID);
-
- $criteria->addSelectColumn(AppDocumentPeer::USR_UID);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_INDEX);
-
- $criteria->addSelectColumn(AppDocumentPeer::FOLDER_UID);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_PLUGIN);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_TAGS);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_STATUS);
-
- $criteria->addSelectColumn(AppDocumentPeer::APP_DOC_STATUS_DATE);
-
- }
-
- const COUNT = 'COUNT(APP_DOCUMENT.APP_DOC_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_DOCUMENT.APP_DOC_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppDocumentPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppDocumentPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppDocumentPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppDocument
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppDocumentPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppDocumentPeer::populateObjects(AppDocumentPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppDocumentPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppDocumentPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppDocumentPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppDocument or Criteria object.
- *
- * @param mixed $values Criteria or AppDocument object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppDocument object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppDocument or Criteria object.
- *
- * @param mixed $values Criteria or AppDocument object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppDocumentPeer::APP_DOC_UID);
- $selectCriteria->add(AppDocumentPeer::APP_DOC_UID, $criteria->remove(AppDocumentPeer::APP_DOC_UID), $comparison);
-
- $comparison = $criteria->getComparison(AppDocumentPeer::DOC_VERSION);
- $selectCriteria->add(AppDocumentPeer::DOC_VERSION, $criteria->remove(AppDocumentPeer::DOC_VERSION), $comparison);
-
- } else { // $values is AppDocument object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_DOCUMENT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppDocumentPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppDocument or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppDocument object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppDocumentPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppDocument) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
-
- $criteria->add(AppDocumentPeer::APP_DOC_UID, $vals[0], Criteria::IN);
- $criteria->add(AppDocumentPeer::DOC_VERSION, $vals[1], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppDocument object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppDocument $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppDocument $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppDocumentPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppDocumentPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_UID))
- $columns[AppDocumentPeer::APP_DOC_UID] = $obj->getAppDocUid();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_UID))
- $columns[AppDocumentPeer::APP_UID] = $obj->getAppUid();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::DEL_INDEX))
- $columns[AppDocumentPeer::DEL_INDEX] = $obj->getDelIndex();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::DOC_UID))
- $columns[AppDocumentPeer::DOC_UID] = $obj->getDocUid();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::USR_UID))
- $columns[AppDocumentPeer::USR_UID] = $obj->getUsrUid();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_TYPE))
- $columns[AppDocumentPeer::APP_DOC_TYPE] = $obj->getAppDocType();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_CREATE_DATE))
- $columns[AppDocumentPeer::APP_DOC_CREATE_DATE] = $obj->getAppDocCreateDate();
-
- if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_STATUS))
- $columns[AppDocumentPeer::APP_DOC_STATUS] = $obj->getAppDocStatus();
-
- }
-
- return BasePeer::doValidate(AppDocumentPeer::DATABASE_NAME, AppDocumentPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $app_doc_uid
- @param int $doc_version
-
- * @param Connection $con
- * @return AppDocument
- */
- public static function retrieveByPK( $app_doc_uid, $doc_version, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(AppDocumentPeer::APP_DOC_UID, $app_doc_uid);
- $criteria->add(AppDocumentPeer::DOC_VERSION, $doc_version);
- $v = AppDocumentPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseAppDocumentPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppDocumentPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppDocumentPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppDocumentMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppDocumentMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppDocumentMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppDocumentMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppEvent.php b/workflow/engine/classes/model/om/BaseAppEvent.php
index 3c8c8c986..379fa5200 100755
--- a/workflow/engine/classes/model/om/BaseAppEvent.php
+++ b/workflow/engine/classes/model/om/BaseAppEvent.php
@@ -16,868 +16,908 @@ include_once 'classes/model/AppEventPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppEvent extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppEventPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the del_index field.
- * @var int
- */
- protected $del_index = 0;
-
-
- /**
- * The value for the evn_uid field.
- * @var string
- */
- protected $evn_uid = '';
-
-
- /**
- * The value for the app_evn_action_date field.
- * @var int
- */
- protected $app_evn_action_date;
-
-
- /**
- * The value for the app_evn_attempts field.
- * @var int
- */
- protected $app_evn_attempts = 0;
-
-
- /**
- * The value for the app_evn_last_execution_date field.
- * @var int
- */
- protected $app_evn_last_execution_date;
-
-
- /**
- * The value for the app_evn_status field.
- * @var string
- */
- protected $app_evn_status = 'OPEN';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [del_index] column value.
- *
- * @return int
- */
- public function getDelIndex()
- {
-
- return $this->del_index;
- }
-
- /**
- * Get the [evn_uid] column value.
- *
- * @return string
- */
- public function getEvnUid()
- {
-
- return $this->evn_uid;
- }
-
- /**
- * Get the [optionally formatted] [app_evn_action_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppEvnActionDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_evn_action_date === null || $this->app_evn_action_date === '') {
- return null;
- } elseif (!is_int($this->app_evn_action_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_evn_action_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_evn_action_date] as date/time value: " . var_export($this->app_evn_action_date, true));
- }
- } else {
- $ts = $this->app_evn_action_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [app_evn_attempts] column value.
- *
- * @return int
- */
- public function getAppEvnAttempts()
- {
-
- return $this->app_evn_attempts;
- }
-
- /**
- * Get the [optionally formatted] [app_evn_last_execution_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppEvnLastExecutionDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_evn_last_execution_date === null || $this->app_evn_last_execution_date === '') {
- return null;
- } elseif (!is_int($this->app_evn_last_execution_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_evn_last_execution_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_evn_last_execution_date] as date/time value: " . var_export($this->app_evn_last_execution_date, true));
- }
- } else {
- $ts = $this->app_evn_last_execution_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [app_evn_status] column value.
- *
- * @return string
- */
- public function getAppEvnStatus()
- {
-
- return $this->app_evn_status;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppEventPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndex($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->del_index !== $v || $v === 0) {
- $this->del_index = $v;
- $this->modifiedColumns[] = AppEventPeer::DEL_INDEX;
- }
-
- } // setDelIndex()
-
- /**
- * Set the value of [evn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_uid !== $v || $v === '') {
- $this->evn_uid = $v;
- $this->modifiedColumns[] = AppEventPeer::EVN_UID;
- }
-
- } // setEvnUid()
-
- /**
- * Set the value of [app_evn_action_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppEvnActionDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_evn_action_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_evn_action_date !== $ts) {
- $this->app_evn_action_date = $ts;
- $this->modifiedColumns[] = AppEventPeer::APP_EVN_ACTION_DATE;
- }
-
- } // setAppEvnActionDate()
-
- /**
- * Set the value of [app_evn_attempts] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppEvnAttempts($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->app_evn_attempts !== $v || $v === 0) {
- $this->app_evn_attempts = $v;
- $this->modifiedColumns[] = AppEventPeer::APP_EVN_ATTEMPTS;
- }
-
- } // setAppEvnAttempts()
-
- /**
- * Set the value of [app_evn_last_execution_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppEvnLastExecutionDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_evn_last_execution_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_evn_last_execution_date !== $ts) {
- $this->app_evn_last_execution_date = $ts;
- $this->modifiedColumns[] = AppEventPeer::APP_EVN_LAST_EXECUTION_DATE;
- }
-
- } // setAppEvnLastExecutionDate()
-
- /**
- * Set the value of [app_evn_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppEvnStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_evn_status !== $v || $v === 'OPEN') {
- $this->app_evn_status = $v;
- $this->modifiedColumns[] = AppEventPeer::APP_EVN_STATUS;
- }
-
- } // setAppEvnStatus()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->del_index = $rs->getInt($startcol + 1);
-
- $this->evn_uid = $rs->getString($startcol + 2);
-
- $this->app_evn_action_date = $rs->getTimestamp($startcol + 3, null);
-
- $this->app_evn_attempts = $rs->getInt($startcol + 4);
-
- $this->app_evn_last_execution_date = $rs->getTimestamp($startcol + 5, null);
-
- $this->app_evn_status = $rs->getString($startcol + 6);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 7; // 7 = AppEventPeer::NUM_COLUMNS - AppEventPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppEvent object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppEventPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppEventPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppEventPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppEventPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppEventPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppEventPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppEventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getDelIndex();
- break;
- case 2:
- return $this->getEvnUid();
- break;
- case 3:
- return $this->getAppEvnActionDate();
- break;
- case 4:
- return $this->getAppEvnAttempts();
- break;
- case 5:
- return $this->getAppEvnLastExecutionDate();
- break;
- case 6:
- return $this->getAppEvnStatus();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppEventPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getDelIndex(),
- $keys[2] => $this->getEvnUid(),
- $keys[3] => $this->getAppEvnActionDate(),
- $keys[4] => $this->getAppEvnAttempts(),
- $keys[5] => $this->getAppEvnLastExecutionDate(),
- $keys[6] => $this->getAppEvnStatus(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppEventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setDelIndex($value);
- break;
- case 2:
- $this->setEvnUid($value);
- break;
- case 3:
- $this->setAppEvnActionDate($value);
- break;
- case 4:
- $this->setAppEvnAttempts($value);
- break;
- case 5:
- $this->setAppEvnLastExecutionDate($value);
- break;
- case 6:
- $this->setAppEvnStatus($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppEventPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDelIndex($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setEvnUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setAppEvnActionDate($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setAppEvnAttempts($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setAppEvnLastExecutionDate($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setAppEvnStatus($arr[$keys[6]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppEventPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppEventPeer::APP_UID)) $criteria->add(AppEventPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppEventPeer::DEL_INDEX)) $criteria->add(AppEventPeer::DEL_INDEX, $this->del_index);
- if ($this->isColumnModified(AppEventPeer::EVN_UID)) $criteria->add(AppEventPeer::EVN_UID, $this->evn_uid);
- if ($this->isColumnModified(AppEventPeer::APP_EVN_ACTION_DATE)) $criteria->add(AppEventPeer::APP_EVN_ACTION_DATE, $this->app_evn_action_date);
- if ($this->isColumnModified(AppEventPeer::APP_EVN_ATTEMPTS)) $criteria->add(AppEventPeer::APP_EVN_ATTEMPTS, $this->app_evn_attempts);
- if ($this->isColumnModified(AppEventPeer::APP_EVN_LAST_EXECUTION_DATE)) $criteria->add(AppEventPeer::APP_EVN_LAST_EXECUTION_DATE, $this->app_evn_last_execution_date);
- if ($this->isColumnModified(AppEventPeer::APP_EVN_STATUS)) $criteria->add(AppEventPeer::APP_EVN_STATUS, $this->app_evn_status);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppEventPeer::DATABASE_NAME);
-
- $criteria->add(AppEventPeer::APP_UID, $this->app_uid);
- $criteria->add(AppEventPeer::DEL_INDEX, $this->del_index);
- $criteria->add(AppEventPeer::EVN_UID, $this->evn_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getAppUid();
-
- $pks[1] = $this->getDelIndex();
-
- $pks[2] = $this->getEvnUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setAppUid($keys[0]);
-
- $this->setDelIndex($keys[1]);
-
- $this->setEvnUid($keys[2]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppEvent (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppEvnActionDate($this->app_evn_action_date);
-
- $copyObj->setAppEvnAttempts($this->app_evn_attempts);
-
- $copyObj->setAppEvnLastExecutionDate($this->app_evn_last_execution_date);
-
- $copyObj->setAppEvnStatus($this->app_evn_status);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
-
- $copyObj->setEvnUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppEvent Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppEventPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppEventPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppEvent
+abstract class BaseAppEvent extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppEventPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the del_index field.
+ * @var int
+ */
+ protected $del_index = 0;
+
+ /**
+ * The value for the evn_uid field.
+ * @var string
+ */
+ protected $evn_uid = '';
+
+ /**
+ * The value for the app_evn_action_date field.
+ * @var int
+ */
+ protected $app_evn_action_date;
+
+ /**
+ * The value for the app_evn_attempts field.
+ * @var int
+ */
+ protected $app_evn_attempts = 0;
+
+ /**
+ * The value for the app_evn_last_execution_date field.
+ * @var int
+ */
+ protected $app_evn_last_execution_date;
+
+ /**
+ * The value for the app_evn_status field.
+ * @var string
+ */
+ protected $app_evn_status = 'OPEN';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [del_index] column value.
+ *
+ * @return int
+ */
+ public function getDelIndex()
+ {
+
+ return $this->del_index;
+ }
+
+ /**
+ * Get the [evn_uid] column value.
+ *
+ * @return string
+ */
+ public function getEvnUid()
+ {
+
+ return $this->evn_uid;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_evn_action_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppEvnActionDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_evn_action_date === null || $this->app_evn_action_date === '') {
+ return null;
+ } elseif (!is_int($this->app_evn_action_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_evn_action_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_evn_action_date] as date/time value: " .
+ var_export($this->app_evn_action_date, true));
+ }
+ } else {
+ $ts = $this->app_evn_action_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_evn_attempts] column value.
+ *
+ * @return int
+ */
+ public function getAppEvnAttempts()
+ {
+
+ return $this->app_evn_attempts;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_evn_last_execution_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppEvnLastExecutionDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_evn_last_execution_date === null || $this->app_evn_last_execution_date === '') {
+ return null;
+ } elseif (!is_int($this->app_evn_last_execution_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_evn_last_execution_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_evn_last_execution_date] as date/time value: " .
+ var_export($this->app_evn_last_execution_date, true));
+ }
+ } else {
+ $ts = $this->app_evn_last_execution_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_evn_status] column value.
+ *
+ * @return string
+ */
+ public function getAppEvnStatus()
+ {
+
+ return $this->app_evn_status;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppEventPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndex($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->del_index !== $v || $v === 0) {
+ $this->del_index = $v;
+ $this->modifiedColumns[] = AppEventPeer::DEL_INDEX;
+ }
+
+ } // setDelIndex()
+
+ /**
+ * Set the value of [evn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_uid !== $v || $v === '') {
+ $this->evn_uid = $v;
+ $this->modifiedColumns[] = AppEventPeer::EVN_UID;
+ }
+
+ } // setEvnUid()
+
+ /**
+ * Set the value of [app_evn_action_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppEvnActionDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_evn_action_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_evn_action_date !== $ts) {
+ $this->app_evn_action_date = $ts;
+ $this->modifiedColumns[] = AppEventPeer::APP_EVN_ACTION_DATE;
+ }
+
+ } // setAppEvnActionDate()
+
+ /**
+ * Set the value of [app_evn_attempts] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppEvnAttempts($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->app_evn_attempts !== $v || $v === 0) {
+ $this->app_evn_attempts = $v;
+ $this->modifiedColumns[] = AppEventPeer::APP_EVN_ATTEMPTS;
+ }
+
+ } // setAppEvnAttempts()
+
+ /**
+ * Set the value of [app_evn_last_execution_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppEvnLastExecutionDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_evn_last_execution_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_evn_last_execution_date !== $ts) {
+ $this->app_evn_last_execution_date = $ts;
+ $this->modifiedColumns[] = AppEventPeer::APP_EVN_LAST_EXECUTION_DATE;
+ }
+
+ } // setAppEvnLastExecutionDate()
+
+ /**
+ * Set the value of [app_evn_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppEvnStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_evn_status !== $v || $v === 'OPEN') {
+ $this->app_evn_status = $v;
+ $this->modifiedColumns[] = AppEventPeer::APP_EVN_STATUS;
+ }
+
+ } // setAppEvnStatus()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->del_index = $rs->getInt($startcol + 1);
+
+ $this->evn_uid = $rs->getString($startcol + 2);
+
+ $this->app_evn_action_date = $rs->getTimestamp($startcol + 3, null);
+
+ $this->app_evn_attempts = $rs->getInt($startcol + 4);
+
+ $this->app_evn_last_execution_date = $rs->getTimestamp($startcol + 5, null);
+
+ $this->app_evn_status = $rs->getString($startcol + 6);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 7; // 7 = AppEventPeer::NUM_COLUMNS - AppEventPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppEvent object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppEventPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppEventPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppEventPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppEventPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppEventPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppEventPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppEventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getDelIndex();
+ break;
+ case 2:
+ return $this->getEvnUid();
+ break;
+ case 3:
+ return $this->getAppEvnActionDate();
+ break;
+ case 4:
+ return $this->getAppEvnAttempts();
+ break;
+ case 5:
+ return $this->getAppEvnLastExecutionDate();
+ break;
+ case 6:
+ return $this->getAppEvnStatus();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppEventPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getDelIndex(),
+ $keys[2] => $this->getEvnUid(),
+ $keys[3] => $this->getAppEvnActionDate(),
+ $keys[4] => $this->getAppEvnAttempts(),
+ $keys[5] => $this->getAppEvnLastExecutionDate(),
+ $keys[6] => $this->getAppEvnStatus(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppEventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setDelIndex($value);
+ break;
+ case 2:
+ $this->setEvnUid($value);
+ break;
+ case 3:
+ $this->setAppEvnActionDate($value);
+ break;
+ case 4:
+ $this->setAppEvnAttempts($value);
+ break;
+ case 5:
+ $this->setAppEvnLastExecutionDate($value);
+ break;
+ case 6:
+ $this->setAppEvnStatus($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppEventPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDelIndex($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setEvnUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setAppEvnActionDate($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setAppEvnAttempts($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setAppEvnLastExecutionDate($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setAppEvnStatus($arr[$keys[6]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppEventPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppEventPeer::APP_UID)) {
+ $criteria->add(AppEventPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppEventPeer::DEL_INDEX)) {
+ $criteria->add(AppEventPeer::DEL_INDEX, $this->del_index);
+ }
+
+ if ($this->isColumnModified(AppEventPeer::EVN_UID)) {
+ $criteria->add(AppEventPeer::EVN_UID, $this->evn_uid);
+ }
+
+ if ($this->isColumnModified(AppEventPeer::APP_EVN_ACTION_DATE)) {
+ $criteria->add(AppEventPeer::APP_EVN_ACTION_DATE, $this->app_evn_action_date);
+ }
+
+ if ($this->isColumnModified(AppEventPeer::APP_EVN_ATTEMPTS)) {
+ $criteria->add(AppEventPeer::APP_EVN_ATTEMPTS, $this->app_evn_attempts);
+ }
+
+ if ($this->isColumnModified(AppEventPeer::APP_EVN_LAST_EXECUTION_DATE)) {
+ $criteria->add(AppEventPeer::APP_EVN_LAST_EXECUTION_DATE, $this->app_evn_last_execution_date);
+ }
+
+ if ($this->isColumnModified(AppEventPeer::APP_EVN_STATUS)) {
+ $criteria->add(AppEventPeer::APP_EVN_STATUS, $this->app_evn_status);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppEventPeer::DATABASE_NAME);
+
+ $criteria->add(AppEventPeer::APP_UID, $this->app_uid);
+ $criteria->add(AppEventPeer::DEL_INDEX, $this->del_index);
+ $criteria->add(AppEventPeer::EVN_UID, $this->evn_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getAppUid();
+
+ $pks[1] = $this->getDelIndex();
+
+ $pks[2] = $this->getEvnUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setAppUid($keys[0]);
+
+ $this->setDelIndex($keys[1]);
+
+ $this->setEvnUid($keys[2]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppEvent (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAppEvnActionDate($this->app_evn_action_date);
+
+ $copyObj->setAppEvnAttempts($this->app_evn_attempts);
+
+ $copyObj->setAppEvnLastExecutionDate($this->app_evn_last_execution_date);
+
+ $copyObj->setAppEvnStatus($this->app_evn_status);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
+
+ $copyObj->setEvnUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppEvent Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppEventPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppEventPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseAppEventPeer.php b/workflow/engine/classes/model/om/BaseAppEventPeer.php
index 924d2ed12..146dceb31 100755
--- a/workflow/engine/classes/model/om/BaseAppEventPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppEventPeer.php
@@ -12,582 +12,583 @@ include_once 'classes/model/AppEvent.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppEventPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'APP_EVENT';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppEvent';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 7;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_EVENT.APP_UID';
-
- /** the column name for the DEL_INDEX field */
- const DEL_INDEX = 'APP_EVENT.DEL_INDEX';
-
- /** the column name for the EVN_UID field */
- const EVN_UID = 'APP_EVENT.EVN_UID';
-
- /** the column name for the APP_EVN_ACTION_DATE field */
- const APP_EVN_ACTION_DATE = 'APP_EVENT.APP_EVN_ACTION_DATE';
-
- /** the column name for the APP_EVN_ATTEMPTS field */
- const APP_EVN_ATTEMPTS = 'APP_EVENT.APP_EVN_ATTEMPTS';
-
- /** the column name for the APP_EVN_LAST_EXECUTION_DATE field */
- const APP_EVN_LAST_EXECUTION_DATE = 'APP_EVENT.APP_EVN_LAST_EXECUTION_DATE';
-
- /** the column name for the APP_EVN_STATUS field */
- const APP_EVN_STATUS = 'APP_EVENT.APP_EVN_STATUS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'EvnUid', 'AppEvnActionDate', 'AppEvnAttempts', 'AppEvnLastExecutionDate', 'AppEvnStatus', ),
- BasePeer::TYPE_COLNAME => array (AppEventPeer::APP_UID, AppEventPeer::DEL_INDEX, AppEventPeer::EVN_UID, AppEventPeer::APP_EVN_ACTION_DATE, AppEventPeer::APP_EVN_ATTEMPTS, AppEventPeer::APP_EVN_LAST_EXECUTION_DATE, AppEventPeer::APP_EVN_STATUS, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'EVN_UID', 'APP_EVN_ACTION_DATE', 'APP_EVN_ATTEMPTS', 'APP_EVN_LAST_EXECUTION_DATE', 'APP_EVN_STATUS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'EvnUid' => 2, 'AppEvnActionDate' => 3, 'AppEvnAttempts' => 4, 'AppEvnLastExecutionDate' => 5, 'AppEvnStatus' => 6, ),
- BasePeer::TYPE_COLNAME => array (AppEventPeer::APP_UID => 0, AppEventPeer::DEL_INDEX => 1, AppEventPeer::EVN_UID => 2, AppEventPeer::APP_EVN_ACTION_DATE => 3, AppEventPeer::APP_EVN_ATTEMPTS => 4, AppEventPeer::APP_EVN_LAST_EXECUTION_DATE => 5, AppEventPeer::APP_EVN_STATUS => 6, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'EVN_UID' => 2, 'APP_EVN_ACTION_DATE' => 3, 'APP_EVN_ATTEMPTS' => 4, 'APP_EVN_LAST_EXECUTION_DATE' => 5, 'APP_EVN_STATUS' => 6, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppEventMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppEventMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppEventPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppEventPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppEventPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppEventPeer::APP_UID);
-
- $criteria->addSelectColumn(AppEventPeer::DEL_INDEX);
-
- $criteria->addSelectColumn(AppEventPeer::EVN_UID);
-
- $criteria->addSelectColumn(AppEventPeer::APP_EVN_ACTION_DATE);
-
- $criteria->addSelectColumn(AppEventPeer::APP_EVN_ATTEMPTS);
-
- $criteria->addSelectColumn(AppEventPeer::APP_EVN_LAST_EXECUTION_DATE);
-
- $criteria->addSelectColumn(AppEventPeer::APP_EVN_STATUS);
-
- }
-
- const COUNT = 'COUNT(APP_EVENT.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_EVENT.APP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppEventPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppEventPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppEventPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppEvent
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppEventPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppEventPeer::populateObjects(AppEventPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppEventPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppEventPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppEventPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppEvent or Criteria object.
- *
- * @param mixed $values Criteria or AppEvent object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppEvent object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppEvent or Criteria object.
- *
- * @param mixed $values Criteria or AppEvent object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppEventPeer::APP_UID);
- $selectCriteria->add(AppEventPeer::APP_UID, $criteria->remove(AppEventPeer::APP_UID), $comparison);
-
- $comparison = $criteria->getComparison(AppEventPeer::DEL_INDEX);
- $selectCriteria->add(AppEventPeer::DEL_INDEX, $criteria->remove(AppEventPeer::DEL_INDEX), $comparison);
-
- $comparison = $criteria->getComparison(AppEventPeer::EVN_UID);
- $selectCriteria->add(AppEventPeer::EVN_UID, $criteria->remove(AppEventPeer::EVN_UID), $comparison);
-
- } else { // $values is AppEvent object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_EVENT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppEventPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppEvent or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppEvent object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppEventPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppEvent) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- }
-
- $criteria->add(AppEventPeer::APP_UID, $vals[0], Criteria::IN);
- $criteria->add(AppEventPeer::DEL_INDEX, $vals[1], Criteria::IN);
- $criteria->add(AppEventPeer::EVN_UID, $vals[2], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppEvent object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppEvent $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppEvent $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppEventPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppEventPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AppEventPeer::DATABASE_NAME, AppEventPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $app_uid
- @param int $del_index
- @param string $evn_uid
-
- * @param Connection $con
- * @return AppEvent
- */
- public static function retrieveByPK( $app_uid, $del_index, $evn_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(AppEventPeer::APP_UID, $app_uid);
- $criteria->add(AppEventPeer::DEL_INDEX, $del_index);
- $criteria->add(AppEventPeer::EVN_UID, $evn_uid);
- $v = AppEventPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseAppEventPeer
+abstract class BaseAppEventPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_EVENT';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppEvent';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 7;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_EVENT.APP_UID';
+
+ /** the column name for the DEL_INDEX field */
+ const DEL_INDEX = 'APP_EVENT.DEL_INDEX';
+
+ /** the column name for the EVN_UID field */
+ const EVN_UID = 'APP_EVENT.EVN_UID';
+
+ /** the column name for the APP_EVN_ACTION_DATE field */
+ const APP_EVN_ACTION_DATE = 'APP_EVENT.APP_EVN_ACTION_DATE';
+
+ /** the column name for the APP_EVN_ATTEMPTS field */
+ const APP_EVN_ATTEMPTS = 'APP_EVENT.APP_EVN_ATTEMPTS';
+
+ /** the column name for the APP_EVN_LAST_EXECUTION_DATE field */
+ const APP_EVN_LAST_EXECUTION_DATE = 'APP_EVENT.APP_EVN_LAST_EXECUTION_DATE';
+
+ /** the column name for the APP_EVN_STATUS field */
+ const APP_EVN_STATUS = 'APP_EVENT.APP_EVN_STATUS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'EvnUid', 'AppEvnActionDate', 'AppEvnAttempts', 'AppEvnLastExecutionDate', 'AppEvnStatus', ),
+ BasePeer::TYPE_COLNAME => array (AppEventPeer::APP_UID, AppEventPeer::DEL_INDEX, AppEventPeer::EVN_UID, AppEventPeer::APP_EVN_ACTION_DATE, AppEventPeer::APP_EVN_ATTEMPTS, AppEventPeer::APP_EVN_LAST_EXECUTION_DATE, AppEventPeer::APP_EVN_STATUS, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'EVN_UID', 'APP_EVN_ACTION_DATE', 'APP_EVN_ATTEMPTS', 'APP_EVN_LAST_EXECUTION_DATE', 'APP_EVN_STATUS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'EvnUid' => 2, 'AppEvnActionDate' => 3, 'AppEvnAttempts' => 4, 'AppEvnLastExecutionDate' => 5, 'AppEvnStatus' => 6, ),
+ BasePeer::TYPE_COLNAME => array (AppEventPeer::APP_UID => 0, AppEventPeer::DEL_INDEX => 1, AppEventPeer::EVN_UID => 2, AppEventPeer::APP_EVN_ACTION_DATE => 3, AppEventPeer::APP_EVN_ATTEMPTS => 4, AppEventPeer::APP_EVN_LAST_EXECUTION_DATE => 5, AppEventPeer::APP_EVN_STATUS => 6, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'EVN_UID' => 2, 'APP_EVN_ACTION_DATE' => 3, 'APP_EVN_ATTEMPTS' => 4, 'APP_EVN_LAST_EXECUTION_DATE' => 5, 'APP_EVN_STATUS' => 6, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppEventMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppEventMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppEventPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppEventPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppEventPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppEventPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppEventPeer::DEL_INDEX);
+
+ $criteria->addSelectColumn(AppEventPeer::EVN_UID);
+
+ $criteria->addSelectColumn(AppEventPeer::APP_EVN_ACTION_DATE);
+
+ $criteria->addSelectColumn(AppEventPeer::APP_EVN_ATTEMPTS);
+
+ $criteria->addSelectColumn(AppEventPeer::APP_EVN_LAST_EXECUTION_DATE);
+
+ $criteria->addSelectColumn(AppEventPeer::APP_EVN_STATUS);
+
+ }
+
+ const COUNT = 'COUNT(APP_EVENT.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_EVENT.APP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppEventPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppEventPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppEventPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppEvent
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppEventPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppEventPeer::populateObjects(AppEventPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppEventPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppEventPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppEventPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppEvent or Criteria object.
+ *
+ * @param mixed $values Criteria or AppEvent object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppEvent object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppEvent or Criteria object.
+ *
+ * @param mixed $values Criteria or AppEvent object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppEventPeer::APP_UID);
+ $selectCriteria->add(AppEventPeer::APP_UID, $criteria->remove(AppEventPeer::APP_UID), $comparison);
+
+ $comparison = $criteria->getComparison(AppEventPeer::DEL_INDEX);
+ $selectCriteria->add(AppEventPeer::DEL_INDEX, $criteria->remove(AppEventPeer::DEL_INDEX), $comparison);
+
+ $comparison = $criteria->getComparison(AppEventPeer::EVN_UID);
+ $selectCriteria->add(AppEventPeer::EVN_UID, $criteria->remove(AppEventPeer::EVN_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_EVENT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppEventPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppEvent or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppEvent object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppEventPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppEvent) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ }
+
+ $criteria->add(AppEventPeer::APP_UID, $vals[0], Criteria::IN);
+ $criteria->add(AppEventPeer::DEL_INDEX, $vals[1], Criteria::IN);
+ $criteria->add(AppEventPeer::EVN_UID, $vals[2], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppEvent object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppEvent $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppEvent $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppEventPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppEventPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AppEventPeer::DATABASE_NAME, AppEventPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $app_uid
+ * @param int $del_index
+ * @param string $evn_uid
+ * @param Connection $con
+ * @return AppEvent
+ */
+ public static function retrieveByPK($app_uid, $del_index, $evn_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(AppEventPeer::APP_UID, $app_uid);
+ $criteria->add(AppEventPeer::DEL_INDEX, $del_index);
+ $criteria->add(AppEventPeer::EVN_UID, $evn_uid);
+ $v = AppEventPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppEventPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppEventPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppEventMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppEventMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppEventMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppEventMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppFolder.php b/workflow/engine/classes/model/om/BaseAppFolder.php
index 196f0a776..0b55bdc84 100755
--- a/workflow/engine/classes/model/om/BaseAppFolder.php
+++ b/workflow/engine/classes/model/om/BaseAppFolder.php
@@ -16,745 +16,775 @@ include_once 'classes/model/AppFolderPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppFolder extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppFolderPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the folder_uid field.
- * @var string
- */
- protected $folder_uid = '';
-
-
- /**
- * The value for the folder_parent_uid field.
- * @var string
- */
- protected $folder_parent_uid = '';
-
-
- /**
- * The value for the folder_name field.
- * @var string
- */
- protected $folder_name;
-
-
- /**
- * The value for the folder_create_date field.
- * @var int
- */
- protected $folder_create_date;
-
-
- /**
- * The value for the folder_update_date field.
- * @var int
- */
- protected $folder_update_date;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [folder_uid] column value.
- *
- * @return string
- */
- public function getFolderUid()
- {
-
- return $this->folder_uid;
- }
-
- /**
- * Get the [folder_parent_uid] column value.
- *
- * @return string
- */
- public function getFolderParentUid()
- {
-
- return $this->folder_parent_uid;
- }
-
- /**
- * Get the [folder_name] column value.
- *
- * @return string
- */
- public function getFolderName()
- {
-
- return $this->folder_name;
- }
-
- /**
- * Get the [optionally formatted] [folder_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getFolderCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->folder_create_date === null || $this->folder_create_date === '') {
- return null;
- } elseif (!is_int($this->folder_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->folder_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [folder_create_date] as date/time value: " . var_export($this->folder_create_date, true));
- }
- } else {
- $ts = $this->folder_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [folder_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getFolderUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->folder_update_date === null || $this->folder_update_date === '') {
- return null;
- } elseif (!is_int($this->folder_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->folder_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [folder_update_date] as date/time value: " . var_export($this->folder_update_date, true));
- }
- } else {
- $ts = $this->folder_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [folder_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFolderUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->folder_uid !== $v || $v === '') {
- $this->folder_uid = $v;
- $this->modifiedColumns[] = AppFolderPeer::FOLDER_UID;
- }
-
- } // setFolderUid()
-
- /**
- * Set the value of [folder_parent_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFolderParentUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->folder_parent_uid !== $v || $v === '') {
- $this->folder_parent_uid = $v;
- $this->modifiedColumns[] = AppFolderPeer::FOLDER_PARENT_UID;
- }
-
- } // setFolderParentUid()
-
- /**
- * Set the value of [folder_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFolderName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->folder_name !== $v) {
- $this->folder_name = $v;
- $this->modifiedColumns[] = AppFolderPeer::FOLDER_NAME;
- }
-
- } // setFolderName()
-
- /**
- * Set the value of [folder_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFolderCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [folder_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->folder_create_date !== $ts) {
- $this->folder_create_date = $ts;
- $this->modifiedColumns[] = AppFolderPeer::FOLDER_CREATE_DATE;
- }
-
- } // setFolderCreateDate()
-
- /**
- * Set the value of [folder_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFolderUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [folder_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->folder_update_date !== $ts) {
- $this->folder_update_date = $ts;
- $this->modifiedColumns[] = AppFolderPeer::FOLDER_UPDATE_DATE;
- }
-
- } // setFolderUpdateDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->folder_uid = $rs->getString($startcol + 0);
-
- $this->folder_parent_uid = $rs->getString($startcol + 1);
-
- $this->folder_name = $rs->getString($startcol + 2);
-
- $this->folder_create_date = $rs->getTimestamp($startcol + 3, null);
-
- $this->folder_update_date = $rs->getTimestamp($startcol + 4, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = AppFolderPeer::NUM_COLUMNS - AppFolderPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppFolder object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppFolderPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppFolderPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppFolderPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppFolderPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppFolderPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppFolderPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppFolderPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getFolderUid();
- break;
- case 1:
- return $this->getFolderParentUid();
- break;
- case 2:
- return $this->getFolderName();
- break;
- case 3:
- return $this->getFolderCreateDate();
- break;
- case 4:
- return $this->getFolderUpdateDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppFolderPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getFolderUid(),
- $keys[1] => $this->getFolderParentUid(),
- $keys[2] => $this->getFolderName(),
- $keys[3] => $this->getFolderCreateDate(),
- $keys[4] => $this->getFolderUpdateDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppFolderPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setFolderUid($value);
- break;
- case 1:
- $this->setFolderParentUid($value);
- break;
- case 2:
- $this->setFolderName($value);
- break;
- case 3:
- $this->setFolderCreateDate($value);
- break;
- case 4:
- $this->setFolderUpdateDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppFolderPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setFolderUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setFolderParentUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setFolderName($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setFolderCreateDate($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setFolderUpdateDate($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppFolderPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppFolderPeer::FOLDER_UID)) $criteria->add(AppFolderPeer::FOLDER_UID, $this->folder_uid);
- if ($this->isColumnModified(AppFolderPeer::FOLDER_PARENT_UID)) $criteria->add(AppFolderPeer::FOLDER_PARENT_UID, $this->folder_parent_uid);
- if ($this->isColumnModified(AppFolderPeer::FOLDER_NAME)) $criteria->add(AppFolderPeer::FOLDER_NAME, $this->folder_name);
- if ($this->isColumnModified(AppFolderPeer::FOLDER_CREATE_DATE)) $criteria->add(AppFolderPeer::FOLDER_CREATE_DATE, $this->folder_create_date);
- if ($this->isColumnModified(AppFolderPeer::FOLDER_UPDATE_DATE)) $criteria->add(AppFolderPeer::FOLDER_UPDATE_DATE, $this->folder_update_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppFolderPeer::DATABASE_NAME);
-
- $criteria->add(AppFolderPeer::FOLDER_UID, $this->folder_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getFolderUid();
- }
-
- /**
- * Generic method to set the primary key (folder_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setFolderUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppFolder (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setFolderParentUid($this->folder_parent_uid);
-
- $copyObj->setFolderName($this->folder_name);
-
- $copyObj->setFolderCreateDate($this->folder_create_date);
-
- $copyObj->setFolderUpdateDate($this->folder_update_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setFolderUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppFolder Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppFolderPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppFolderPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppFolder
+abstract class BaseAppFolder extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppFolderPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the folder_uid field.
+ * @var string
+ */
+ protected $folder_uid = '';
+
+ /**
+ * The value for the folder_parent_uid field.
+ * @var string
+ */
+ protected $folder_parent_uid = '';
+
+ /**
+ * The value for the folder_name field.
+ * @var string
+ */
+ protected $folder_name;
+
+ /**
+ * The value for the folder_create_date field.
+ * @var int
+ */
+ protected $folder_create_date;
+
+ /**
+ * The value for the folder_update_date field.
+ * @var int
+ */
+ protected $folder_update_date;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [folder_uid] column value.
+ *
+ * @return string
+ */
+ public function getFolderUid()
+ {
+
+ return $this->folder_uid;
+ }
+
+ /**
+ * Get the [folder_parent_uid] column value.
+ *
+ * @return string
+ */
+ public function getFolderParentUid()
+ {
+
+ return $this->folder_parent_uid;
+ }
+
+ /**
+ * Get the [folder_name] column value.
+ *
+ * @return string
+ */
+ public function getFolderName()
+ {
+
+ return $this->folder_name;
+ }
+
+ /**
+ * Get the [optionally formatted] [folder_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getFolderCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->folder_create_date === null || $this->folder_create_date === '') {
+ return null;
+ } elseif (!is_int($this->folder_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->folder_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [folder_create_date] as date/time value: " .
+ var_export($this->folder_create_date, true));
+ }
+ } else {
+ $ts = $this->folder_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [folder_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getFolderUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->folder_update_date === null || $this->folder_update_date === '') {
+ return null;
+ } elseif (!is_int($this->folder_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->folder_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [folder_update_date] as date/time value: " .
+ var_export($this->folder_update_date, true));
+ }
+ } else {
+ $ts = $this->folder_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Set the value of [folder_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFolderUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->folder_uid !== $v || $v === '') {
+ $this->folder_uid = $v;
+ $this->modifiedColumns[] = AppFolderPeer::FOLDER_UID;
+ }
+
+ } // setFolderUid()
+
+ /**
+ * Set the value of [folder_parent_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFolderParentUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->folder_parent_uid !== $v || $v === '') {
+ $this->folder_parent_uid = $v;
+ $this->modifiedColumns[] = AppFolderPeer::FOLDER_PARENT_UID;
+ }
+
+ } // setFolderParentUid()
+
+ /**
+ * Set the value of [folder_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFolderName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->folder_name !== $v) {
+ $this->folder_name = $v;
+ $this->modifiedColumns[] = AppFolderPeer::FOLDER_NAME;
+ }
+
+ } // setFolderName()
+
+ /**
+ * Set the value of [folder_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFolderCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [folder_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->folder_create_date !== $ts) {
+ $this->folder_create_date = $ts;
+ $this->modifiedColumns[] = AppFolderPeer::FOLDER_CREATE_DATE;
+ }
+
+ } // setFolderCreateDate()
+
+ /**
+ * Set the value of [folder_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFolderUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [folder_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->folder_update_date !== $ts) {
+ $this->folder_update_date = $ts;
+ $this->modifiedColumns[] = AppFolderPeer::FOLDER_UPDATE_DATE;
+ }
+
+ } // setFolderUpdateDate()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->folder_uid = $rs->getString($startcol + 0);
+
+ $this->folder_parent_uid = $rs->getString($startcol + 1);
+
+ $this->folder_name = $rs->getString($startcol + 2);
+
+ $this->folder_create_date = $rs->getTimestamp($startcol + 3, null);
+
+ $this->folder_update_date = $rs->getTimestamp($startcol + 4, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = AppFolderPeer::NUM_COLUMNS - AppFolderPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppFolder object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppFolderPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppFolderPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppFolderPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppFolderPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppFolderPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppFolderPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppFolderPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getFolderUid();
+ break;
+ case 1:
+ return $this->getFolderParentUid();
+ break;
+ case 2:
+ return $this->getFolderName();
+ break;
+ case 3:
+ return $this->getFolderCreateDate();
+ break;
+ case 4:
+ return $this->getFolderUpdateDate();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppFolderPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getFolderUid(),
+ $keys[1] => $this->getFolderParentUid(),
+ $keys[2] => $this->getFolderName(),
+ $keys[3] => $this->getFolderCreateDate(),
+ $keys[4] => $this->getFolderUpdateDate(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppFolderPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setFolderUid($value);
+ break;
+ case 1:
+ $this->setFolderParentUid($value);
+ break;
+ case 2:
+ $this->setFolderName($value);
+ break;
+ case 3:
+ $this->setFolderCreateDate($value);
+ break;
+ case 4:
+ $this->setFolderUpdateDate($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppFolderPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setFolderUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setFolderParentUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setFolderName($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setFolderCreateDate($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setFolderUpdateDate($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppFolderPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppFolderPeer::FOLDER_UID)) {
+ $criteria->add(AppFolderPeer::FOLDER_UID, $this->folder_uid);
+ }
+
+ if ($this->isColumnModified(AppFolderPeer::FOLDER_PARENT_UID)) {
+ $criteria->add(AppFolderPeer::FOLDER_PARENT_UID, $this->folder_parent_uid);
+ }
+
+ if ($this->isColumnModified(AppFolderPeer::FOLDER_NAME)) {
+ $criteria->add(AppFolderPeer::FOLDER_NAME, $this->folder_name);
+ }
+
+ if ($this->isColumnModified(AppFolderPeer::FOLDER_CREATE_DATE)) {
+ $criteria->add(AppFolderPeer::FOLDER_CREATE_DATE, $this->folder_create_date);
+ }
+
+ if ($this->isColumnModified(AppFolderPeer::FOLDER_UPDATE_DATE)) {
+ $criteria->add(AppFolderPeer::FOLDER_UPDATE_DATE, $this->folder_update_date);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppFolderPeer::DATABASE_NAME);
+
+ $criteria->add(AppFolderPeer::FOLDER_UID, $this->folder_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getFolderUid();
+ }
+
+ /**
+ * Generic method to set the primary key (folder_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setFolderUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppFolder (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setFolderParentUid($this->folder_parent_uid);
+
+ $copyObj->setFolderName($this->folder_name);
+
+ $copyObj->setFolderCreateDate($this->folder_create_date);
+
+ $copyObj->setFolderUpdateDate($this->folder_update_date);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setFolderUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppFolder Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppFolderPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppFolderPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseAppFolderPeer.php b/workflow/engine/classes/model/om/BaseAppFolderPeer.php
index f248c1618..73be0c03e 100755
--- a/workflow/engine/classes/model/om/BaseAppFolderPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppFolderPeer.php
@@ -12,574 +12,576 @@ include_once 'classes/model/AppFolder.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppFolderPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'APP_FOLDER';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppFolder';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the FOLDER_UID field */
- const FOLDER_UID = 'APP_FOLDER.FOLDER_UID';
-
- /** the column name for the FOLDER_PARENT_UID field */
- const FOLDER_PARENT_UID = 'APP_FOLDER.FOLDER_PARENT_UID';
-
- /** the column name for the FOLDER_NAME field */
- const FOLDER_NAME = 'APP_FOLDER.FOLDER_NAME';
-
- /** the column name for the FOLDER_CREATE_DATE field */
- const FOLDER_CREATE_DATE = 'APP_FOLDER.FOLDER_CREATE_DATE';
-
- /** the column name for the FOLDER_UPDATE_DATE field */
- const FOLDER_UPDATE_DATE = 'APP_FOLDER.FOLDER_UPDATE_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('FolderUid', 'FolderParentUid', 'FolderName', 'FolderCreateDate', 'FolderUpdateDate', ),
- BasePeer::TYPE_COLNAME => array (AppFolderPeer::FOLDER_UID, AppFolderPeer::FOLDER_PARENT_UID, AppFolderPeer::FOLDER_NAME, AppFolderPeer::FOLDER_CREATE_DATE, AppFolderPeer::FOLDER_UPDATE_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('FOLDER_UID', 'FOLDER_PARENT_UID', 'FOLDER_NAME', 'FOLDER_CREATE_DATE', 'FOLDER_UPDATE_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('FolderUid' => 0, 'FolderParentUid' => 1, 'FolderName' => 2, 'FolderCreateDate' => 3, 'FolderUpdateDate' => 4, ),
- BasePeer::TYPE_COLNAME => array (AppFolderPeer::FOLDER_UID => 0, AppFolderPeer::FOLDER_PARENT_UID => 1, AppFolderPeer::FOLDER_NAME => 2, AppFolderPeer::FOLDER_CREATE_DATE => 3, AppFolderPeer::FOLDER_UPDATE_DATE => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('FOLDER_UID' => 0, 'FOLDER_PARENT_UID' => 1, 'FOLDER_NAME' => 2, 'FOLDER_CREATE_DATE' => 3, 'FOLDER_UPDATE_DATE' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppFolderMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppFolderMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppFolderPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppFolderPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppFolderPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppFolderPeer::FOLDER_UID);
-
- $criteria->addSelectColumn(AppFolderPeer::FOLDER_PARENT_UID);
-
- $criteria->addSelectColumn(AppFolderPeer::FOLDER_NAME);
-
- $criteria->addSelectColumn(AppFolderPeer::FOLDER_CREATE_DATE);
-
- $criteria->addSelectColumn(AppFolderPeer::FOLDER_UPDATE_DATE);
-
- }
-
- const COUNT = 'COUNT(APP_FOLDER.FOLDER_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_FOLDER.FOLDER_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppFolderPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppFolderPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppFolderPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppFolder
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppFolderPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppFolderPeer::populateObjects(AppFolderPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppFolderPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppFolderPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppFolderPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppFolder or Criteria object.
- *
- * @param mixed $values Criteria or AppFolder object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppFolder object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppFolder or Criteria object.
- *
- * @param mixed $values Criteria or AppFolder object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppFolderPeer::FOLDER_UID);
- $selectCriteria->add(AppFolderPeer::FOLDER_UID, $criteria->remove(AppFolderPeer::FOLDER_UID), $comparison);
-
- } else { // $values is AppFolder object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_FOLDER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppFolderPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppFolder or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppFolder object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppFolderPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppFolder) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(AppFolderPeer::FOLDER_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppFolder object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppFolder $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppFolder $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppFolderPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppFolderPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AppFolderPeer::DATABASE_NAME, AppFolderPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return AppFolder
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(AppFolderPeer::DATABASE_NAME);
-
- $criteria->add(AppFolderPeer::FOLDER_UID, $pk);
-
-
- $v = AppFolderPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(AppFolderPeer::FOLDER_UID, $pks, Criteria::IN);
- $objs = AppFolderPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseAppFolderPeer
+abstract class BaseAppFolderPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_FOLDER';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppFolder';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the FOLDER_UID field */
+ const FOLDER_UID = 'APP_FOLDER.FOLDER_UID';
+
+ /** the column name for the FOLDER_PARENT_UID field */
+ const FOLDER_PARENT_UID = 'APP_FOLDER.FOLDER_PARENT_UID';
+
+ /** the column name for the FOLDER_NAME field */
+ const FOLDER_NAME = 'APP_FOLDER.FOLDER_NAME';
+
+ /** the column name for the FOLDER_CREATE_DATE field */
+ const FOLDER_CREATE_DATE = 'APP_FOLDER.FOLDER_CREATE_DATE';
+
+ /** the column name for the FOLDER_UPDATE_DATE field */
+ const FOLDER_UPDATE_DATE = 'APP_FOLDER.FOLDER_UPDATE_DATE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('FolderUid', 'FolderParentUid', 'FolderName', 'FolderCreateDate', 'FolderUpdateDate', ),
+ BasePeer::TYPE_COLNAME => array (AppFolderPeer::FOLDER_UID, AppFolderPeer::FOLDER_PARENT_UID, AppFolderPeer::FOLDER_NAME, AppFolderPeer::FOLDER_CREATE_DATE, AppFolderPeer::FOLDER_UPDATE_DATE, ),
+ BasePeer::TYPE_FIELDNAME => array ('FOLDER_UID', 'FOLDER_PARENT_UID', 'FOLDER_NAME', 'FOLDER_CREATE_DATE', 'FOLDER_UPDATE_DATE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('FolderUid' => 0, 'FolderParentUid' => 1, 'FolderName' => 2, 'FolderCreateDate' => 3, 'FolderUpdateDate' => 4, ),
+ BasePeer::TYPE_COLNAME => array (AppFolderPeer::FOLDER_UID => 0, AppFolderPeer::FOLDER_PARENT_UID => 1, AppFolderPeer::FOLDER_NAME => 2, AppFolderPeer::FOLDER_CREATE_DATE => 3, AppFolderPeer::FOLDER_UPDATE_DATE => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('FOLDER_UID' => 0, 'FOLDER_PARENT_UID' => 1, 'FOLDER_NAME' => 2, 'FOLDER_CREATE_DATE' => 3, 'FOLDER_UPDATE_DATE' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppFolderMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppFolderMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppFolderPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppFolderPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppFolderPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppFolderPeer::FOLDER_UID);
+
+ $criteria->addSelectColumn(AppFolderPeer::FOLDER_PARENT_UID);
+
+ $criteria->addSelectColumn(AppFolderPeer::FOLDER_NAME);
+
+ $criteria->addSelectColumn(AppFolderPeer::FOLDER_CREATE_DATE);
+
+ $criteria->addSelectColumn(AppFolderPeer::FOLDER_UPDATE_DATE);
+
+ }
+
+ const COUNT = 'COUNT(APP_FOLDER.FOLDER_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_FOLDER.FOLDER_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppFolderPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppFolderPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppFolderPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppFolder
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppFolderPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppFolderPeer::populateObjects(AppFolderPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppFolderPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppFolderPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppFolderPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppFolder or Criteria object.
+ *
+ * @param mixed $values Criteria or AppFolder object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppFolder object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppFolder or Criteria object.
+ *
+ * @param mixed $values Criteria or AppFolder object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppFolderPeer::FOLDER_UID);
+ $selectCriteria->add(AppFolderPeer::FOLDER_UID, $criteria->remove(AppFolderPeer::FOLDER_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_FOLDER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppFolderPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppFolder or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppFolder object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppFolderPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppFolder) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(AppFolderPeer::FOLDER_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppFolder object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppFolder $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppFolder $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppFolderPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppFolderPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AppFolderPeer::DATABASE_NAME, AppFolderPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return AppFolder
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(AppFolderPeer::DATABASE_NAME);
+
+ $criteria->add(AppFolderPeer::FOLDER_UID, $pk);
+
+
+ $v = AppFolderPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(AppFolderPeer::FOLDER_UID, $pks, Criteria::IN);
+ $objs = AppFolderPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppFolderPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppFolderPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppFolderMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppFolderMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppFolderMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppFolderMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppHistory.php b/workflow/engine/classes/model/om/BaseAppHistory.php
index 1209930f3..ecdde0373 100755
--- a/workflow/engine/classes/model/om/BaseAppHistory.php
+++ b/workflow/engine/classes/model/om/BaseAppHistory.php
@@ -16,938 +16,986 @@ include_once 'classes/model/AppHistoryPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppHistory extends BaseObject implements Persistent {
+abstract class BaseAppHistory extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppHistoryPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the del_index field.
+ * @var int
+ */
+ protected $del_index = 0;
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the dyn_uid field.
+ * @var string
+ */
+ protected $dyn_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the app_status field.
+ * @var string
+ */
+ protected $app_status = '';
+
+ /**
+ * The value for the history_date field.
+ * @var int
+ */
+ protected $history_date;
+
+ /**
+ * The value for the history_data field.
+ * @var string
+ */
+ protected $history_data;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [del_index] column value.
+ *
+ * @return int
+ */
+ public function getDelIndex()
+ {
+
+ return $this->del_index;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [dyn_uid] column value.
+ *
+ * @return string
+ */
+ public function getDynUid()
+ {
+
+ return $this->dyn_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [app_status] column value.
+ *
+ * @return string
+ */
+ public function getAppStatus()
+ {
+
+ return $this->app_status;
+ }
+
+ /**
+ * Get the [optionally formatted] [history_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getHistoryDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->history_date === null || $this->history_date === '') {
+ return null;
+ } elseif (!is_int($this->history_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->history_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [history_date] as date/time value: " .
+ var_export($this->history_date, true));
+ }
+ } else {
+ $ts = $this->history_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [history_data] column value.
+ *
+ * @return string
+ */
+ public function getHistoryData()
+ {
+
+ return $this->history_data;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndex($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->del_index !== $v || $v === 0) {
+ $this->del_index = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::DEL_INDEX;
+ }
+
+ } // setDelIndex()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [dyn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDynUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dyn_uid !== $v || $v === '') {
+ $this->dyn_uid = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::DYN_UID;
+ }
+
+ } // setDynUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [app_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_status !== $v || $v === '') {
+ $this->app_status = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::APP_STATUS;
+ }
+
+ } // setAppStatus()
+
+ /**
+ * Set the value of [history_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setHistoryDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [history_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->history_date !== $ts) {
+ $this->history_date = $ts;
+ $this->modifiedColumns[] = AppHistoryPeer::HISTORY_DATE;
+ }
+
+ } // setHistoryDate()
+
+ /**
+ * Set the value of [history_data] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setHistoryData($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->history_data !== $v) {
+ $this->history_data = $v;
+ $this->modifiedColumns[] = AppHistoryPeer::HISTORY_DATA;
+ }
+
+ } // setHistoryData()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->del_index = $rs->getInt($startcol + 1);
+
+ $this->pro_uid = $rs->getString($startcol + 2);
+
+ $this->tas_uid = $rs->getString($startcol + 3);
+
+ $this->dyn_uid = $rs->getString($startcol + 4);
+
+ $this->usr_uid = $rs->getString($startcol + 5);
+
+ $this->app_status = $rs->getString($startcol + 6);
+
+ $this->history_date = $rs->getTimestamp($startcol + 7, null);
+
+ $this->history_data = $rs->getString($startcol + 8);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 9; // 9 = AppHistoryPeer::NUM_COLUMNS - AppHistoryPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppHistory object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppHistoryPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppHistoryPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppHistoryPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppHistoryPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppHistoryPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppHistoryPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppHistoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getDelIndex();
+ break;
+ case 2:
+ return $this->getProUid();
+ break;
+ case 3:
+ return $this->getTasUid();
+ break;
+ case 4:
+ return $this->getDynUid();
+ break;
+ case 5:
+ return $this->getUsrUid();
+ break;
+ case 6:
+ return $this->getAppStatus();
+ break;
+ case 7:
+ return $this->getHistoryDate();
+ break;
+ case 8:
+ return $this->getHistoryData();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppHistoryPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getDelIndex(),
+ $keys[2] => $this->getProUid(),
+ $keys[3] => $this->getTasUid(),
+ $keys[4] => $this->getDynUid(),
+ $keys[5] => $this->getUsrUid(),
+ $keys[6] => $this->getAppStatus(),
+ $keys[7] => $this->getHistoryDate(),
+ $keys[8] => $this->getHistoryData(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppHistoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setDelIndex($value);
+ break;
+ case 2:
+ $this->setProUid($value);
+ break;
+ case 3:
+ $this->setTasUid($value);
+ break;
+ case 4:
+ $this->setDynUid($value);
+ break;
+ case 5:
+ $this->setUsrUid($value);
+ break;
+ case 6:
+ $this->setAppStatus($value);
+ break;
+ case 7:
+ $this->setHistoryDate($value);
+ break;
+ case 8:
+ $this->setHistoryData($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppHistoryPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDelIndex($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setProUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setTasUid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setDynUid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setUsrUid($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setAppStatus($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setHistoryDate($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setHistoryData($arr[$keys[8]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppHistoryPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppHistoryPeer::APP_UID)) {
+ $criteria->add(AppHistoryPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::DEL_INDEX)) {
+ $criteria->add(AppHistoryPeer::DEL_INDEX, $this->del_index);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::PRO_UID)) {
+ $criteria->add(AppHistoryPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::TAS_UID)) {
+ $criteria->add(AppHistoryPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::DYN_UID)) {
+ $criteria->add(AppHistoryPeer::DYN_UID, $this->dyn_uid);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::USR_UID)) {
+ $criteria->add(AppHistoryPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::APP_STATUS)) {
+ $criteria->add(AppHistoryPeer::APP_STATUS, $this->app_status);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::HISTORY_DATE)) {
+ $criteria->add(AppHistoryPeer::HISTORY_DATE, $this->history_date);
+ }
+
+ if ($this->isColumnModified(AppHistoryPeer::HISTORY_DATA)) {
+ $criteria->add(AppHistoryPeer::HISTORY_DATA, $this->history_data);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppHistoryPeer::DATABASE_NAME);
+
+
+ return $criteria;
+ }
+
+ /**
+ * Returns NULL since this table doesn't have a primary key.
+ * This method exists only for BC and is deprecated!
+ * @return null
+ */
+ public function getPrimaryKey()
+ {
+ return null;
+ }
+
+ /**
+ * Dummy primary key setter.
+ *
+ * This function only exists to preserve backwards compatibility. It is no longer
+ * needed or required by the Persistent interface. It will be removed in next BC-breaking
+ * release of Propel.
+ *
+ * @deprecated
+ */
+ public function setPrimaryKey($pk)
+ {
+ // do nothing, because this object doesn't have any primary keys
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppHistory (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAppUid($this->app_uid);
+
+ $copyObj->setDelIndex($this->del_index);
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTasUid($this->tas_uid);
+
+ $copyObj->setDynUid($this->dyn_uid);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+ $copyObj->setAppStatus($this->app_status);
+
+ $copyObj->setHistoryDate($this->history_date);
+
+ $copyObj->setHistoryData($this->history_data);
+
+
+ $copyObj->setNew(true);
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppHistory Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppHistoryPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppHistoryPeer();
+ }
+ return self::$peer;
+ }
+}
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppHistoryPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the del_index field.
- * @var int
- */
- protected $del_index = 0;
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
-
-
- /**
- * The value for the dyn_uid field.
- * @var string
- */
- protected $dyn_uid = '';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
-
- /**
- * The value for the app_status field.
- * @var string
- */
- protected $app_status = '';
-
-
- /**
- * The value for the history_date field.
- * @var int
- */
- protected $history_date;
-
-
- /**
- * The value for the history_data field.
- * @var string
- */
- protected $history_data;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [del_index] column value.
- *
- * @return int
- */
- public function getDelIndex()
- {
-
- return $this->del_index;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [dyn_uid] column value.
- *
- * @return string
- */
- public function getDynUid()
- {
-
- return $this->dyn_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [app_status] column value.
- *
- * @return string
- */
- public function getAppStatus()
- {
-
- return $this->app_status;
- }
-
- /**
- * Get the [optionally formatted] [history_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getHistoryDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->history_date === null || $this->history_date === '') {
- return null;
- } elseif (!is_int($this->history_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->history_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [history_date] as date/time value: " . var_export($this->history_date, true));
- }
- } else {
- $ts = $this->history_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [history_data] column value.
- *
- * @return string
- */
- public function getHistoryData()
- {
-
- return $this->history_data;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppHistoryPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndex($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->del_index !== $v || $v === 0) {
- $this->del_index = $v;
- $this->modifiedColumns[] = AppHistoryPeer::DEL_INDEX;
- }
-
- } // setDelIndex()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = AppHistoryPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = AppHistoryPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [dyn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDynUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dyn_uid !== $v || $v === '') {
- $this->dyn_uid = $v;
- $this->modifiedColumns[] = AppHistoryPeer::DYN_UID;
- }
-
- } // setDynUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = AppHistoryPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [app_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_status !== $v || $v === '') {
- $this->app_status = $v;
- $this->modifiedColumns[] = AppHistoryPeer::APP_STATUS;
- }
-
- } // setAppStatus()
-
- /**
- * Set the value of [history_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setHistoryDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [history_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->history_date !== $ts) {
- $this->history_date = $ts;
- $this->modifiedColumns[] = AppHistoryPeer::HISTORY_DATE;
- }
-
- } // setHistoryDate()
-
- /**
- * Set the value of [history_data] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setHistoryData($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->history_data !== $v) {
- $this->history_data = $v;
- $this->modifiedColumns[] = AppHistoryPeer::HISTORY_DATA;
- }
-
- } // setHistoryData()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->del_index = $rs->getInt($startcol + 1);
-
- $this->pro_uid = $rs->getString($startcol + 2);
-
- $this->tas_uid = $rs->getString($startcol + 3);
-
- $this->dyn_uid = $rs->getString($startcol + 4);
-
- $this->usr_uid = $rs->getString($startcol + 5);
-
- $this->app_status = $rs->getString($startcol + 6);
-
- $this->history_date = $rs->getTimestamp($startcol + 7, null);
-
- $this->history_data = $rs->getString($startcol + 8);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 9; // 9 = AppHistoryPeer::NUM_COLUMNS - AppHistoryPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppHistory object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppHistoryPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppHistoryPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppHistoryPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppHistoryPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppHistoryPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppHistoryPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppHistoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getDelIndex();
- break;
- case 2:
- return $this->getProUid();
- break;
- case 3:
- return $this->getTasUid();
- break;
- case 4:
- return $this->getDynUid();
- break;
- case 5:
- return $this->getUsrUid();
- break;
- case 6:
- return $this->getAppStatus();
- break;
- case 7:
- return $this->getHistoryDate();
- break;
- case 8:
- return $this->getHistoryData();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppHistoryPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getDelIndex(),
- $keys[2] => $this->getProUid(),
- $keys[3] => $this->getTasUid(),
- $keys[4] => $this->getDynUid(),
- $keys[5] => $this->getUsrUid(),
- $keys[6] => $this->getAppStatus(),
- $keys[7] => $this->getHistoryDate(),
- $keys[8] => $this->getHistoryData(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppHistoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setDelIndex($value);
- break;
- case 2:
- $this->setProUid($value);
- break;
- case 3:
- $this->setTasUid($value);
- break;
- case 4:
- $this->setDynUid($value);
- break;
- case 5:
- $this->setUsrUid($value);
- break;
- case 6:
- $this->setAppStatus($value);
- break;
- case 7:
- $this->setHistoryDate($value);
- break;
- case 8:
- $this->setHistoryData($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppHistoryPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDelIndex($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setProUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setTasUid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDynUid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setUsrUid($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setAppStatus($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setHistoryDate($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setHistoryData($arr[$keys[8]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppHistoryPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppHistoryPeer::APP_UID)) $criteria->add(AppHistoryPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppHistoryPeer::DEL_INDEX)) $criteria->add(AppHistoryPeer::DEL_INDEX, $this->del_index);
- if ($this->isColumnModified(AppHistoryPeer::PRO_UID)) $criteria->add(AppHistoryPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(AppHistoryPeer::TAS_UID)) $criteria->add(AppHistoryPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(AppHistoryPeer::DYN_UID)) $criteria->add(AppHistoryPeer::DYN_UID, $this->dyn_uid);
- if ($this->isColumnModified(AppHistoryPeer::USR_UID)) $criteria->add(AppHistoryPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(AppHistoryPeer::APP_STATUS)) $criteria->add(AppHistoryPeer::APP_STATUS, $this->app_status);
- if ($this->isColumnModified(AppHistoryPeer::HISTORY_DATE)) $criteria->add(AppHistoryPeer::HISTORY_DATE, $this->history_date);
- if ($this->isColumnModified(AppHistoryPeer::HISTORY_DATA)) $criteria->add(AppHistoryPeer::HISTORY_DATA, $this->history_data);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppHistoryPeer::DATABASE_NAME);
-
-
- return $criteria;
- }
-
- /**
- * Returns NULL since this table doesn't have a primary key.
- * This method exists only for BC and is deprecated!
- * @return null
- */
- public function getPrimaryKey()
- {
- return null;
- }
-
- /**
- * Dummy primary key setter.
- *
- * This function only exists to preserve backwards compatibility. It is no longer
- * needed or required by the Persistent interface. It will be removed in next BC-breaking
- * release of Propel.
- *
- * @deprecated
- */
- public function setPrimaryKey($pk)
- {
- // do nothing, because this object doesn't have any primary keys
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppHistory (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppUid($this->app_uid);
-
- $copyObj->setDelIndex($this->del_index);
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setDynUid($this->dyn_uid);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setAppStatus($this->app_status);
-
- $copyObj->setHistoryDate($this->history_date);
-
- $copyObj->setHistoryData($this->history_data);
-
-
- $copyObj->setNew(true);
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppHistory Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppHistoryPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppHistoryPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppHistory
diff --git a/workflow/engine/classes/model/om/BaseAppHistoryPeer.php b/workflow/engine/classes/model/om/BaseAppHistoryPeer.php
index 2e076f831..33148f6c3 100755
--- a/workflow/engine/classes/model/om/BaseAppHistoryPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppHistoryPeer.php
@@ -12,556 +12,556 @@ include_once 'classes/model/AppHistory.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppHistoryPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'APP_HISTORY';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppHistory';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 9;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_HISTORY.APP_UID';
-
- /** the column name for the DEL_INDEX field */
- const DEL_INDEX = 'APP_HISTORY.DEL_INDEX';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'APP_HISTORY.PRO_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'APP_HISTORY.TAS_UID';
-
- /** the column name for the DYN_UID field */
- const DYN_UID = 'APP_HISTORY.DYN_UID';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'APP_HISTORY.USR_UID';
-
- /** the column name for the APP_STATUS field */
- const APP_STATUS = 'APP_HISTORY.APP_STATUS';
-
- /** the column name for the HISTORY_DATE field */
- const HISTORY_DATE = 'APP_HISTORY.HISTORY_DATE';
-
- /** the column name for the HISTORY_DATA field */
- const HISTORY_DATA = 'APP_HISTORY.HISTORY_DATA';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'ProUid', 'TasUid', 'DynUid', 'UsrUid', 'AppStatus', 'HistoryDate', 'HistoryData', ),
- BasePeer::TYPE_COLNAME => array (AppHistoryPeer::APP_UID, AppHistoryPeer::DEL_INDEX, AppHistoryPeer::PRO_UID, AppHistoryPeer::TAS_UID, AppHistoryPeer::DYN_UID, AppHistoryPeer::USR_UID, AppHistoryPeer::APP_STATUS, AppHistoryPeer::HISTORY_DATE, AppHistoryPeer::HISTORY_DATA, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'PRO_UID', 'TAS_UID', 'DYN_UID', 'USR_UID', 'APP_STATUS', 'HISTORY_DATE', 'HISTORY_DATA', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'ProUid' => 2, 'TasUid' => 3, 'DynUid' => 4, 'UsrUid' => 5, 'AppStatus' => 6, 'HistoryDate' => 7, 'HistoryData' => 8, ),
- BasePeer::TYPE_COLNAME => array (AppHistoryPeer::APP_UID => 0, AppHistoryPeer::DEL_INDEX => 1, AppHistoryPeer::PRO_UID => 2, AppHistoryPeer::TAS_UID => 3, AppHistoryPeer::DYN_UID => 4, AppHistoryPeer::USR_UID => 5, AppHistoryPeer::APP_STATUS => 6, AppHistoryPeer::HISTORY_DATE => 7, AppHistoryPeer::HISTORY_DATA => 8, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'PRO_UID' => 2, 'TAS_UID' => 3, 'DYN_UID' => 4, 'USR_UID' => 5, 'APP_STATUS' => 6, 'HISTORY_DATE' => 7, 'HISTORY_DATA' => 8, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppHistoryMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppHistoryMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppHistoryPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppHistoryPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppHistoryPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppHistoryPeer::APP_UID);
-
- $criteria->addSelectColumn(AppHistoryPeer::DEL_INDEX);
-
- $criteria->addSelectColumn(AppHistoryPeer::PRO_UID);
-
- $criteria->addSelectColumn(AppHistoryPeer::TAS_UID);
-
- $criteria->addSelectColumn(AppHistoryPeer::DYN_UID);
-
- $criteria->addSelectColumn(AppHistoryPeer::USR_UID);
-
- $criteria->addSelectColumn(AppHistoryPeer::APP_STATUS);
-
- $criteria->addSelectColumn(AppHistoryPeer::HISTORY_DATE);
-
- $criteria->addSelectColumn(AppHistoryPeer::HISTORY_DATA);
-
- }
-
- const COUNT = 'COUNT(*)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT *)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppHistoryPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppHistoryPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppHistoryPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppHistory
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppHistoryPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppHistoryPeer::populateObjects(AppHistoryPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppHistoryPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppHistoryPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppHistoryPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppHistory or Criteria object.
- *
- * @param mixed $values Criteria or AppHistory object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppHistory object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppHistory or Criteria object.
- *
- * @param mixed $values Criteria or AppHistory object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- } else { // $values is AppHistory object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_HISTORY table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppHistoryPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppHistory or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppHistory object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppHistoryPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppHistory) {
-
- $criteria = $values->buildCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- }
-
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppHistory object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppHistory $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppHistory $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppHistoryPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppHistoryPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AppHistoryPeer::DATABASE_NAME, AppHistoryPeer::TABLE_NAME, $columns);
- }
-
-} // BaseAppHistoryPeer
+abstract class BaseAppHistoryPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_HISTORY';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppHistory';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 9;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_HISTORY.APP_UID';
+
+ /** the column name for the DEL_INDEX field */
+ const DEL_INDEX = 'APP_HISTORY.DEL_INDEX';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'APP_HISTORY.PRO_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'APP_HISTORY.TAS_UID';
+
+ /** the column name for the DYN_UID field */
+ const DYN_UID = 'APP_HISTORY.DYN_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'APP_HISTORY.USR_UID';
+
+ /** the column name for the APP_STATUS field */
+ const APP_STATUS = 'APP_HISTORY.APP_STATUS';
+
+ /** the column name for the HISTORY_DATE field */
+ const HISTORY_DATE = 'APP_HISTORY.HISTORY_DATE';
+
+ /** the column name for the HISTORY_DATA field */
+ const HISTORY_DATA = 'APP_HISTORY.HISTORY_DATA';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'ProUid', 'TasUid', 'DynUid', 'UsrUid', 'AppStatus', 'HistoryDate', 'HistoryData', ),
+ BasePeer::TYPE_COLNAME => array (AppHistoryPeer::APP_UID, AppHistoryPeer::DEL_INDEX, AppHistoryPeer::PRO_UID, AppHistoryPeer::TAS_UID, AppHistoryPeer::DYN_UID, AppHistoryPeer::USR_UID, AppHistoryPeer::APP_STATUS, AppHistoryPeer::HISTORY_DATE, AppHistoryPeer::HISTORY_DATA, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'PRO_UID', 'TAS_UID', 'DYN_UID', 'USR_UID', 'APP_STATUS', 'HISTORY_DATE', 'HISTORY_DATA', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'ProUid' => 2, 'TasUid' => 3, 'DynUid' => 4, 'UsrUid' => 5, 'AppStatus' => 6, 'HistoryDate' => 7, 'HistoryData' => 8, ),
+ BasePeer::TYPE_COLNAME => array (AppHistoryPeer::APP_UID => 0, AppHistoryPeer::DEL_INDEX => 1, AppHistoryPeer::PRO_UID => 2, AppHistoryPeer::TAS_UID => 3, AppHistoryPeer::DYN_UID => 4, AppHistoryPeer::USR_UID => 5, AppHistoryPeer::APP_STATUS => 6, AppHistoryPeer::HISTORY_DATE => 7, AppHistoryPeer::HISTORY_DATA => 8, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'PRO_UID' => 2, 'TAS_UID' => 3, 'DYN_UID' => 4, 'USR_UID' => 5, 'APP_STATUS' => 6, 'HISTORY_DATE' => 7, 'HISTORY_DATA' => 8, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppHistoryMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppHistoryMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppHistoryPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppHistoryPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppHistoryPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppHistoryPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppHistoryPeer::DEL_INDEX);
+
+ $criteria->addSelectColumn(AppHistoryPeer::PRO_UID);
+
+ $criteria->addSelectColumn(AppHistoryPeer::TAS_UID);
+
+ $criteria->addSelectColumn(AppHistoryPeer::DYN_UID);
+
+ $criteria->addSelectColumn(AppHistoryPeer::USR_UID);
+
+ $criteria->addSelectColumn(AppHistoryPeer::APP_STATUS);
+
+ $criteria->addSelectColumn(AppHistoryPeer::HISTORY_DATE);
+
+ $criteria->addSelectColumn(AppHistoryPeer::HISTORY_DATA);
+
+ }
+
+ const COUNT = 'COUNT(*)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT *)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppHistoryPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppHistoryPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppHistoryPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppHistory
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppHistoryPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppHistoryPeer::populateObjects(AppHistoryPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppHistoryPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppHistoryPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppHistoryPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppHistory or Criteria object.
+ *
+ * @param mixed $values Criteria or AppHistory object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppHistory object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppHistory or Criteria object.
+ *
+ * @param mixed $values Criteria or AppHistory object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_HISTORY table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppHistoryPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppHistory or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppHistory object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppHistoryPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppHistory) {
+
+ $criteria = $values->buildCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ }
+
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppHistory object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppHistory $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppHistory $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppHistoryPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppHistoryPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AppHistoryPeer::DATABASE_NAME, AppHistoryPeer::TABLE_NAME, $columns);
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppHistoryPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppHistoryPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppHistoryMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppHistoryMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppHistoryMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppHistoryMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppMessage.php b/workflow/engine/classes/model/om/BaseAppMessage.php
index 26d8323a7..7db015745 100755
--- a/workflow/engine/classes/model/om/BaseAppMessage.php
+++ b/workflow/engine/classes/model/om/BaseAppMessage.php
@@ -16,1328 +16,1413 @@ include_once 'classes/model/AppMessagePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppMessage extends BaseObject implements Persistent {
+abstract class BaseAppMessage extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppMessagePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_msg_uid field.
+ * @var string
+ */
+ protected $app_msg_uid;
+
+ /**
+ * The value for the msg_uid field.
+ * @var string
+ */
+ protected $msg_uid;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the del_index field.
+ * @var int
+ */
+ protected $del_index = 0;
+
+ /**
+ * The value for the app_msg_type field.
+ * @var string
+ */
+ protected $app_msg_type = '';
+
+ /**
+ * The value for the app_msg_subject field.
+ * @var string
+ */
+ protected $app_msg_subject = '';
+
+ /**
+ * The value for the app_msg_from field.
+ * @var string
+ */
+ protected $app_msg_from = '';
+
+ /**
+ * The value for the app_msg_to field.
+ * @var string
+ */
+ protected $app_msg_to;
+
+ /**
+ * The value for the app_msg_body field.
+ * @var string
+ */
+ protected $app_msg_body;
+
+ /**
+ * The value for the app_msg_date field.
+ * @var int
+ */
+ protected $app_msg_date;
+
+ /**
+ * The value for the app_msg_cc field.
+ * @var string
+ */
+ protected $app_msg_cc;
+
+ /**
+ * The value for the app_msg_bcc field.
+ * @var string
+ */
+ protected $app_msg_bcc;
+
+ /**
+ * The value for the app_msg_template field.
+ * @var string
+ */
+ protected $app_msg_template;
+
+ /**
+ * The value for the app_msg_status field.
+ * @var string
+ */
+ protected $app_msg_status;
+
+ /**
+ * The value for the app_msg_attach field.
+ * @var string
+ */
+ protected $app_msg_attach;
+
+ /**
+ * The value for the app_msg_send_date field.
+ * @var int
+ */
+ protected $app_msg_send_date;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_msg_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgUid()
+ {
+
+ return $this->app_msg_uid;
+ }
+
+ /**
+ * Get the [msg_uid] column value.
+ *
+ * @return string
+ */
+ public function getMsgUid()
+ {
+
+ return $this->msg_uid;
+ }
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [del_index] column value.
+ *
+ * @return int
+ */
+ public function getDelIndex()
+ {
+
+ return $this->del_index;
+ }
+
+ /**
+ * Get the [app_msg_type] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgType()
+ {
+
+ return $this->app_msg_type;
+ }
+
+ /**
+ * Get the [app_msg_subject] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgSubject()
+ {
+
+ return $this->app_msg_subject;
+ }
+
+ /**
+ * Get the [app_msg_from] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgFrom()
+ {
+
+ return $this->app_msg_from;
+ }
+
+ /**
+ * Get the [app_msg_to] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgTo()
+ {
+
+ return $this->app_msg_to;
+ }
+
+ /**
+ * Get the [app_msg_body] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgBody()
+ {
+
+ return $this->app_msg_body;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_msg_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppMsgDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_msg_date === null || $this->app_msg_date === '') {
+ return null;
+ } elseif (!is_int($this->app_msg_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_msg_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_msg_date] as date/time value: " .
+ var_export($this->app_msg_date, true));
+ }
+ } else {
+ $ts = $this->app_msg_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_msg_cc] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgCc()
+ {
+
+ return $this->app_msg_cc;
+ }
+
+ /**
+ * Get the [app_msg_bcc] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgBcc()
+ {
+
+ return $this->app_msg_bcc;
+ }
+
+ /**
+ * Get the [app_msg_template] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgTemplate()
+ {
+
+ return $this->app_msg_template;
+ }
+
+ /**
+ * Get the [app_msg_status] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgStatus()
+ {
+
+ return $this->app_msg_status;
+ }
+
+ /**
+ * Get the [app_msg_attach] column value.
+ *
+ * @return string
+ */
+ public function getAppMsgAttach()
+ {
+
+ return $this->app_msg_attach;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_msg_send_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppMsgSendDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_msg_send_date === null || $this->app_msg_send_date === '') {
+ return null;
+ } elseif (!is_int($this->app_msg_send_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_msg_send_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_msg_send_date] as date/time value: " .
+ var_export($this->app_msg_send_date, true));
+ }
+ } else {
+ $ts = $this->app_msg_send_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Set the value of [app_msg_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_uid !== $v) {
+ $this->app_msg_uid = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_UID;
+ }
+
+ } // setAppMsgUid()
+
+ /**
+ * Set the value of [msg_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setMsgUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->msg_uid !== $v) {
+ $this->msg_uid = $v;
+ $this->modifiedColumns[] = AppMessagePeer::MSG_UID;
+ }
+
+ } // setMsgUid()
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndex($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->del_index !== $v || $v === 0) {
+ $this->del_index = $v;
+ $this->modifiedColumns[] = AppMessagePeer::DEL_INDEX;
+ }
+
+ } // setDelIndex()
+
+ /**
+ * Set the value of [app_msg_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_type !== $v || $v === '') {
+ $this->app_msg_type = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_TYPE;
+ }
+
+ } // setAppMsgType()
+
+ /**
+ * Set the value of [app_msg_subject] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgSubject($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_subject !== $v || $v === '') {
+ $this->app_msg_subject = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_SUBJECT;
+ }
+
+ } // setAppMsgSubject()
+
+ /**
+ * Set the value of [app_msg_from] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgFrom($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_from !== $v || $v === '') {
+ $this->app_msg_from = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_FROM;
+ }
+
+ } // setAppMsgFrom()
+
+ /**
+ * Set the value of [app_msg_to] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgTo($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_to !== $v) {
+ $this->app_msg_to = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_TO;
+ }
+
+ } // setAppMsgTo()
+
+ /**
+ * Set the value of [app_msg_body] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgBody($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_body !== $v) {
+ $this->app_msg_body = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_BODY;
+ }
+
+ } // setAppMsgBody()
+
+ /**
+ * Set the value of [app_msg_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppMsgDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_msg_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_msg_date !== $ts) {
+ $this->app_msg_date = $ts;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_DATE;
+ }
+
+ } // setAppMsgDate()
+
+ /**
+ * Set the value of [app_msg_cc] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgCc($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_cc !== $v) {
+ $this->app_msg_cc = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_CC;
+ }
+
+ } // setAppMsgCc()
+
+ /**
+ * Set the value of [app_msg_bcc] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgBcc($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_bcc !== $v) {
+ $this->app_msg_bcc = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_BCC;
+ }
+
+ } // setAppMsgBcc()
+
+ /**
+ * Set the value of [app_msg_template] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgTemplate($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_template !== $v) {
+ $this->app_msg_template = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_TEMPLATE;
+ }
+
+ } // setAppMsgTemplate()
+
+ /**
+ * Set the value of [app_msg_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_status !== $v) {
+ $this->app_msg_status = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_STATUS;
+ }
+
+ } // setAppMsgStatus()
+
+ /**
+ * Set the value of [app_msg_attach] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppMsgAttach($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_msg_attach !== $v) {
+ $this->app_msg_attach = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_ATTACH;
+ }
+
+ } // setAppMsgAttach()
+
+ /**
+ * Set the value of [app_msg_send_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppMsgSendDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_msg_send_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_msg_send_date !== $ts) {
+ $this->app_msg_send_date = $ts;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_SEND_DATE;
+ }
+
+ } // setAppMsgSendDate()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_msg_uid = $rs->getString($startcol + 0);
+
+ $this->msg_uid = $rs->getString($startcol + 1);
+
+ $this->app_uid = $rs->getString($startcol + 2);
+
+ $this->del_index = $rs->getInt($startcol + 3);
+
+ $this->app_msg_type = $rs->getString($startcol + 4);
+
+ $this->app_msg_subject = $rs->getString($startcol + 5);
+
+ $this->app_msg_from = $rs->getString($startcol + 6);
+
+ $this->app_msg_to = $rs->getString($startcol + 7);
+
+ $this->app_msg_body = $rs->getString($startcol + 8);
+
+ $this->app_msg_date = $rs->getTimestamp($startcol + 9, null);
+
+ $this->app_msg_cc = $rs->getString($startcol + 10);
+
+ $this->app_msg_bcc = $rs->getString($startcol + 11);
+
+ $this->app_msg_template = $rs->getString($startcol + 12);
+
+ $this->app_msg_status = $rs->getString($startcol + 13);
+
+ $this->app_msg_attach = $rs->getString($startcol + 14);
+
+ $this->app_msg_send_date = $rs->getTimestamp($startcol + 15, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 16; // 16 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppMessage object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppMessagePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppMessagePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppMessagePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppMessagePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppMessagePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppMessagePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppMessagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppMsgUid();
+ break;
+ case 1:
+ return $this->getMsgUid();
+ break;
+ case 2:
+ return $this->getAppUid();
+ break;
+ case 3:
+ return $this->getDelIndex();
+ break;
+ case 4:
+ return $this->getAppMsgType();
+ break;
+ case 5:
+ return $this->getAppMsgSubject();
+ break;
+ case 6:
+ return $this->getAppMsgFrom();
+ break;
+ case 7:
+ return $this->getAppMsgTo();
+ break;
+ case 8:
+ return $this->getAppMsgBody();
+ break;
+ case 9:
+ return $this->getAppMsgDate();
+ break;
+ case 10:
+ return $this->getAppMsgCc();
+ break;
+ case 11:
+ return $this->getAppMsgBcc();
+ break;
+ case 12:
+ return $this->getAppMsgTemplate();
+ break;
+ case 13:
+ return $this->getAppMsgStatus();
+ break;
+ case 14:
+ return $this->getAppMsgAttach();
+ break;
+ case 15:
+ return $this->getAppMsgSendDate();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppMessagePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppMsgUid(),
+ $keys[1] => $this->getMsgUid(),
+ $keys[2] => $this->getAppUid(),
+ $keys[3] => $this->getDelIndex(),
+ $keys[4] => $this->getAppMsgType(),
+ $keys[5] => $this->getAppMsgSubject(),
+ $keys[6] => $this->getAppMsgFrom(),
+ $keys[7] => $this->getAppMsgTo(),
+ $keys[8] => $this->getAppMsgBody(),
+ $keys[9] => $this->getAppMsgDate(),
+ $keys[10] => $this->getAppMsgCc(),
+ $keys[11] => $this->getAppMsgBcc(),
+ $keys[12] => $this->getAppMsgTemplate(),
+ $keys[13] => $this->getAppMsgStatus(),
+ $keys[14] => $this->getAppMsgAttach(),
+ $keys[15] => $this->getAppMsgSendDate(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppMessagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppMsgUid($value);
+ break;
+ case 1:
+ $this->setMsgUid($value);
+ break;
+ case 2:
+ $this->setAppUid($value);
+ break;
+ case 3:
+ $this->setDelIndex($value);
+ break;
+ case 4:
+ $this->setAppMsgType($value);
+ break;
+ case 5:
+ $this->setAppMsgSubject($value);
+ break;
+ case 6:
+ $this->setAppMsgFrom($value);
+ break;
+ case 7:
+ $this->setAppMsgTo($value);
+ break;
+ case 8:
+ $this->setAppMsgBody($value);
+ break;
+ case 9:
+ $this->setAppMsgDate($value);
+ break;
+ case 10:
+ $this->setAppMsgCc($value);
+ break;
+ case 11:
+ $this->setAppMsgBcc($value);
+ break;
+ case 12:
+ $this->setAppMsgTemplate($value);
+ break;
+ case 13:
+ $this->setAppMsgStatus($value);
+ break;
+ case 14:
+ $this->setAppMsgAttach($value);
+ break;
+ case 15:
+ $this->setAppMsgSendDate($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppMessagePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppMsgUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setMsgUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setAppUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDelIndex($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setAppMsgType($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setAppMsgSubject($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setAppMsgFrom($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setAppMsgTo($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setAppMsgBody($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setAppMsgDate($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setAppMsgCc($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setAppMsgBcc($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setAppMsgTemplate($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setAppMsgStatus($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setAppMsgAttach($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setAppMsgSendDate($arr[$keys[15]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppMessagePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_UID)) {
+ $criteria->add(AppMessagePeer::APP_MSG_UID, $this->app_msg_uid);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::MSG_UID)) {
+ $criteria->add(AppMessagePeer::MSG_UID, $this->msg_uid);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::APP_UID)) {
+ $criteria->add(AppMessagePeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::DEL_INDEX)) {
+ $criteria->add(AppMessagePeer::DEL_INDEX, $this->del_index);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_TYPE)) {
+ $criteria->add(AppMessagePeer::APP_MSG_TYPE, $this->app_msg_type);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_SUBJECT)) {
+ $criteria->add(AppMessagePeer::APP_MSG_SUBJECT, $this->app_msg_subject);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_FROM)) {
+ $criteria->add(AppMessagePeer::APP_MSG_FROM, $this->app_msg_from);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_TO)) {
+ $criteria->add(AppMessagePeer::APP_MSG_TO, $this->app_msg_to);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_BODY)) {
+ $criteria->add(AppMessagePeer::APP_MSG_BODY, $this->app_msg_body);
+ }
+
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_DATE)) {
+ $criteria->add(AppMessagePeer::APP_MSG_DATE, $this->app_msg_date);
+ }
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_CC)) {
+ $criteria->add(AppMessagePeer::APP_MSG_CC, $this->app_msg_cc);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppMessagePeer
- */
- protected static $peer;
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_BCC)) {
+ $criteria->add(AppMessagePeer::APP_MSG_BCC, $this->app_msg_bcc);
+ }
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_TEMPLATE)) {
+ $criteria->add(AppMessagePeer::APP_MSG_TEMPLATE, $this->app_msg_template);
+ }
- /**
- * The value for the app_msg_uid field.
- * @var string
- */
- protected $app_msg_uid;
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_STATUS)) {
+ $criteria->add(AppMessagePeer::APP_MSG_STATUS, $this->app_msg_status);
+ }
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_ATTACH)) {
+ $criteria->add(AppMessagePeer::APP_MSG_ATTACH, $this->app_msg_attach);
+ }
- /**
- * The value for the msg_uid field.
- * @var string
- */
- protected $msg_uid;
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_SEND_DATE)) {
+ $criteria->add(AppMessagePeer::APP_MSG_SEND_DATE, $this->app_msg_send_date);
+ }
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppMessagePeer::DATABASE_NAME);
+
+ $criteria->add(AppMessagePeer::APP_MSG_UID, $this->app_msg_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getAppMsgUid();
+ }
+
+ /**
+ * Generic method to set the primary key (app_msg_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setAppMsgUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppMessage (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setMsgUid($this->msg_uid);
+
+ $copyObj->setAppUid($this->app_uid);
+
+ $copyObj->setDelIndex($this->del_index);
+
+ $copyObj->setAppMsgType($this->app_msg_type);
+
+ $copyObj->setAppMsgSubject($this->app_msg_subject);
+
+ $copyObj->setAppMsgFrom($this->app_msg_from);
+
+ $copyObj->setAppMsgTo($this->app_msg_to);
+
+ $copyObj->setAppMsgBody($this->app_msg_body);
+
+ $copyObj->setAppMsgDate($this->app_msg_date);
+
+ $copyObj->setAppMsgCc($this->app_msg_cc);
+
+ $copyObj->setAppMsgBcc($this->app_msg_bcc);
+
+ $copyObj->setAppMsgTemplate($this->app_msg_template);
+
+ $copyObj->setAppMsgStatus($this->app_msg_status);
+
+ $copyObj->setAppMsgAttach($this->app_msg_attach);
+
+ $copyObj->setAppMsgSendDate($this->app_msg_send_date);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppMsgUid(NULL); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppMessage Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppMessagePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppMessagePeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The value for the del_index field.
- * @var int
- */
- protected $del_index = 0;
-
-
- /**
- * The value for the app_msg_type field.
- * @var string
- */
- protected $app_msg_type = '';
-
-
- /**
- * The value for the app_msg_subject field.
- * @var string
- */
- protected $app_msg_subject = '';
-
-
- /**
- * The value for the app_msg_from field.
- * @var string
- */
- protected $app_msg_from = '';
-
-
- /**
- * The value for the app_msg_to field.
- * @var string
- */
- protected $app_msg_to;
-
-
- /**
- * The value for the app_msg_body field.
- * @var string
- */
- protected $app_msg_body;
-
-
- /**
- * The value for the app_msg_date field.
- * @var int
- */
- protected $app_msg_date;
-
-
- /**
- * The value for the app_msg_cc field.
- * @var string
- */
- protected $app_msg_cc;
-
-
- /**
- * The value for the app_msg_bcc field.
- * @var string
- */
- protected $app_msg_bcc;
-
-
- /**
- * The value for the app_msg_template field.
- * @var string
- */
- protected $app_msg_template;
-
-
- /**
- * The value for the app_msg_status field.
- * @var string
- */
- protected $app_msg_status;
-
-
- /**
- * The value for the app_msg_attach field.
- * @var string
- */
- protected $app_msg_attach;
-
-
- /**
- * The value for the app_msg_send_date field.
- * @var int
- */
- protected $app_msg_send_date;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_msg_uid] column value.
- *
- * @return string
- */
- public function getAppMsgUid()
- {
-
- return $this->app_msg_uid;
- }
-
- /**
- * Get the [msg_uid] column value.
- *
- * @return string
- */
- public function getMsgUid()
- {
-
- return $this->msg_uid;
- }
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [del_index] column value.
- *
- * @return int
- */
- public function getDelIndex()
- {
-
- return $this->del_index;
- }
-
- /**
- * Get the [app_msg_type] column value.
- *
- * @return string
- */
- public function getAppMsgType()
- {
-
- return $this->app_msg_type;
- }
-
- /**
- * Get the [app_msg_subject] column value.
- *
- * @return string
- */
- public function getAppMsgSubject()
- {
-
- return $this->app_msg_subject;
- }
-
- /**
- * Get the [app_msg_from] column value.
- *
- * @return string
- */
- public function getAppMsgFrom()
- {
-
- return $this->app_msg_from;
- }
-
- /**
- * Get the [app_msg_to] column value.
- *
- * @return string
- */
- public function getAppMsgTo()
- {
-
- return $this->app_msg_to;
- }
-
- /**
- * Get the [app_msg_body] column value.
- *
- * @return string
- */
- public function getAppMsgBody()
- {
-
- return $this->app_msg_body;
- }
-
- /**
- * Get the [optionally formatted] [app_msg_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppMsgDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_msg_date === null || $this->app_msg_date === '') {
- return null;
- } elseif (!is_int($this->app_msg_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_msg_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_msg_date] as date/time value: " . var_export($this->app_msg_date, true));
- }
- } else {
- $ts = $this->app_msg_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [app_msg_cc] column value.
- *
- * @return string
- */
- public function getAppMsgCc()
- {
-
- return $this->app_msg_cc;
- }
-
- /**
- * Get the [app_msg_bcc] column value.
- *
- * @return string
- */
- public function getAppMsgBcc()
- {
-
- return $this->app_msg_bcc;
- }
-
- /**
- * Get the [app_msg_template] column value.
- *
- * @return string
- */
- public function getAppMsgTemplate()
- {
-
- return $this->app_msg_template;
- }
-
- /**
- * Get the [app_msg_status] column value.
- *
- * @return string
- */
- public function getAppMsgStatus()
- {
-
- return $this->app_msg_status;
- }
-
- /**
- * Get the [app_msg_attach] column value.
- *
- * @return string
- */
- public function getAppMsgAttach()
- {
-
- return $this->app_msg_attach;
- }
-
- /**
- * Get the [optionally formatted] [app_msg_send_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppMsgSendDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_msg_send_date === null || $this->app_msg_send_date === '') {
- return null;
- } elseif (!is_int($this->app_msg_send_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_msg_send_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_msg_send_date] as date/time value: " . var_export($this->app_msg_send_date, true));
- }
- } else {
- $ts = $this->app_msg_send_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [app_msg_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_uid !== $v) {
- $this->app_msg_uid = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_UID;
- }
-
- } // setAppMsgUid()
-
- /**
- * Set the value of [msg_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setMsgUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->msg_uid !== $v) {
- $this->msg_uid = $v;
- $this->modifiedColumns[] = AppMessagePeer::MSG_UID;
- }
-
- } // setMsgUid()
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndex($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->del_index !== $v || $v === 0) {
- $this->del_index = $v;
- $this->modifiedColumns[] = AppMessagePeer::DEL_INDEX;
- }
-
- } // setDelIndex()
-
- /**
- * Set the value of [app_msg_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_type !== $v || $v === '') {
- $this->app_msg_type = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_TYPE;
- }
-
- } // setAppMsgType()
-
- /**
- * Set the value of [app_msg_subject] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgSubject($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_subject !== $v || $v === '') {
- $this->app_msg_subject = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_SUBJECT;
- }
-
- } // setAppMsgSubject()
-
- /**
- * Set the value of [app_msg_from] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgFrom($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_from !== $v || $v === '') {
- $this->app_msg_from = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_FROM;
- }
-
- } // setAppMsgFrom()
-
- /**
- * Set the value of [app_msg_to] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgTo($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_to !== $v) {
- $this->app_msg_to = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_TO;
- }
-
- } // setAppMsgTo()
-
- /**
- * Set the value of [app_msg_body] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgBody($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_body !== $v) {
- $this->app_msg_body = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_BODY;
- }
-
- } // setAppMsgBody()
-
- /**
- * Set the value of [app_msg_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppMsgDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_msg_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_msg_date !== $ts) {
- $this->app_msg_date = $ts;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_DATE;
- }
-
- } // setAppMsgDate()
-
- /**
- * Set the value of [app_msg_cc] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgCc($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_cc !== $v) {
- $this->app_msg_cc = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_CC;
- }
-
- } // setAppMsgCc()
-
- /**
- * Set the value of [app_msg_bcc] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgBcc($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_bcc !== $v) {
- $this->app_msg_bcc = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_BCC;
- }
-
- } // setAppMsgBcc()
-
- /**
- * Set the value of [app_msg_template] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgTemplate($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_template !== $v) {
- $this->app_msg_template = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_TEMPLATE;
- }
-
- } // setAppMsgTemplate()
-
- /**
- * Set the value of [app_msg_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_status !== $v) {
- $this->app_msg_status = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_STATUS;
- }
-
- } // setAppMsgStatus()
-
- /**
- * Set the value of [app_msg_attach] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppMsgAttach($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_msg_attach !== $v) {
- $this->app_msg_attach = $v;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_ATTACH;
- }
-
- } // setAppMsgAttach()
-
- /**
- * Set the value of [app_msg_send_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppMsgSendDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_msg_send_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_msg_send_date !== $ts) {
- $this->app_msg_send_date = $ts;
- $this->modifiedColumns[] = AppMessagePeer::APP_MSG_SEND_DATE;
- }
-
- } // setAppMsgSendDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_msg_uid = $rs->getString($startcol + 0);
-
- $this->msg_uid = $rs->getString($startcol + 1);
-
- $this->app_uid = $rs->getString($startcol + 2);
-
- $this->del_index = $rs->getInt($startcol + 3);
-
- $this->app_msg_type = $rs->getString($startcol + 4);
-
- $this->app_msg_subject = $rs->getString($startcol + 5);
-
- $this->app_msg_from = $rs->getString($startcol + 6);
-
- $this->app_msg_to = $rs->getString($startcol + 7);
-
- $this->app_msg_body = $rs->getString($startcol + 8);
-
- $this->app_msg_date = $rs->getTimestamp($startcol + 9, null);
-
- $this->app_msg_cc = $rs->getString($startcol + 10);
-
- $this->app_msg_bcc = $rs->getString($startcol + 11);
-
- $this->app_msg_template = $rs->getString($startcol + 12);
-
- $this->app_msg_status = $rs->getString($startcol + 13);
-
- $this->app_msg_attach = $rs->getString($startcol + 14);
-
- $this->app_msg_send_date = $rs->getTimestamp($startcol + 15, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 16; // 16 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppMessage object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppMessagePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppMessagePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppMessagePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppMessagePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppMessagePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppMessagePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppMessagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppMsgUid();
- break;
- case 1:
- return $this->getMsgUid();
- break;
- case 2:
- return $this->getAppUid();
- break;
- case 3:
- return $this->getDelIndex();
- break;
- case 4:
- return $this->getAppMsgType();
- break;
- case 5:
- return $this->getAppMsgSubject();
- break;
- case 6:
- return $this->getAppMsgFrom();
- break;
- case 7:
- return $this->getAppMsgTo();
- break;
- case 8:
- return $this->getAppMsgBody();
- break;
- case 9:
- return $this->getAppMsgDate();
- break;
- case 10:
- return $this->getAppMsgCc();
- break;
- case 11:
- return $this->getAppMsgBcc();
- break;
- case 12:
- return $this->getAppMsgTemplate();
- break;
- case 13:
- return $this->getAppMsgStatus();
- break;
- case 14:
- return $this->getAppMsgAttach();
- break;
- case 15:
- return $this->getAppMsgSendDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppMessagePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppMsgUid(),
- $keys[1] => $this->getMsgUid(),
- $keys[2] => $this->getAppUid(),
- $keys[3] => $this->getDelIndex(),
- $keys[4] => $this->getAppMsgType(),
- $keys[5] => $this->getAppMsgSubject(),
- $keys[6] => $this->getAppMsgFrom(),
- $keys[7] => $this->getAppMsgTo(),
- $keys[8] => $this->getAppMsgBody(),
- $keys[9] => $this->getAppMsgDate(),
- $keys[10] => $this->getAppMsgCc(),
- $keys[11] => $this->getAppMsgBcc(),
- $keys[12] => $this->getAppMsgTemplate(),
- $keys[13] => $this->getAppMsgStatus(),
- $keys[14] => $this->getAppMsgAttach(),
- $keys[15] => $this->getAppMsgSendDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppMessagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppMsgUid($value);
- break;
- case 1:
- $this->setMsgUid($value);
- break;
- case 2:
- $this->setAppUid($value);
- break;
- case 3:
- $this->setDelIndex($value);
- break;
- case 4:
- $this->setAppMsgType($value);
- break;
- case 5:
- $this->setAppMsgSubject($value);
- break;
- case 6:
- $this->setAppMsgFrom($value);
- break;
- case 7:
- $this->setAppMsgTo($value);
- break;
- case 8:
- $this->setAppMsgBody($value);
- break;
- case 9:
- $this->setAppMsgDate($value);
- break;
- case 10:
- $this->setAppMsgCc($value);
- break;
- case 11:
- $this->setAppMsgBcc($value);
- break;
- case 12:
- $this->setAppMsgTemplate($value);
- break;
- case 13:
- $this->setAppMsgStatus($value);
- break;
- case 14:
- $this->setAppMsgAttach($value);
- break;
- case 15:
- $this->setAppMsgSendDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppMessagePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppMsgUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setMsgUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAppUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDelIndex($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setAppMsgType($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setAppMsgSubject($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setAppMsgFrom($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setAppMsgTo($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setAppMsgBody($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setAppMsgDate($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setAppMsgCc($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setAppMsgBcc($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setAppMsgTemplate($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setAppMsgStatus($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setAppMsgAttach($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setAppMsgSendDate($arr[$keys[15]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppMessagePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_UID)) $criteria->add(AppMessagePeer::APP_MSG_UID, $this->app_msg_uid);
- if ($this->isColumnModified(AppMessagePeer::MSG_UID)) $criteria->add(AppMessagePeer::MSG_UID, $this->msg_uid);
- if ($this->isColumnModified(AppMessagePeer::APP_UID)) $criteria->add(AppMessagePeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppMessagePeer::DEL_INDEX)) $criteria->add(AppMessagePeer::DEL_INDEX, $this->del_index);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_TYPE)) $criteria->add(AppMessagePeer::APP_MSG_TYPE, $this->app_msg_type);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_SUBJECT)) $criteria->add(AppMessagePeer::APP_MSG_SUBJECT, $this->app_msg_subject);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_FROM)) $criteria->add(AppMessagePeer::APP_MSG_FROM, $this->app_msg_from);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_TO)) $criteria->add(AppMessagePeer::APP_MSG_TO, $this->app_msg_to);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_BODY)) $criteria->add(AppMessagePeer::APP_MSG_BODY, $this->app_msg_body);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_DATE)) $criteria->add(AppMessagePeer::APP_MSG_DATE, $this->app_msg_date);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_CC)) $criteria->add(AppMessagePeer::APP_MSG_CC, $this->app_msg_cc);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_BCC)) $criteria->add(AppMessagePeer::APP_MSG_BCC, $this->app_msg_bcc);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_TEMPLATE)) $criteria->add(AppMessagePeer::APP_MSG_TEMPLATE, $this->app_msg_template);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_STATUS)) $criteria->add(AppMessagePeer::APP_MSG_STATUS, $this->app_msg_status);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_ATTACH)) $criteria->add(AppMessagePeer::APP_MSG_ATTACH, $this->app_msg_attach);
- if ($this->isColumnModified(AppMessagePeer::APP_MSG_SEND_DATE)) $criteria->add(AppMessagePeer::APP_MSG_SEND_DATE, $this->app_msg_send_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppMessagePeer::DATABASE_NAME);
-
- $criteria->add(AppMessagePeer::APP_MSG_UID, $this->app_msg_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getAppMsgUid();
- }
-
- /**
- * Generic method to set the primary key (app_msg_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setAppMsgUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppMessage (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setMsgUid($this->msg_uid);
-
- $copyObj->setAppUid($this->app_uid);
-
- $copyObj->setDelIndex($this->del_index);
-
- $copyObj->setAppMsgType($this->app_msg_type);
-
- $copyObj->setAppMsgSubject($this->app_msg_subject);
-
- $copyObj->setAppMsgFrom($this->app_msg_from);
-
- $copyObj->setAppMsgTo($this->app_msg_to);
-
- $copyObj->setAppMsgBody($this->app_msg_body);
-
- $copyObj->setAppMsgDate($this->app_msg_date);
-
- $copyObj->setAppMsgCc($this->app_msg_cc);
-
- $copyObj->setAppMsgBcc($this->app_msg_bcc);
-
- $copyObj->setAppMsgTemplate($this->app_msg_template);
-
- $copyObj->setAppMsgStatus($this->app_msg_status);
-
- $copyObj->setAppMsgAttach($this->app_msg_attach);
-
- $copyObj->setAppMsgSendDate($this->app_msg_send_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppMsgUid(NULL); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppMessage Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppMessagePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppMessagePeer();
- }
- return self::$peer;
- }
-
-} // BaseAppMessage
diff --git a/workflow/engine/classes/model/om/BaseAppMessagePeer.php b/workflow/engine/classes/model/om/BaseAppMessagePeer.php
index 2bcb5c87e..9e4cf1ee6 100755
--- a/workflow/engine/classes/model/om/BaseAppMessagePeer.php
+++ b/workflow/engine/classes/model/om/BaseAppMessagePeer.php
@@ -12,629 +12,631 @@ include_once 'classes/model/AppMessage.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppMessagePeer {
+abstract class BaseAppMessagePeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'APP_MESSAGE';
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_MESSAGE';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppMessage';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppMessage';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 16;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_MSG_UID field */
+ const APP_MSG_UID = 'APP_MESSAGE.APP_MSG_UID';
+
+ /** the column name for the MSG_UID field */
+ const MSG_UID = 'APP_MESSAGE.MSG_UID';
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_MESSAGE.APP_UID';
+
+ /** the column name for the DEL_INDEX field */
+ const DEL_INDEX = 'APP_MESSAGE.DEL_INDEX';
+
+ /** the column name for the APP_MSG_TYPE field */
+ const APP_MSG_TYPE = 'APP_MESSAGE.APP_MSG_TYPE';
+
+ /** the column name for the APP_MSG_SUBJECT field */
+ const APP_MSG_SUBJECT = 'APP_MESSAGE.APP_MSG_SUBJECT';
+
+ /** the column name for the APP_MSG_FROM field */
+ const APP_MSG_FROM = 'APP_MESSAGE.APP_MSG_FROM';
+
+ /** the column name for the APP_MSG_TO field */
+ const APP_MSG_TO = 'APP_MESSAGE.APP_MSG_TO';
+
+ /** the column name for the APP_MSG_BODY field */
+ const APP_MSG_BODY = 'APP_MESSAGE.APP_MSG_BODY';
+
+ /** the column name for the APP_MSG_DATE field */
+ const APP_MSG_DATE = 'APP_MESSAGE.APP_MSG_DATE';
+
+ /** the column name for the APP_MSG_CC field */
+ const APP_MSG_CC = 'APP_MESSAGE.APP_MSG_CC';
+
+ /** the column name for the APP_MSG_BCC field */
+ const APP_MSG_BCC = 'APP_MESSAGE.APP_MSG_BCC';
+
+ /** the column name for the APP_MSG_TEMPLATE field */
+ const APP_MSG_TEMPLATE = 'APP_MESSAGE.APP_MSG_TEMPLATE';
+
+ /** the column name for the APP_MSG_STATUS field */
+ const APP_MSG_STATUS = 'APP_MESSAGE.APP_MSG_STATUS';
+
+ /** the column name for the APP_MSG_ATTACH field */
+ const APP_MSG_ATTACH = 'APP_MESSAGE.APP_MSG_ATTACH';
+
+ /** the column name for the APP_MSG_SEND_DATE field */
+ const APP_MSG_SEND_DATE = 'APP_MESSAGE.APP_MSG_SEND_DATE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgAttach', 'AppMsgSendDate', ),
+ BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgSubject' => 5, 'AppMsgFrom' => 6, 'AppMsgTo' => 7, 'AppMsgBody' => 8, 'AppMsgDate' => 9, 'AppMsgCc' => 10, 'AppMsgBcc' => 11, 'AppMsgTemplate' => 12, 'AppMsgStatus' => 13, 'AppMsgAttach' => 14, 'AppMsgSendDate' => 15, ),
+ BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_SUBJECT => 5, AppMessagePeer::APP_MSG_FROM => 6, AppMessagePeer::APP_MSG_TO => 7, AppMessagePeer::APP_MSG_BODY => 8, AppMessagePeer::APP_MSG_DATE => 9, AppMessagePeer::APP_MSG_CC => 10, AppMessagePeer::APP_MSG_BCC => 11, AppMessagePeer::APP_MSG_TEMPLATE => 12, AppMessagePeer::APP_MSG_STATUS => 13, AppMessagePeer::APP_MSG_ATTACH => 14, AppMessagePeer::APP_MSG_SEND_DATE => 15, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_SUBJECT' => 5, 'APP_MSG_FROM' => 6, 'APP_MSG_TO' => 7, 'APP_MSG_BODY' => 8, 'APP_MSG_DATE' => 9, 'APP_MSG_CC' => 10, 'APP_MSG_BCC' => 11, 'APP_MSG_TEMPLATE' => 12, 'APP_MSG_STATUS' => 13, 'APP_MSG_ATTACH' => 14, 'APP_MSG_SEND_DATE' => 15, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppMessageMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppMessageMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppMessagePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppMessagePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppMessagePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_UID);
+
+ $criteria->addSelectColumn(AppMessagePeer::MSG_UID);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_UID);
+
+ $criteria->addSelectColumn(AppMessagePeer::DEL_INDEX);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_FROM);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_TO);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_BODY);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_DATE);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_CC);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_BCC);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_TEMPLATE);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_ATTACH);
+
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
+
+ }
+
+ const COUNT = 'COUNT(APP_MESSAGE.APP_MSG_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_MESSAGE.APP_MSG_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppMessagePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppMessagePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppMessagePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppMessage
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppMessagePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppMessagePeer::populateObjects(AppMessagePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppMessagePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppMessagePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppMessagePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppMessage or Criteria object.
+ *
+ * @param mixed $values Criteria or AppMessage object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppMessage object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppMessage or Criteria object.
+ *
+ * @param mixed $values Criteria or AppMessage object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppMessagePeer::APP_MSG_UID);
+ $selectCriteria->add(AppMessagePeer::APP_MSG_UID, $criteria->remove(AppMessagePeer::APP_MSG_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_MESSAGE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppMessagePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppMessage or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppMessage object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppMessagePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppMessage) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(AppMessagePeer::APP_MSG_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppMessage object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppMessage $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppMessage $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppMessagePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppMessagePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AppMessagePeer::DATABASE_NAME, AppMessagePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return AppMessage
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(AppMessagePeer::DATABASE_NAME);
+
+ $criteria->add(AppMessagePeer::APP_MSG_UID, $pk);
+
+
+ $v = AppMessagePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(AppMessagePeer::APP_MSG_UID, $pks, Criteria::IN);
+ $objs = AppMessagePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** The total number of columns. */
- const NUM_COLUMNS = 16;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_MSG_UID field */
- const APP_MSG_UID = 'APP_MESSAGE.APP_MSG_UID';
-
- /** the column name for the MSG_UID field */
- const MSG_UID = 'APP_MESSAGE.MSG_UID';
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_MESSAGE.APP_UID';
-
- /** the column name for the DEL_INDEX field */
- const DEL_INDEX = 'APP_MESSAGE.DEL_INDEX';
-
- /** the column name for the APP_MSG_TYPE field */
- const APP_MSG_TYPE = 'APP_MESSAGE.APP_MSG_TYPE';
-
- /** the column name for the APP_MSG_SUBJECT field */
- const APP_MSG_SUBJECT = 'APP_MESSAGE.APP_MSG_SUBJECT';
-
- /** the column name for the APP_MSG_FROM field */
- const APP_MSG_FROM = 'APP_MESSAGE.APP_MSG_FROM';
-
- /** the column name for the APP_MSG_TO field */
- const APP_MSG_TO = 'APP_MESSAGE.APP_MSG_TO';
-
- /** the column name for the APP_MSG_BODY field */
- const APP_MSG_BODY = 'APP_MESSAGE.APP_MSG_BODY';
-
- /** the column name for the APP_MSG_DATE field */
- const APP_MSG_DATE = 'APP_MESSAGE.APP_MSG_DATE';
-
- /** the column name for the APP_MSG_CC field */
- const APP_MSG_CC = 'APP_MESSAGE.APP_MSG_CC';
-
- /** the column name for the APP_MSG_BCC field */
- const APP_MSG_BCC = 'APP_MESSAGE.APP_MSG_BCC';
-
- /** the column name for the APP_MSG_TEMPLATE field */
- const APP_MSG_TEMPLATE = 'APP_MESSAGE.APP_MSG_TEMPLATE';
-
- /** the column name for the APP_MSG_STATUS field */
- const APP_MSG_STATUS = 'APP_MESSAGE.APP_MSG_STATUS';
-
- /** the column name for the APP_MSG_ATTACH field */
- const APP_MSG_ATTACH = 'APP_MESSAGE.APP_MSG_ATTACH';
-
- /** the column name for the APP_MSG_SEND_DATE field */
- const APP_MSG_SEND_DATE = 'APP_MESSAGE.APP_MSG_SEND_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgAttach', 'AppMsgSendDate', ),
- BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgSubject' => 5, 'AppMsgFrom' => 6, 'AppMsgTo' => 7, 'AppMsgBody' => 8, 'AppMsgDate' => 9, 'AppMsgCc' => 10, 'AppMsgBcc' => 11, 'AppMsgTemplate' => 12, 'AppMsgStatus' => 13, 'AppMsgAttach' => 14, 'AppMsgSendDate' => 15, ),
- BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_SUBJECT => 5, AppMessagePeer::APP_MSG_FROM => 6, AppMessagePeer::APP_MSG_TO => 7, AppMessagePeer::APP_MSG_BODY => 8, AppMessagePeer::APP_MSG_DATE => 9, AppMessagePeer::APP_MSG_CC => 10, AppMessagePeer::APP_MSG_BCC => 11, AppMessagePeer::APP_MSG_TEMPLATE => 12, AppMessagePeer::APP_MSG_STATUS => 13, AppMessagePeer::APP_MSG_ATTACH => 14, AppMessagePeer::APP_MSG_SEND_DATE => 15, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_SUBJECT' => 5, 'APP_MSG_FROM' => 6, 'APP_MSG_TO' => 7, 'APP_MSG_BODY' => 8, 'APP_MSG_DATE' => 9, 'APP_MSG_CC' => 10, 'APP_MSG_BCC' => 11, 'APP_MSG_TEMPLATE' => 12, 'APP_MSG_STATUS' => 13, 'APP_MSG_ATTACH' => 14, 'APP_MSG_SEND_DATE' => 15, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppMessageMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppMessageMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppMessagePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppMessagePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppMessagePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_UID);
-
- $criteria->addSelectColumn(AppMessagePeer::MSG_UID);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_UID);
-
- $criteria->addSelectColumn(AppMessagePeer::DEL_INDEX);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_FROM);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_TO);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_BODY);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_DATE);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_CC);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_BCC);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_TEMPLATE);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_ATTACH);
-
- $criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
-
- }
-
- const COUNT = 'COUNT(APP_MESSAGE.APP_MSG_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_MESSAGE.APP_MSG_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppMessagePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppMessagePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppMessagePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppMessage
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppMessagePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppMessagePeer::populateObjects(AppMessagePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppMessagePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppMessagePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppMessagePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppMessage or Criteria object.
- *
- * @param mixed $values Criteria or AppMessage object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppMessage object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppMessage or Criteria object.
- *
- * @param mixed $values Criteria or AppMessage object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppMessagePeer::APP_MSG_UID);
- $selectCriteria->add(AppMessagePeer::APP_MSG_UID, $criteria->remove(AppMessagePeer::APP_MSG_UID), $comparison);
-
- } else { // $values is AppMessage object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_MESSAGE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppMessagePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppMessage or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppMessage object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppMessagePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppMessage) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(AppMessagePeer::APP_MSG_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppMessage object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppMessage $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppMessage $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppMessagePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppMessagePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AppMessagePeer::DATABASE_NAME, AppMessagePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return AppMessage
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(AppMessagePeer::DATABASE_NAME);
-
- $criteria->add(AppMessagePeer::APP_MSG_UID, $pk);
-
-
- $v = AppMessagePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(AppMessagePeer::APP_MSG_UID, $pks, Criteria::IN);
- $objs = AppMessagePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseAppMessagePeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppMessagePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppMessagePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppMessageMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppMessageMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppMessageMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppMessageMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppNotes.php b/workflow/engine/classes/model/om/BaseAppNotes.php
index 97c18c058..0938a9e53 100755
--- a/workflow/engine/classes/model/om/BaseAppNotes.php
+++ b/workflow/engine/classes/model/om/BaseAppNotes.php
@@ -16,991 +16,1044 @@ include_once 'classes/model/AppNotesPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppNotes extends BaseObject implements Persistent {
+abstract class BaseAppNotes extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppNotesPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the note_date field.
+ * @var int
+ */
+ protected $note_date;
+
+ /**
+ * The value for the note_content field.
+ * @var string
+ */
+ protected $note_content;
+
+ /**
+ * The value for the note_type field.
+ * @var string
+ */
+ protected $note_type = 'USER';
+
+ /**
+ * The value for the note_availability field.
+ * @var string
+ */
+ protected $note_availability = 'PUBLIC';
+
+ /**
+ * The value for the note_origin_obj field.
+ * @var string
+ */
+ protected $note_origin_obj = '';
+
+ /**
+ * The value for the note_affected_obj1 field.
+ * @var string
+ */
+ protected $note_affected_obj1 = '';
+
+ /**
+ * The value for the note_affected_obj2 field.
+ * @var string
+ */
+ protected $note_affected_obj2 = '';
+
+ /**
+ * The value for the note_recipients field.
+ * @var string
+ */
+ protected $note_recipients;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [optionally formatted] [note_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getNoteDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->note_date === null || $this->note_date === '') {
+ return null;
+ } elseif (!is_int($this->note_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->note_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [note_date] as date/time value: " .
+ var_export($this->note_date, true));
+ }
+ } else {
+ $ts = $this->note_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [note_content] column value.
+ *
+ * @return string
+ */
+ public function getNoteContent()
+ {
+
+ return $this->note_content;
+ }
+
+ /**
+ * Get the [note_type] column value.
+ *
+ * @return string
+ */
+ public function getNoteType()
+ {
+
+ return $this->note_type;
+ }
+
+ /**
+ * Get the [note_availability] column value.
+ *
+ * @return string
+ */
+ public function getNoteAvailability()
+ {
+
+ return $this->note_availability;
+ }
+
+ /**
+ * Get the [note_origin_obj] column value.
+ *
+ * @return string
+ */
+ public function getNoteOriginObj()
+ {
+
+ return $this->note_origin_obj;
+ }
+
+ /**
+ * Get the [note_affected_obj1] column value.
+ *
+ * @return string
+ */
+ public function getNoteAffectedObj1()
+ {
+
+ return $this->note_affected_obj1;
+ }
+
+ /**
+ * Get the [note_affected_obj2] column value.
+ *
+ * @return string
+ */
+ public function getNoteAffectedObj2()
+ {
+
+ return $this->note_affected_obj2;
+ }
+
+ /**
+ * Get the [note_recipients] column value.
+ *
+ * @return string
+ */
+ public function getNoteRecipients()
+ {
+
+ return $this->note_recipients;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppNotesPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = AppNotesPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [note_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setNoteDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [note_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->note_date !== $ts) {
+ $this->note_date = $ts;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_DATE;
+ }
+
+ } // setNoteDate()
+
+ /**
+ * Set the value of [note_content] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setNoteContent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->note_content !== $v) {
+ $this->note_content = $v;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_CONTENT;
+ }
+
+ } // setNoteContent()
+
+ /**
+ * Set the value of [note_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setNoteType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->note_type !== $v || $v === 'USER') {
+ $this->note_type = $v;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_TYPE;
+ }
+
+ } // setNoteType()
+
+ /**
+ * Set the value of [note_availability] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setNoteAvailability($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->note_availability !== $v || $v === 'PUBLIC') {
+ $this->note_availability = $v;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_AVAILABILITY;
+ }
+
+ } // setNoteAvailability()
+
+ /**
+ * Set the value of [note_origin_obj] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setNoteOriginObj($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->note_origin_obj !== $v || $v === '') {
+ $this->note_origin_obj = $v;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_ORIGIN_OBJ;
+ }
+
+ } // setNoteOriginObj()
+
+ /**
+ * Set the value of [note_affected_obj1] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setNoteAffectedObj1($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->note_affected_obj1 !== $v || $v === '') {
+ $this->note_affected_obj1 = $v;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_AFFECTED_OBJ1;
+ }
+
+ } // setNoteAffectedObj1()
+
+ /**
+ * Set the value of [note_affected_obj2] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setNoteAffectedObj2($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->note_affected_obj2 !== $v || $v === '') {
+ $this->note_affected_obj2 = $v;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_AFFECTED_OBJ2;
+ }
+
+ } // setNoteAffectedObj2()
+
+ /**
+ * Set the value of [note_recipients] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setNoteRecipients($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->note_recipients !== $v) {
+ $this->note_recipients = $v;
+ $this->modifiedColumns[] = AppNotesPeer::NOTE_RECIPIENTS;
+ }
+
+ } // setNoteRecipients()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->usr_uid = $rs->getString($startcol + 1);
+
+ $this->note_date = $rs->getTimestamp($startcol + 2, null);
+
+ $this->note_content = $rs->getString($startcol + 3);
+
+ $this->note_type = $rs->getString($startcol + 4);
+
+ $this->note_availability = $rs->getString($startcol + 5);
+
+ $this->note_origin_obj = $rs->getString($startcol + 6);
+
+ $this->note_affected_obj1 = $rs->getString($startcol + 7);
+
+ $this->note_affected_obj2 = $rs->getString($startcol + 8);
+
+ $this->note_recipients = $rs->getString($startcol + 9);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 10; // 10 = AppNotesPeer::NUM_COLUMNS - AppNotesPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppNotes object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppNotesPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppNotesPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppNotesPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppNotesPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppNotesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getUsrUid();
+ break;
+ case 2:
+ return $this->getNoteDate();
+ break;
+ case 3:
+ return $this->getNoteContent();
+ break;
+ case 4:
+ return $this->getNoteType();
+ break;
+ case 5:
+ return $this->getNoteAvailability();
+ break;
+ case 6:
+ return $this->getNoteOriginObj();
+ break;
+ case 7:
+ return $this->getNoteAffectedObj1();
+ break;
+ case 8:
+ return $this->getNoteAffectedObj2();
+ break;
+ case 9:
+ return $this->getNoteRecipients();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppNotesPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getUsrUid(),
+ $keys[2] => $this->getNoteDate(),
+ $keys[3] => $this->getNoteContent(),
+ $keys[4] => $this->getNoteType(),
+ $keys[5] => $this->getNoteAvailability(),
+ $keys[6] => $this->getNoteOriginObj(),
+ $keys[7] => $this->getNoteAffectedObj1(),
+ $keys[8] => $this->getNoteAffectedObj2(),
+ $keys[9] => $this->getNoteRecipients(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppNotesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setUsrUid($value);
+ break;
+ case 2:
+ $this->setNoteDate($value);
+ break;
+ case 3:
+ $this->setNoteContent($value);
+ break;
+ case 4:
+ $this->setNoteType($value);
+ break;
+ case 5:
+ $this->setNoteAvailability($value);
+ break;
+ case 6:
+ $this->setNoteOriginObj($value);
+ break;
+ case 7:
+ $this->setNoteAffectedObj1($value);
+ break;
+ case 8:
+ $this->setNoteAffectedObj2($value);
+ break;
+ case 9:
+ $this->setNoteRecipients($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppNotesPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setUsrUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setNoteDate($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setNoteContent($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setNoteType($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setNoteAvailability($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setNoteOriginObj($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setNoteAffectedObj1($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setNoteAffectedObj2($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setNoteRecipients($arr[$keys[9]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppNotesPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppNotesPeer::APP_UID)) {
+ $criteria->add(AppNotesPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::USR_UID)) {
+ $criteria->add(AppNotesPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_DATE)) {
+ $criteria->add(AppNotesPeer::NOTE_DATE, $this->note_date);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_CONTENT)) {
+ $criteria->add(AppNotesPeer::NOTE_CONTENT, $this->note_content);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_TYPE)) {
+ $criteria->add(AppNotesPeer::NOTE_TYPE, $this->note_type);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_AVAILABILITY)) {
+ $criteria->add(AppNotesPeer::NOTE_AVAILABILITY, $this->note_availability);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_ORIGIN_OBJ)) {
+ $criteria->add(AppNotesPeer::NOTE_ORIGIN_OBJ, $this->note_origin_obj);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_AFFECTED_OBJ1)) {
+ $criteria->add(AppNotesPeer::NOTE_AFFECTED_OBJ1, $this->note_affected_obj1);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_AFFECTED_OBJ2)) {
+ $criteria->add(AppNotesPeer::NOTE_AFFECTED_OBJ2, $this->note_affected_obj2);
+ }
+
+ if ($this->isColumnModified(AppNotesPeer::NOTE_RECIPIENTS)) {
+ $criteria->add(AppNotesPeer::NOTE_RECIPIENTS, $this->note_recipients);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppNotesPeer::DATABASE_NAME);
+
+
+ return $criteria;
+ }
+
+ /**
+ * Returns NULL since this table doesn't have a primary key.
+ * This method exists only for BC and is deprecated!
+ * @return null
+ */
+ public function getPrimaryKey()
+ {
+ return null;
+ }
+
+ /**
+ * Dummy primary key setter.
+ *
+ * This function only exists to preserve backwards compatibility. It is no longer
+ * needed or required by the Persistent interface. It will be removed in next BC-breaking
+ * release of Propel.
+ *
+ * @deprecated
+ */
+ public function setPrimaryKey($pk)
+ {
+ // do nothing, because this object doesn't have any primary keys
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppNotes (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAppUid($this->app_uid);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+ $copyObj->setNoteDate($this->note_date);
+
+ $copyObj->setNoteContent($this->note_content);
+
+ $copyObj->setNoteType($this->note_type);
+
+ $copyObj->setNoteAvailability($this->note_availability);
+
+ $copyObj->setNoteOriginObj($this->note_origin_obj);
+
+ $copyObj->setNoteAffectedObj1($this->note_affected_obj1);
+
+ $copyObj->setNoteAffectedObj2($this->note_affected_obj2);
+
+ $copyObj->setNoteRecipients($this->note_recipients);
+
+
+ $copyObj->setNew(true);
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppNotes Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppNotesPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppNotesPeer();
+ }
+ return self::$peer;
+ }
+}
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppNotesPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
-
- /**
- * The value for the note_date field.
- * @var int
- */
- protected $note_date;
-
-
- /**
- * The value for the note_content field.
- * @var string
- */
- protected $note_content;
-
-
- /**
- * The value for the note_type field.
- * @var string
- */
- protected $note_type = 'USER';
-
-
- /**
- * The value for the note_availability field.
- * @var string
- */
- protected $note_availability = 'PUBLIC';
-
-
- /**
- * The value for the note_origin_obj field.
- * @var string
- */
- protected $note_origin_obj = '';
-
-
- /**
- * The value for the note_affected_obj1 field.
- * @var string
- */
- protected $note_affected_obj1 = '';
-
-
- /**
- * The value for the note_affected_obj2 field.
- * @var string
- */
- protected $note_affected_obj2 = '';
-
-
- /**
- * The value for the note_recipients field.
- * @var string
- */
- protected $note_recipients;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [optionally formatted] [note_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getNoteDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->note_date === null || $this->note_date === '') {
- return null;
- } elseif (!is_int($this->note_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->note_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [note_date] as date/time value: " . var_export($this->note_date, true));
- }
- } else {
- $ts = $this->note_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [note_content] column value.
- *
- * @return string
- */
- public function getNoteContent()
- {
-
- return $this->note_content;
- }
-
- /**
- * Get the [note_type] column value.
- *
- * @return string
- */
- public function getNoteType()
- {
-
- return $this->note_type;
- }
-
- /**
- * Get the [note_availability] column value.
- *
- * @return string
- */
- public function getNoteAvailability()
- {
-
- return $this->note_availability;
- }
-
- /**
- * Get the [note_origin_obj] column value.
- *
- * @return string
- */
- public function getNoteOriginObj()
- {
-
- return $this->note_origin_obj;
- }
-
- /**
- * Get the [note_affected_obj1] column value.
- *
- * @return string
- */
- public function getNoteAffectedObj1()
- {
-
- return $this->note_affected_obj1;
- }
-
- /**
- * Get the [note_affected_obj2] column value.
- *
- * @return string
- */
- public function getNoteAffectedObj2()
- {
-
- return $this->note_affected_obj2;
- }
-
- /**
- * Get the [note_recipients] column value.
- *
- * @return string
- */
- public function getNoteRecipients()
- {
-
- return $this->note_recipients;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppNotesPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = AppNotesPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [note_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setNoteDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [note_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->note_date !== $ts) {
- $this->note_date = $ts;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_DATE;
- }
-
- } // setNoteDate()
-
- /**
- * Set the value of [note_content] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setNoteContent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->note_content !== $v) {
- $this->note_content = $v;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_CONTENT;
- }
-
- } // setNoteContent()
-
- /**
- * Set the value of [note_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setNoteType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->note_type !== $v || $v === 'USER') {
- $this->note_type = $v;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_TYPE;
- }
-
- } // setNoteType()
-
- /**
- * Set the value of [note_availability] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setNoteAvailability($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->note_availability !== $v || $v === 'PUBLIC') {
- $this->note_availability = $v;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_AVAILABILITY;
- }
-
- } // setNoteAvailability()
-
- /**
- * Set the value of [note_origin_obj] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setNoteOriginObj($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->note_origin_obj !== $v || $v === '') {
- $this->note_origin_obj = $v;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_ORIGIN_OBJ;
- }
-
- } // setNoteOriginObj()
-
- /**
- * Set the value of [note_affected_obj1] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setNoteAffectedObj1($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->note_affected_obj1 !== $v || $v === '') {
- $this->note_affected_obj1 = $v;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_AFFECTED_OBJ1;
- }
-
- } // setNoteAffectedObj1()
-
- /**
- * Set the value of [note_affected_obj2] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setNoteAffectedObj2($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->note_affected_obj2 !== $v || $v === '') {
- $this->note_affected_obj2 = $v;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_AFFECTED_OBJ2;
- }
-
- } // setNoteAffectedObj2()
-
- /**
- * Set the value of [note_recipients] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setNoteRecipients($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->note_recipients !== $v) {
- $this->note_recipients = $v;
- $this->modifiedColumns[] = AppNotesPeer::NOTE_RECIPIENTS;
- }
-
- } // setNoteRecipients()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->usr_uid = $rs->getString($startcol + 1);
-
- $this->note_date = $rs->getTimestamp($startcol + 2, null);
-
- $this->note_content = $rs->getString($startcol + 3);
-
- $this->note_type = $rs->getString($startcol + 4);
-
- $this->note_availability = $rs->getString($startcol + 5);
-
- $this->note_origin_obj = $rs->getString($startcol + 6);
-
- $this->note_affected_obj1 = $rs->getString($startcol + 7);
-
- $this->note_affected_obj2 = $rs->getString($startcol + 8);
-
- $this->note_recipients = $rs->getString($startcol + 9);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 10; // 10 = AppNotesPeer::NUM_COLUMNS - AppNotesPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppNotes object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppNotesPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppNotesPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppNotesPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppNotesPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppNotesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getUsrUid();
- break;
- case 2:
- return $this->getNoteDate();
- break;
- case 3:
- return $this->getNoteContent();
- break;
- case 4:
- return $this->getNoteType();
- break;
- case 5:
- return $this->getNoteAvailability();
- break;
- case 6:
- return $this->getNoteOriginObj();
- break;
- case 7:
- return $this->getNoteAffectedObj1();
- break;
- case 8:
- return $this->getNoteAffectedObj2();
- break;
- case 9:
- return $this->getNoteRecipients();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppNotesPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getUsrUid(),
- $keys[2] => $this->getNoteDate(),
- $keys[3] => $this->getNoteContent(),
- $keys[4] => $this->getNoteType(),
- $keys[5] => $this->getNoteAvailability(),
- $keys[6] => $this->getNoteOriginObj(),
- $keys[7] => $this->getNoteAffectedObj1(),
- $keys[8] => $this->getNoteAffectedObj2(),
- $keys[9] => $this->getNoteRecipients(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppNotesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setUsrUid($value);
- break;
- case 2:
- $this->setNoteDate($value);
- break;
- case 3:
- $this->setNoteContent($value);
- break;
- case 4:
- $this->setNoteType($value);
- break;
- case 5:
- $this->setNoteAvailability($value);
- break;
- case 6:
- $this->setNoteOriginObj($value);
- break;
- case 7:
- $this->setNoteAffectedObj1($value);
- break;
- case 8:
- $this->setNoteAffectedObj2($value);
- break;
- case 9:
- $this->setNoteRecipients($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppNotesPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setUsrUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setNoteDate($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setNoteContent($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setNoteType($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setNoteAvailability($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setNoteOriginObj($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setNoteAffectedObj1($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setNoteAffectedObj2($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setNoteRecipients($arr[$keys[9]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppNotesPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppNotesPeer::APP_UID)) $criteria->add(AppNotesPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppNotesPeer::USR_UID)) $criteria->add(AppNotesPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(AppNotesPeer::NOTE_DATE)) $criteria->add(AppNotesPeer::NOTE_DATE, $this->note_date);
- if ($this->isColumnModified(AppNotesPeer::NOTE_CONTENT)) $criteria->add(AppNotesPeer::NOTE_CONTENT, $this->note_content);
- if ($this->isColumnModified(AppNotesPeer::NOTE_TYPE)) $criteria->add(AppNotesPeer::NOTE_TYPE, $this->note_type);
- if ($this->isColumnModified(AppNotesPeer::NOTE_AVAILABILITY)) $criteria->add(AppNotesPeer::NOTE_AVAILABILITY, $this->note_availability);
- if ($this->isColumnModified(AppNotesPeer::NOTE_ORIGIN_OBJ)) $criteria->add(AppNotesPeer::NOTE_ORIGIN_OBJ, $this->note_origin_obj);
- if ($this->isColumnModified(AppNotesPeer::NOTE_AFFECTED_OBJ1)) $criteria->add(AppNotesPeer::NOTE_AFFECTED_OBJ1, $this->note_affected_obj1);
- if ($this->isColumnModified(AppNotesPeer::NOTE_AFFECTED_OBJ2)) $criteria->add(AppNotesPeer::NOTE_AFFECTED_OBJ2, $this->note_affected_obj2);
- if ($this->isColumnModified(AppNotesPeer::NOTE_RECIPIENTS)) $criteria->add(AppNotesPeer::NOTE_RECIPIENTS, $this->note_recipients);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppNotesPeer::DATABASE_NAME);
-
-
- return $criteria;
- }
-
- /**
- * Returns NULL since this table doesn't have a primary key.
- * This method exists only for BC and is deprecated!
- * @return null
- */
- public function getPrimaryKey()
- {
- return null;
- }
-
- /**
- * Dummy primary key setter.
- *
- * This function only exists to preserve backwards compatibility. It is no longer
- * needed or required by the Persistent interface. It will be removed in next BC-breaking
- * release of Propel.
- *
- * @deprecated
- */
- public function setPrimaryKey($pk)
- {
- // do nothing, because this object doesn't have any primary keys
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppNotes (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppUid($this->app_uid);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setNoteDate($this->note_date);
-
- $copyObj->setNoteContent($this->note_content);
-
- $copyObj->setNoteType($this->note_type);
-
- $copyObj->setNoteAvailability($this->note_availability);
-
- $copyObj->setNoteOriginObj($this->note_origin_obj);
-
- $copyObj->setNoteAffectedObj1($this->note_affected_obj1);
-
- $copyObj->setNoteAffectedObj2($this->note_affected_obj2);
-
- $copyObj->setNoteRecipients($this->note_recipients);
-
-
- $copyObj->setNew(true);
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppNotes Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppNotesPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppNotesPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppNotes
diff --git a/workflow/engine/classes/model/om/BaseAppNotesPeer.php b/workflow/engine/classes/model/om/BaseAppNotesPeer.php
index d9288222f..2efabc48c 100755
--- a/workflow/engine/classes/model/om/BaseAppNotesPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppNotesPeer.php
@@ -12,561 +12,561 @@ include_once 'classes/model/AppNotes.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppNotesPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'APP_NOTES';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppNotes';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 10;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_NOTES.APP_UID';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'APP_NOTES.USR_UID';
-
- /** the column name for the NOTE_DATE field */
- const NOTE_DATE = 'APP_NOTES.NOTE_DATE';
-
- /** the column name for the NOTE_CONTENT field */
- const NOTE_CONTENT = 'APP_NOTES.NOTE_CONTENT';
-
- /** the column name for the NOTE_TYPE field */
- const NOTE_TYPE = 'APP_NOTES.NOTE_TYPE';
-
- /** the column name for the NOTE_AVAILABILITY field */
- const NOTE_AVAILABILITY = 'APP_NOTES.NOTE_AVAILABILITY';
-
- /** the column name for the NOTE_ORIGIN_OBJ field */
- const NOTE_ORIGIN_OBJ = 'APP_NOTES.NOTE_ORIGIN_OBJ';
-
- /** the column name for the NOTE_AFFECTED_OBJ1 field */
- const NOTE_AFFECTED_OBJ1 = 'APP_NOTES.NOTE_AFFECTED_OBJ1';
-
- /** the column name for the NOTE_AFFECTED_OBJ2 field */
- const NOTE_AFFECTED_OBJ2 = 'APP_NOTES.NOTE_AFFECTED_OBJ2';
-
- /** the column name for the NOTE_RECIPIENTS field */
- const NOTE_RECIPIENTS = 'APP_NOTES.NOTE_RECIPIENTS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'NoteDate', 'NoteContent', 'NoteType', 'NoteAvailability', 'NoteOriginObj', 'NoteAffectedObj1', 'NoteAffectedObj2', 'NoteRecipients', ),
- BasePeer::TYPE_COLNAME => array (AppNotesPeer::APP_UID, AppNotesPeer::USR_UID, AppNotesPeer::NOTE_DATE, AppNotesPeer::NOTE_CONTENT, AppNotesPeer::NOTE_TYPE, AppNotesPeer::NOTE_AVAILABILITY, AppNotesPeer::NOTE_ORIGIN_OBJ, AppNotesPeer::NOTE_AFFECTED_OBJ1, AppNotesPeer::NOTE_AFFECTED_OBJ2, AppNotesPeer::NOTE_RECIPIENTS, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'NOTE_DATE', 'NOTE_CONTENT', 'NOTE_TYPE', 'NOTE_AVAILABILITY', 'NOTE_ORIGIN_OBJ', 'NOTE_AFFECTED_OBJ1', 'NOTE_AFFECTED_OBJ2', 'NOTE_RECIPIENTS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'NoteDate' => 2, 'NoteContent' => 3, 'NoteType' => 4, 'NoteAvailability' => 5, 'NoteOriginObj' => 6, 'NoteAffectedObj1' => 7, 'NoteAffectedObj2' => 8, 'NoteRecipients' => 9, ),
- BasePeer::TYPE_COLNAME => array (AppNotesPeer::APP_UID => 0, AppNotesPeer::USR_UID => 1, AppNotesPeer::NOTE_DATE => 2, AppNotesPeer::NOTE_CONTENT => 3, AppNotesPeer::NOTE_TYPE => 4, AppNotesPeer::NOTE_AVAILABILITY => 5, AppNotesPeer::NOTE_ORIGIN_OBJ => 6, AppNotesPeer::NOTE_AFFECTED_OBJ1 => 7, AppNotesPeer::NOTE_AFFECTED_OBJ2 => 8, AppNotesPeer::NOTE_RECIPIENTS => 9, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'NOTE_DATE' => 2, 'NOTE_CONTENT' => 3, 'NOTE_TYPE' => 4, 'NOTE_AVAILABILITY' => 5, 'NOTE_ORIGIN_OBJ' => 6, 'NOTE_AFFECTED_OBJ1' => 7, 'NOTE_AFFECTED_OBJ2' => 8, 'NOTE_RECIPIENTS' => 9, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppNotesMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppNotesMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppNotesPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppNotesPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppNotesPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppNotesPeer::APP_UID);
-
- $criteria->addSelectColumn(AppNotesPeer::USR_UID);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_DATE);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_CONTENT);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_TYPE);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_AVAILABILITY);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_ORIGIN_OBJ);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ1);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
-
- $criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
-
- }
-
- const COUNT = 'COUNT(*)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT *)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppNotesPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppNotesPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppNotesPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppNotes
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppNotesPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppNotesPeer::populateObjects(AppNotesPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppNotesPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppNotesPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppNotesPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppNotes or Criteria object.
- *
- * @param mixed $values Criteria or AppNotes object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppNotes object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppNotes or Criteria object.
- *
- * @param mixed $values Criteria or AppNotes object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- } else { // $values is AppNotes object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_NOTES table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppNotesPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppNotes or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppNotes object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppNotes) {
-
- $criteria = $values->buildCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- }
-
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppNotes object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppNotes $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppNotes $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppNotesPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppNotesPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(AppNotesPeer::DATABASE_NAME, AppNotesPeer::TABLE_NAME, $columns);
- }
-
-} // BaseAppNotesPeer
+abstract class BaseAppNotesPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_NOTES';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppNotes';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 10;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_NOTES.APP_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'APP_NOTES.USR_UID';
+
+ /** the column name for the NOTE_DATE field */
+ const NOTE_DATE = 'APP_NOTES.NOTE_DATE';
+
+ /** the column name for the NOTE_CONTENT field */
+ const NOTE_CONTENT = 'APP_NOTES.NOTE_CONTENT';
+
+ /** the column name for the NOTE_TYPE field */
+ const NOTE_TYPE = 'APP_NOTES.NOTE_TYPE';
+
+ /** the column name for the NOTE_AVAILABILITY field */
+ const NOTE_AVAILABILITY = 'APP_NOTES.NOTE_AVAILABILITY';
+
+ /** the column name for the NOTE_ORIGIN_OBJ field */
+ const NOTE_ORIGIN_OBJ = 'APP_NOTES.NOTE_ORIGIN_OBJ';
+
+ /** the column name for the NOTE_AFFECTED_OBJ1 field */
+ const NOTE_AFFECTED_OBJ1 = 'APP_NOTES.NOTE_AFFECTED_OBJ1';
+
+ /** the column name for the NOTE_AFFECTED_OBJ2 field */
+ const NOTE_AFFECTED_OBJ2 = 'APP_NOTES.NOTE_AFFECTED_OBJ2';
+
+ /** the column name for the NOTE_RECIPIENTS field */
+ const NOTE_RECIPIENTS = 'APP_NOTES.NOTE_RECIPIENTS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'NoteDate', 'NoteContent', 'NoteType', 'NoteAvailability', 'NoteOriginObj', 'NoteAffectedObj1', 'NoteAffectedObj2', 'NoteRecipients', ),
+ BasePeer::TYPE_COLNAME => array (AppNotesPeer::APP_UID, AppNotesPeer::USR_UID, AppNotesPeer::NOTE_DATE, AppNotesPeer::NOTE_CONTENT, AppNotesPeer::NOTE_TYPE, AppNotesPeer::NOTE_AVAILABILITY, AppNotesPeer::NOTE_ORIGIN_OBJ, AppNotesPeer::NOTE_AFFECTED_OBJ1, AppNotesPeer::NOTE_AFFECTED_OBJ2, AppNotesPeer::NOTE_RECIPIENTS, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'NOTE_DATE', 'NOTE_CONTENT', 'NOTE_TYPE', 'NOTE_AVAILABILITY', 'NOTE_ORIGIN_OBJ', 'NOTE_AFFECTED_OBJ1', 'NOTE_AFFECTED_OBJ2', 'NOTE_RECIPIENTS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'NoteDate' => 2, 'NoteContent' => 3, 'NoteType' => 4, 'NoteAvailability' => 5, 'NoteOriginObj' => 6, 'NoteAffectedObj1' => 7, 'NoteAffectedObj2' => 8, 'NoteRecipients' => 9, ),
+ BasePeer::TYPE_COLNAME => array (AppNotesPeer::APP_UID => 0, AppNotesPeer::USR_UID => 1, AppNotesPeer::NOTE_DATE => 2, AppNotesPeer::NOTE_CONTENT => 3, AppNotesPeer::NOTE_TYPE => 4, AppNotesPeer::NOTE_AVAILABILITY => 5, AppNotesPeer::NOTE_ORIGIN_OBJ => 6, AppNotesPeer::NOTE_AFFECTED_OBJ1 => 7, AppNotesPeer::NOTE_AFFECTED_OBJ2 => 8, AppNotesPeer::NOTE_RECIPIENTS => 9, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'NOTE_DATE' => 2, 'NOTE_CONTENT' => 3, 'NOTE_TYPE' => 4, 'NOTE_AVAILABILITY' => 5, 'NOTE_ORIGIN_OBJ' => 6, 'NOTE_AFFECTED_OBJ1' => 7, 'NOTE_AFFECTED_OBJ2' => 8, 'NOTE_RECIPIENTS' => 9, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppNotesMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppNotesMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppNotesPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppNotesPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppNotesPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppNotesPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppNotesPeer::USR_UID);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_DATE);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_CONTENT);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_TYPE);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_AVAILABILITY);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_ORIGIN_OBJ);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ1);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
+
+ $criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
+
+ }
+
+ const COUNT = 'COUNT(*)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT *)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppNotesPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppNotesPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppNotesPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppNotes
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppNotesPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppNotesPeer::populateObjects(AppNotesPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppNotesPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppNotesPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppNotesPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppNotes or Criteria object.
+ *
+ * @param mixed $values Criteria or AppNotes object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppNotes object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppNotes or Criteria object.
+ *
+ * @param mixed $values Criteria or AppNotes object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_NOTES table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppNotesPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppNotes or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppNotes object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppNotes) {
+
+ $criteria = $values->buildCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ }
+
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppNotes object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppNotes $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppNotes $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppNotesPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppNotesPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(AppNotesPeer::DATABASE_NAME, AppNotesPeer::TABLE_NAME, $columns);
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppNotesPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppNotesPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppNotesMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppNotesMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppNotesMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppNotesMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppOwner.php b/workflow/engine/classes/model/om/BaseAppOwner.php
index 11226737d..bb29abd74 100755
--- a/workflow/engine/classes/model/om/BaseAppOwner.php
+++ b/workflow/engine/classes/model/om/BaseAppOwner.php
@@ -16,612 +16,628 @@ include_once 'classes/model/AppOwnerPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppOwner extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppOwnerPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the own_uid field.
- * @var string
- */
- protected $own_uid = '';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [own_uid] column value.
- *
- * @return string
- */
- public function getOwnUid()
- {
-
- return $this->own_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppOwnerPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [own_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOwnUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->own_uid !== $v || $v === '') {
- $this->own_uid = $v;
- $this->modifiedColumns[] = AppOwnerPeer::OWN_UID;
- }
-
- } // setOwnUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = AppOwnerPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->own_uid = $rs->getString($startcol + 1);
-
- $this->usr_uid = $rs->getString($startcol + 2);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 3; // 3 = AppOwnerPeer::NUM_COLUMNS - AppOwnerPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppOwner object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppOwnerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppOwnerPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppOwnerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppOwnerPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppOwnerPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppOwnerPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getOwnUid();
- break;
- case 2:
- return $this->getUsrUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppOwnerPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getOwnUid(),
- $keys[2] => $this->getUsrUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setOwnUid($value);
- break;
- case 2:
- $this->setUsrUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppOwnerPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setOwnUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setUsrUid($arr[$keys[2]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppOwnerPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppOwnerPeer::APP_UID)) $criteria->add(AppOwnerPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppOwnerPeer::OWN_UID)) $criteria->add(AppOwnerPeer::OWN_UID, $this->own_uid);
- if ($this->isColumnModified(AppOwnerPeer::USR_UID)) $criteria->add(AppOwnerPeer::USR_UID, $this->usr_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppOwnerPeer::DATABASE_NAME);
-
- $criteria->add(AppOwnerPeer::APP_UID, $this->app_uid);
- $criteria->add(AppOwnerPeer::OWN_UID, $this->own_uid);
- $criteria->add(AppOwnerPeer::USR_UID, $this->usr_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getAppUid();
-
- $pks[1] = $this->getOwnUid();
-
- $pks[2] = $this->getUsrUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setAppUid($keys[0]);
-
- $this->setOwnUid($keys[1]);
-
- $this->setUsrUid($keys[2]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppOwner (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setOwnUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppOwner Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppOwnerPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppOwnerPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppOwner
+abstract class BaseAppOwner extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppOwnerPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the own_uid field.
+ * @var string
+ */
+ protected $own_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [own_uid] column value.
+ *
+ * @return string
+ */
+ public function getOwnUid()
+ {
+
+ return $this->own_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppOwnerPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [own_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOwnUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->own_uid !== $v || $v === '') {
+ $this->own_uid = $v;
+ $this->modifiedColumns[] = AppOwnerPeer::OWN_UID;
+ }
+
+ } // setOwnUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = AppOwnerPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->own_uid = $rs->getString($startcol + 1);
+
+ $this->usr_uid = $rs->getString($startcol + 2);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 3; // 3 = AppOwnerPeer::NUM_COLUMNS - AppOwnerPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppOwner object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppOwnerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppOwnerPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppOwnerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppOwnerPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppOwnerPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppOwnerPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getOwnUid();
+ break;
+ case 2:
+ return $this->getUsrUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppOwnerPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getOwnUid(),
+ $keys[2] => $this->getUsrUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setOwnUid($value);
+ break;
+ case 2:
+ $this->setUsrUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppOwnerPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setOwnUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setUsrUid($arr[$keys[2]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppOwnerPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppOwnerPeer::APP_UID)) {
+ $criteria->add(AppOwnerPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppOwnerPeer::OWN_UID)) {
+ $criteria->add(AppOwnerPeer::OWN_UID, $this->own_uid);
+ }
+
+ if ($this->isColumnModified(AppOwnerPeer::USR_UID)) {
+ $criteria->add(AppOwnerPeer::USR_UID, $this->usr_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppOwnerPeer::DATABASE_NAME);
+
+ $criteria->add(AppOwnerPeer::APP_UID, $this->app_uid);
+ $criteria->add(AppOwnerPeer::OWN_UID, $this->own_uid);
+ $criteria->add(AppOwnerPeer::USR_UID, $this->usr_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getAppUid();
+
+ $pks[1] = $this->getOwnUid();
+
+ $pks[2] = $this->getUsrUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setAppUid($keys[0]);
+
+ $this->setOwnUid($keys[1]);
+
+ $this->setUsrUid($keys[2]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppOwner (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setOwnUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppOwner Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppOwnerPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppOwnerPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseAppOwnerPeer.php b/workflow/engine/classes/model/om/BaseAppOwnerPeer.php
index 8c84cddee..b1100a957 100755
--- a/workflow/engine/classes/model/om/BaseAppOwnerPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppOwnerPeer.php
@@ -12,562 +12,563 @@ include_once 'classes/model/AppOwner.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppOwnerPeer {
+abstract class BaseAppOwnerPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'APP_OWNER';
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_OWNER';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppOwner';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppOwner';
- /** The total number of columns. */
- const NUM_COLUMNS = 3;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 3;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_OWNER.APP_UID';
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_OWNER.APP_UID';
- /** the column name for the OWN_UID field */
- const OWN_UID = 'APP_OWNER.OWN_UID';
+ /** the column name for the OWN_UID field */
+ const OWN_UID = 'APP_OWNER.OWN_UID';
- /** the column name for the USR_UID field */
- const USR_UID = 'APP_OWNER.USR_UID';
+ /** the column name for the USR_UID field */
+ const USR_UID = 'APP_OWNER.USR_UID';
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'OwnUid', 'UsrUid', ),
- BasePeer::TYPE_COLNAME => array (AppOwnerPeer::APP_UID, AppOwnerPeer::OWN_UID, AppOwnerPeer::USR_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'OWN_UID', 'USR_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'OwnUid', 'UsrUid', ),
+ BasePeer::TYPE_COLNAME => array (AppOwnerPeer::APP_UID, AppOwnerPeer::OWN_UID, AppOwnerPeer::USR_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'OWN_UID', 'USR_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'OwnUid' => 1, 'UsrUid' => 2, ),
- BasePeer::TYPE_COLNAME => array (AppOwnerPeer::APP_UID => 0, AppOwnerPeer::OWN_UID => 1, AppOwnerPeer::USR_UID => 2, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'OWN_UID' => 1, 'USR_UID' => 2, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'OwnUid' => 1, 'UsrUid' => 2, ),
+ BasePeer::TYPE_COLNAME => array (AppOwnerPeer::APP_UID => 0, AppOwnerPeer::OWN_UID => 1, AppOwnerPeer::USR_UID => 2, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'OWN_UID' => 1, 'USR_UID' => 2, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppOwnerMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppOwnerMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppOwnerPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppOwnerMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppOwnerMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppOwnerPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppOwnerPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppOwnerPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppOwnerPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppOwnerPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(AppOwnerPeer::APP_UID);
+ $criteria->addSelectColumn(AppOwnerPeer::APP_UID);
- $criteria->addSelectColumn(AppOwnerPeer::OWN_UID);
+ $criteria->addSelectColumn(AppOwnerPeer::OWN_UID);
- $criteria->addSelectColumn(AppOwnerPeer::USR_UID);
+ $criteria->addSelectColumn(AppOwnerPeer::USR_UID);
- }
+ }
- const COUNT = 'COUNT(APP_OWNER.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_OWNER.APP_UID)';
+ const COUNT = 'COUNT(APP_OWNER.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_OWNER.APP_UID)';
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppOwnerPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppOwnerPeer::COUNT);
- }
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppOwnerPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppOwnerPeer::COUNT);
+ }
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
- $rs = AppOwnerPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppOwner
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppOwnerPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppOwnerPeer::populateObjects(AppOwnerPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $rs = AppOwnerPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppOwner
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppOwnerPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppOwnerPeer::populateObjects(AppOwnerPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppOwnerPeer::addSelectColumns($criteria);
- }
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppOwnerPeer::addSelectColumns($criteria);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppOwnerPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppOwnerPeer::CLASS_DEFAULT;
- }
+ // set the class once to avoid overhead in the loop
+ $cls = AppOwnerPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
- /**
- * Method perform an INSERT on the database, given a AppOwner or Criteria object.
- *
- * @param mixed $values Criteria or AppOwner object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppOwner object
- }
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppOwnerPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppOwner or Criteria object.
+ *
+ * @param mixed $values Criteria or AppOwner object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppOwner object
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
- return $pk;
- }
+ return $pk;
+ }
- /**
- * Method perform an UPDATE on the database, given a AppOwner or Criteria object.
- *
- * @param mixed $values Criteria or AppOwner object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Method perform an UPDATE on the database, given a AppOwner or Criteria object.
+ *
+ * @param mixed $values Criteria or AppOwner object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $selectCriteria = new Criteria(self::DATABASE_NAME);
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
- $comparison = $criteria->getComparison(AppOwnerPeer::APP_UID);
- $selectCriteria->add(AppOwnerPeer::APP_UID, $criteria->remove(AppOwnerPeer::APP_UID), $comparison);
+ $comparison = $criteria->getComparison(AppOwnerPeer::APP_UID);
+ $selectCriteria->add(AppOwnerPeer::APP_UID, $criteria->remove(AppOwnerPeer::APP_UID), $comparison);
- $comparison = $criteria->getComparison(AppOwnerPeer::OWN_UID);
- $selectCriteria->add(AppOwnerPeer::OWN_UID, $criteria->remove(AppOwnerPeer::OWN_UID), $comparison);
+ $comparison = $criteria->getComparison(AppOwnerPeer::OWN_UID);
+ $selectCriteria->add(AppOwnerPeer::OWN_UID, $criteria->remove(AppOwnerPeer::OWN_UID), $comparison);
- $comparison = $criteria->getComparison(AppOwnerPeer::USR_UID);
- $selectCriteria->add(AppOwnerPeer::USR_UID, $criteria->remove(AppOwnerPeer::USR_UID), $comparison);
+ $comparison = $criteria->getComparison(AppOwnerPeer::USR_UID);
+ $selectCriteria->add(AppOwnerPeer::USR_UID, $criteria->remove(AppOwnerPeer::USR_UID), $comparison);
- } else { // $values is AppOwner object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
- /**
- * Method to DELETE all rows from the APP_OWNER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppOwnerPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ /**
+ * Method to DELETE all rows from the APP_OWNER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppOwnerPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- /**
- * Method perform a DELETE on the database, given a AppOwner or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppOwner object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppOwnerPeer::DATABASE_NAME);
- }
+ /**
+ * Method perform a DELETE on the database, given a AppOwner or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppOwner object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppOwnerPeer::DATABASE_NAME);
+ }
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppOwner) {
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppOwner) {
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- }
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ }
- $criteria->add(AppOwnerPeer::APP_UID, $vals[0], Criteria::IN);
- $criteria->add(AppOwnerPeer::OWN_UID, $vals[1], Criteria::IN);
- $criteria->add(AppOwnerPeer::USR_UID, $vals[2], Criteria::IN);
- }
+ $criteria->add(AppOwnerPeer::APP_UID, $vals[0], Criteria::IN);
+ $criteria->add(AppOwnerPeer::OWN_UID, $vals[1], Criteria::IN);
+ $criteria->add(AppOwnerPeer::USR_UID, $vals[2], Criteria::IN);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- $affectedRows = 0; // initialize var to track total num of affected rows
+ $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
- /**
- * Validates all modified columns of given AppOwner object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppOwner $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppOwner $obj, $cols = null)
- {
- $columns = array();
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppOwnerPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppOwnerPeer::TABLE_NAME);
+ /**
+ * Validates all modified columns of given AppOwner object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppOwner $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppOwner $obj, $cols = null)
+ {
+ $columns = array();
- if (! is_array($cols)) {
- $cols = array($cols);
- }
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppOwnerPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppOwnerPeer::TABLE_NAME);
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
- }
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
- return BasePeer::doValidate(AppOwnerPeer::DATABASE_NAME, AppOwnerPeer::TABLE_NAME, $columns);
- }
+ }
- /**
- * Retrieve object using using composite pkey values.
- * @param string $app_uid
- @param string $own_uid
- @param string $usr_uid
-
- * @param Connection $con
- * @return AppOwner
- */
- public static function retrieveByPK( $app_uid, $own_uid, $usr_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(AppOwnerPeer::APP_UID, $app_uid);
- $criteria->add(AppOwnerPeer::OWN_UID, $own_uid);
- $criteria->add(AppOwnerPeer::USR_UID, $usr_uid);
- $v = AppOwnerPeer::doSelect($criteria, $con);
+ return BasePeer::doValidate(AppOwnerPeer::DATABASE_NAME, AppOwnerPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $app_uid
+ * @param string $own_uid
+ * @param string $usr_uid
+ * @param Connection $con
+ * @return AppOwner
+ */
+ public static function retrieveByPK($app_uid, $own_uid, $usr_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(AppOwnerPeer::APP_UID, $app_uid);
+ $criteria->add(AppOwnerPeer::OWN_UID, $own_uid);
+ $criteria->add(AppOwnerPeer::USR_UID, $usr_uid);
+ $v = AppOwnerPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- return !empty($v) ? $v[0] : null;
- }
-} // BaseAppOwnerPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppOwnerPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppOwnerPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppOwnerMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppOwnerMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppOwnerMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppOwnerMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppSolrQueue.php b/workflow/engine/classes/model/om/BaseAppSolrQueue.php
index e025cc0d8..0cd4abaa7 100644
--- a/workflow/engine/classes/model/om/BaseAppSolrQueue.php
+++ b/workflow/engine/classes/model/om/BaseAppSolrQueue.php
@@ -16,542 +16,553 @@ include_once 'classes/model/AppSolrQueuePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppSolrQueue extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppSolrQueuePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the app_updated field.
- * @var int
- */
- protected $app_updated = 1;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [app_updated] column value.
- *
- * @return int
- */
- public function getAppUpdated()
- {
-
- return $this->app_updated;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppSolrQueuePeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [app_updated] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppUpdated($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->app_updated !== $v || $v === 1) {
- $this->app_updated = $v;
- $this->modifiedColumns[] = AppSolrQueuePeer::APP_UPDATED;
- }
-
- } // setAppUpdated()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->app_updated = $rs->getInt($startcol + 1);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 2; // 2 = AppSolrQueuePeer::NUM_COLUMNS - AppSolrQueuePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppSolrQueue object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppSolrQueuePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppSolrQueuePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppSolrQueuePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppSolrQueuePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppSolrQueuePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getAppUpdated();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppSolrQueuePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getAppUpdated(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppSolrQueuePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setAppUpdated($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppSolrQueuePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAppUpdated($arr[$keys[1]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppSolrQueuePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppSolrQueuePeer::APP_UID)) $criteria->add(AppSolrQueuePeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppSolrQueuePeer::APP_UPDATED)) $criteria->add(AppSolrQueuePeer::APP_UPDATED, $this->app_updated);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppSolrQueuePeer::DATABASE_NAME);
-
- $criteria->add(AppSolrQueuePeer::APP_UID, $this->app_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getAppUid();
- }
-
- /**
- * Generic method to set the primary key (app_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setAppUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppSolrQueue (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppUpdated($this->app_updated);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppSolrQueue Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppSolrQueuePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppSolrQueuePeer();
- }
- return self::$peer;
- }
-
-} // BaseAppSolrQueue
+abstract class BaseAppSolrQueue extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppSolrQueuePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the app_updated field.
+ * @var int
+ */
+ protected $app_updated = 1;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [app_updated] column value.
+ *
+ * @return int
+ */
+ public function getAppUpdated()
+ {
+
+ return $this->app_updated;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppSolrQueuePeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [app_updated] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppUpdated($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->app_updated !== $v || $v === 1) {
+ $this->app_updated = $v;
+ $this->modifiedColumns[] = AppSolrQueuePeer::APP_UPDATED;
+ }
+
+ } // setAppUpdated()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->app_updated = $rs->getInt($startcol + 1);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 2; // 2 = AppSolrQueuePeer::NUM_COLUMNS - AppSolrQueuePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppSolrQueue object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppSolrQueuePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppSolrQueuePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppSolrQueuePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppSolrQueuePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppSolrQueuePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getAppUpdated();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppSolrQueuePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getAppUpdated(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppSolrQueuePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setAppUpdated($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppSolrQueuePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setAppUpdated($arr[$keys[1]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppSolrQueuePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppSolrQueuePeer::APP_UID)) {
+ $criteria->add(AppSolrQueuePeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppSolrQueuePeer::APP_UPDATED)) {
+ $criteria->add(AppSolrQueuePeer::APP_UPDATED, $this->app_updated);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppSolrQueuePeer::DATABASE_NAME);
+
+ $criteria->add(AppSolrQueuePeer::APP_UID, $this->app_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getAppUid();
+ }
+
+ /**
+ * Generic method to set the primary key (app_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setAppUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppSolrQueue (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAppUpdated($this->app_updated);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppSolrQueue Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppSolrQueuePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppSolrQueuePeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseAppSolrQueuePeer.php b/workflow/engine/classes/model/om/BaseAppSolrQueuePeer.php
index 55abc052e..5d72338fd 100644
--- a/workflow/engine/classes/model/om/BaseAppSolrQueuePeer.php
+++ b/workflow/engine/classes/model/om/BaseAppSolrQueuePeer.php
@@ -12,559 +12,561 @@ include_once 'classes/model/AppSolrQueue.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppSolrQueuePeer {
+abstract class BaseAppSolrQueuePeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'APP_SOLR_QUEUE';
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_SOLR_QUEUE';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppSolrQueue';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppSolrQueue';
- /** The total number of columns. */
- const NUM_COLUMNS = 2;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 2;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_SOLR_QUEUE.APP_UID';
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_SOLR_QUEUE.APP_UID';
- /** the column name for the APP_UPDATED field */
- const APP_UPDATED = 'APP_SOLR_QUEUE.APP_UPDATED';
+ /** the column name for the APP_UPDATED field */
+ const APP_UPDATED = 'APP_SOLR_QUEUE.APP_UPDATED';
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppUpdated', ),
- BasePeer::TYPE_COLNAME => array (AppSolrQueuePeer::APP_UID, AppSolrQueuePeer::APP_UPDATED, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_UPDATED', ),
- BasePeer::TYPE_NUM => array (0, 1, )
- );
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppUpdated', ),
+ BasePeer::TYPE_COLNAME => array (AppSolrQueuePeer::APP_UID, AppSolrQueuePeer::APP_UPDATED, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_UPDATED', ),
+ BasePeer::TYPE_NUM => array (0, 1, )
+ );
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppUpdated' => 1, ),
- BasePeer::TYPE_COLNAME => array (AppSolrQueuePeer::APP_UID => 0, AppSolrQueuePeer::APP_UPDATED => 1, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_UPDATED' => 1, ),
- BasePeer::TYPE_NUM => array (0, 1, )
- );
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppUpdated' => 1, ),
+ BasePeer::TYPE_COLNAME => array (AppSolrQueuePeer::APP_UID => 0, AppSolrQueuePeer::APP_UPDATED => 1, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_UPDATED' => 1, ),
+ BasePeer::TYPE_NUM => array (0, 1, )
+ );
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppSolrQueueMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppSolrQueueMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppSolrQueuePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppSolrQueueMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppSolrQueueMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppSolrQueuePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppSolrQueuePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppSolrQueuePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppSolrQueuePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppSolrQueuePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(AppSolrQueuePeer::APP_UID);
+ $criteria->addSelectColumn(AppSolrQueuePeer::APP_UID);
- $criteria->addSelectColumn(AppSolrQueuePeer::APP_UPDATED);
+ $criteria->addSelectColumn(AppSolrQueuePeer::APP_UPDATED);
- }
+ }
- const COUNT = 'COUNT(APP_SOLR_QUEUE.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_SOLR_QUEUE.APP_UID)';
+ const COUNT = 'COUNT(APP_SOLR_QUEUE.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_SOLR_QUEUE.APP_UID)';
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppSolrQueuePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppSolrQueuePeer::COUNT);
- }
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppSolrQueuePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppSolrQueuePeer::COUNT);
+ }
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
- $rs = AppSolrQueuePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppSolrQueue
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppSolrQueuePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppSolrQueuePeer::populateObjects(AppSolrQueuePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $rs = AppSolrQueuePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppSolrQueue
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppSolrQueuePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppSolrQueuePeer::populateObjects(AppSolrQueuePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppSolrQueuePeer::addSelectColumns($criteria);
- }
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppSolrQueuePeer::addSelectColumns($criteria);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppSolrQueuePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppSolrQueuePeer::CLASS_DEFAULT;
- }
+ // set the class once to avoid overhead in the loop
+ $cls = AppSolrQueuePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
- /**
- * Method perform an INSERT on the database, given a AppSolrQueue or Criteria object.
- *
- * @param mixed $values Criteria or AppSolrQueue object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppSolrQueue object
- }
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppSolrQueuePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppSolrQueue or Criteria object.
+ *
+ * @param mixed $values Criteria or AppSolrQueue object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppSolrQueue object
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
- return $pk;
- }
+ return $pk;
+ }
- /**
- * Method perform an UPDATE on the database, given a AppSolrQueue or Criteria object.
- *
- * @param mixed $values Criteria or AppSolrQueue object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Method perform an UPDATE on the database, given a AppSolrQueue or Criteria object.
+ *
+ * @param mixed $values Criteria or AppSolrQueue object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $selectCriteria = new Criteria(self::DATABASE_NAME);
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
- $comparison = $criteria->getComparison(AppSolrQueuePeer::APP_UID);
- $selectCriteria->add(AppSolrQueuePeer::APP_UID, $criteria->remove(AppSolrQueuePeer::APP_UID), $comparison);
+ $comparison = $criteria->getComparison(AppSolrQueuePeer::APP_UID);
+ $selectCriteria->add(AppSolrQueuePeer::APP_UID, $criteria->remove(AppSolrQueuePeer::APP_UID), $comparison);
- } else { // $values is AppSolrQueue object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
- /**
- * Method to DELETE all rows from the APP_SOLR_QUEUE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppSolrQueuePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ /**
+ * Method to DELETE all rows from the APP_SOLR_QUEUE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppSolrQueuePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- /**
- * Method perform a DELETE on the database, given a AppSolrQueue or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppSolrQueue object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
- }
+ /**
+ * Method perform a DELETE on the database, given a AppSolrQueue or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppSolrQueue object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
+ }
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppSolrQueue) {
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppSolrQueue) {
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(AppSolrQueuePeer::APP_UID, (array) $values, Criteria::IN);
- }
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(AppSolrQueuePeer::APP_UID, (array) $values, Criteria::IN);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- $affectedRows = 0; // initialize var to track total num of affected rows
+ $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
- /**
- * Validates all modified columns of given AppSolrQueue object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppSolrQueue $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppSolrQueue $obj, $cols = null)
- {
- $columns = array();
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppSolrQueuePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppSolrQueuePeer::TABLE_NAME);
+ /**
+ * Validates all modified columns of given AppSolrQueue object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppSolrQueue $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppSolrQueue $obj, $cols = null)
+ {
+ $columns = array();
- if (! is_array($cols)) {
- $cols = array($cols);
- }
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppSolrQueuePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppSolrQueuePeer::TABLE_NAME);
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
- }
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
- return BasePeer::doValidate(AppSolrQueuePeer::DATABASE_NAME, AppSolrQueuePeer::TABLE_NAME, $columns);
- }
+ }
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return AppSolrQueue
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ return BasePeer::doValidate(AppSolrQueuePeer::DATABASE_NAME, AppSolrQueuePeer::TABLE_NAME, $columns);
+ }
- $criteria = new Criteria(AppSolrQueuePeer::DATABASE_NAME);
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return AppSolrQueue
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $criteria->add(AppSolrQueuePeer::APP_UID, $pk);
+ $criteria = new Criteria(AppSolrQueuePeer::DATABASE_NAME);
+
+ $criteria->add(AppSolrQueuePeer::APP_UID, $pk);
- $v = AppSolrQueuePeer::doSelect($criteria, $con);
+ $v = AppSolrQueuePeer::doSelect($criteria, $con);
- return !empty($v) > 0 ? $v[0] : null;
- }
+ return !empty($v) > 0 ? $v[0] : null;
+ }
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(AppSolrQueuePeer::APP_UID, $pks, Criteria::IN);
- $objs = AppSolrQueuePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(AppSolrQueuePeer::APP_UID, $pks, Criteria::IN);
+ $objs = AppSolrQueuePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
-} // BaseAppSolrQueuePeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppSolrQueuePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppSolrQueuePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppSolrQueueMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppSolrQueueMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppSolrQueueMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppSolrQueueMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseAppThread.php b/workflow/engine/classes/model/om/BaseAppThread.php
index c22774036..f3b475abf 100755
--- a/workflow/engine/classes/model/om/BaseAppThread.php
+++ b/workflow/engine/classes/model/om/BaseAppThread.php
@@ -16,713 +16,739 @@ include_once 'classes/model/AppThreadPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppThread extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var AppThreadPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the app_thread_index field.
- * @var int
- */
- protected $app_thread_index = 0;
-
-
- /**
- * The value for the app_thread_parent field.
- * @var int
- */
- protected $app_thread_parent = 0;
-
-
- /**
- * The value for the app_thread_status field.
- * @var string
- */
- protected $app_thread_status = 'OPEN';
-
-
- /**
- * The value for the del_index field.
- * @var int
- */
- protected $del_index = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [app_thread_index] column value.
- *
- * @return int
- */
- public function getAppThreadIndex()
- {
-
- return $this->app_thread_index;
- }
-
- /**
- * Get the [app_thread_parent] column value.
- *
- * @return int
- */
- public function getAppThreadParent()
- {
-
- return $this->app_thread_parent;
- }
-
- /**
- * Get the [app_thread_status] column value.
- *
- * @return string
- */
- public function getAppThreadStatus()
- {
-
- return $this->app_thread_status;
- }
-
- /**
- * Get the [del_index] column value.
- *
- * @return int
- */
- public function getDelIndex()
- {
-
- return $this->del_index;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = AppThreadPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [app_thread_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppThreadIndex($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->app_thread_index !== $v || $v === 0) {
- $this->app_thread_index = $v;
- $this->modifiedColumns[] = AppThreadPeer::APP_THREAD_INDEX;
- }
-
- } // setAppThreadIndex()
-
- /**
- * Set the value of [app_thread_parent] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppThreadParent($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->app_thread_parent !== $v || $v === 0) {
- $this->app_thread_parent = $v;
- $this->modifiedColumns[] = AppThreadPeer::APP_THREAD_PARENT;
- }
-
- } // setAppThreadParent()
-
- /**
- * Set the value of [app_thread_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppThreadStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_thread_status !== $v || $v === 'OPEN') {
- $this->app_thread_status = $v;
- $this->modifiedColumns[] = AppThreadPeer::APP_THREAD_STATUS;
- }
-
- } // setAppThreadStatus()
-
- /**
- * Set the value of [del_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndex($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->del_index !== $v || $v === 0) {
- $this->del_index = $v;
- $this->modifiedColumns[] = AppThreadPeer::DEL_INDEX;
- }
-
- } // setDelIndex()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->app_thread_index = $rs->getInt($startcol + 1);
-
- $this->app_thread_parent = $rs->getInt($startcol + 2);
-
- $this->app_thread_status = $rs->getString($startcol + 3);
-
- $this->del_index = $rs->getInt($startcol + 4);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = AppThreadPeer::NUM_COLUMNS - AppThreadPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating AppThread object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppThreadPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- AppThreadPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(AppThreadPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = AppThreadPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += AppThreadPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = AppThreadPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppThreadPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getAppThreadIndex();
- break;
- case 2:
- return $this->getAppThreadParent();
- break;
- case 3:
- return $this->getAppThreadStatus();
- break;
- case 4:
- return $this->getDelIndex();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppThreadPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getAppThreadIndex(),
- $keys[2] => $this->getAppThreadParent(),
- $keys[3] => $this->getAppThreadStatus(),
- $keys[4] => $this->getDelIndex(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = AppThreadPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setAppThreadIndex($value);
- break;
- case 2:
- $this->setAppThreadParent($value);
- break;
- case 3:
- $this->setAppThreadStatus($value);
- break;
- case 4:
- $this->setDelIndex($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = AppThreadPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAppThreadIndex($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAppThreadParent($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setAppThreadStatus($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDelIndex($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(AppThreadPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(AppThreadPeer::APP_UID)) $criteria->add(AppThreadPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(AppThreadPeer::APP_THREAD_INDEX)) $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $this->app_thread_index);
- if ($this->isColumnModified(AppThreadPeer::APP_THREAD_PARENT)) $criteria->add(AppThreadPeer::APP_THREAD_PARENT, $this->app_thread_parent);
- if ($this->isColumnModified(AppThreadPeer::APP_THREAD_STATUS)) $criteria->add(AppThreadPeer::APP_THREAD_STATUS, $this->app_thread_status);
- if ($this->isColumnModified(AppThreadPeer::DEL_INDEX)) $criteria->add(AppThreadPeer::DEL_INDEX, $this->del_index);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(AppThreadPeer::DATABASE_NAME);
-
- $criteria->add(AppThreadPeer::APP_UID, $this->app_uid);
- $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $this->app_thread_index);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getAppUid();
-
- $pks[1] = $this->getAppThreadIndex();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setAppUid($keys[0]);
-
- $this->setAppThreadIndex($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of AppThread (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppThreadParent($this->app_thread_parent);
-
- $copyObj->setAppThreadStatus($this->app_thread_status);
-
- $copyObj->setDelIndex($this->del_index);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setAppThreadIndex('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return AppThread Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return AppThreadPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new AppThreadPeer();
- }
- return self::$peer;
- }
-
-} // BaseAppThread
+abstract class BaseAppThread extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var AppThreadPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the app_thread_index field.
+ * @var int
+ */
+ protected $app_thread_index = 0;
+
+ /**
+ * The value for the app_thread_parent field.
+ * @var int
+ */
+ protected $app_thread_parent = 0;
+
+ /**
+ * The value for the app_thread_status field.
+ * @var string
+ */
+ protected $app_thread_status = 'OPEN';
+
+ /**
+ * The value for the del_index field.
+ * @var int
+ */
+ protected $del_index = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [app_thread_index] column value.
+ *
+ * @return int
+ */
+ public function getAppThreadIndex()
+ {
+
+ return $this->app_thread_index;
+ }
+
+ /**
+ * Get the [app_thread_parent] column value.
+ *
+ * @return int
+ */
+ public function getAppThreadParent()
+ {
+
+ return $this->app_thread_parent;
+ }
+
+ /**
+ * Get the [app_thread_status] column value.
+ *
+ * @return string
+ */
+ public function getAppThreadStatus()
+ {
+
+ return $this->app_thread_status;
+ }
+
+ /**
+ * Get the [del_index] column value.
+ *
+ * @return int
+ */
+ public function getDelIndex()
+ {
+
+ return $this->del_index;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = AppThreadPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [app_thread_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppThreadIndex($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->app_thread_index !== $v || $v === 0) {
+ $this->app_thread_index = $v;
+ $this->modifiedColumns[] = AppThreadPeer::APP_THREAD_INDEX;
+ }
+
+ } // setAppThreadIndex()
+
+ /**
+ * Set the value of [app_thread_parent] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppThreadParent($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->app_thread_parent !== $v || $v === 0) {
+ $this->app_thread_parent = $v;
+ $this->modifiedColumns[] = AppThreadPeer::APP_THREAD_PARENT;
+ }
+
+ } // setAppThreadParent()
+
+ /**
+ * Set the value of [app_thread_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppThreadStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_thread_status !== $v || $v === 'OPEN') {
+ $this->app_thread_status = $v;
+ $this->modifiedColumns[] = AppThreadPeer::APP_THREAD_STATUS;
+ }
+
+ } // setAppThreadStatus()
+
+ /**
+ * Set the value of [del_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndex($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->del_index !== $v || $v === 0) {
+ $this->del_index = $v;
+ $this->modifiedColumns[] = AppThreadPeer::DEL_INDEX;
+ }
+
+ } // setDelIndex()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->app_thread_index = $rs->getInt($startcol + 1);
+
+ $this->app_thread_parent = $rs->getInt($startcol + 2);
+
+ $this->app_thread_status = $rs->getString($startcol + 3);
+
+ $this->del_index = $rs->getInt($startcol + 4);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = AppThreadPeer::NUM_COLUMNS - AppThreadPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating AppThread object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppThreadPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ AppThreadPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(AppThreadPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = AppThreadPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += AppThreadPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = AppThreadPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppThreadPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getAppThreadIndex();
+ break;
+ case 2:
+ return $this->getAppThreadParent();
+ break;
+ case 3:
+ return $this->getAppThreadStatus();
+ break;
+ case 4:
+ return $this->getDelIndex();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppThreadPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getAppThreadIndex(),
+ $keys[2] => $this->getAppThreadParent(),
+ $keys[3] => $this->getAppThreadStatus(),
+ $keys[4] => $this->getDelIndex(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = AppThreadPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setAppThreadIndex($value);
+ break;
+ case 2:
+ $this->setAppThreadParent($value);
+ break;
+ case 3:
+ $this->setAppThreadStatus($value);
+ break;
+ case 4:
+ $this->setDelIndex($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = AppThreadPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setAppThreadIndex($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setAppThreadParent($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setAppThreadStatus($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setDelIndex($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(AppThreadPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(AppThreadPeer::APP_UID)) {
+ $criteria->add(AppThreadPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(AppThreadPeer::APP_THREAD_INDEX)) {
+ $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $this->app_thread_index);
+ }
+
+ if ($this->isColumnModified(AppThreadPeer::APP_THREAD_PARENT)) {
+ $criteria->add(AppThreadPeer::APP_THREAD_PARENT, $this->app_thread_parent);
+ }
+
+ if ($this->isColumnModified(AppThreadPeer::APP_THREAD_STATUS)) {
+ $criteria->add(AppThreadPeer::APP_THREAD_STATUS, $this->app_thread_status);
+ }
+
+ if ($this->isColumnModified(AppThreadPeer::DEL_INDEX)) {
+ $criteria->add(AppThreadPeer::DEL_INDEX, $this->del_index);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(AppThreadPeer::DATABASE_NAME);
+
+ $criteria->add(AppThreadPeer::APP_UID, $this->app_uid);
+ $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $this->app_thread_index);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getAppUid();
+
+ $pks[1] = $this->getAppThreadIndex();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setAppUid($keys[0]);
+
+ $this->setAppThreadIndex($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of AppThread (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAppThreadParent($this->app_thread_parent);
+
+ $copyObj->setAppThreadStatus($this->app_thread_status);
+
+ $copyObj->setDelIndex($this->del_index);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setAppThreadIndex('0'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return AppThread Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return AppThreadPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new AppThreadPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseAppThreadPeer.php b/workflow/engine/classes/model/om/BaseAppThreadPeer.php
index debbfa070..843edac19 100755
--- a/workflow/engine/classes/model/om/BaseAppThreadPeer.php
+++ b/workflow/engine/classes/model/om/BaseAppThreadPeer.php
@@ -12,568 +12,569 @@ include_once 'classes/model/AppThread.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseAppThreadPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'APP_THREAD';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.AppThread';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APP_THREAD.APP_UID';
-
- /** the column name for the APP_THREAD_INDEX field */
- const APP_THREAD_INDEX = 'APP_THREAD.APP_THREAD_INDEX';
-
- /** the column name for the APP_THREAD_PARENT field */
- const APP_THREAD_PARENT = 'APP_THREAD.APP_THREAD_PARENT';
-
- /** the column name for the APP_THREAD_STATUS field */
- const APP_THREAD_STATUS = 'APP_THREAD.APP_THREAD_STATUS';
-
- /** the column name for the DEL_INDEX field */
- const DEL_INDEX = 'APP_THREAD.DEL_INDEX';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppThreadIndex', 'AppThreadParent', 'AppThreadStatus', 'DelIndex', ),
- BasePeer::TYPE_COLNAME => array (AppThreadPeer::APP_UID, AppThreadPeer::APP_THREAD_INDEX, AppThreadPeer::APP_THREAD_PARENT, AppThreadPeer::APP_THREAD_STATUS, AppThreadPeer::DEL_INDEX, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_THREAD_INDEX', 'APP_THREAD_PARENT', 'APP_THREAD_STATUS', 'DEL_INDEX', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppThreadIndex' => 1, 'AppThreadParent' => 2, 'AppThreadStatus' => 3, 'DelIndex' => 4, ),
- BasePeer::TYPE_COLNAME => array (AppThreadPeer::APP_UID => 0, AppThreadPeer::APP_THREAD_INDEX => 1, AppThreadPeer::APP_THREAD_PARENT => 2, AppThreadPeer::APP_THREAD_STATUS => 3, AppThreadPeer::DEL_INDEX => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_THREAD_INDEX' => 1, 'APP_THREAD_PARENT' => 2, 'APP_THREAD_STATUS' => 3, 'DEL_INDEX' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/AppThreadMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.AppThreadMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = AppThreadPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. AppThreadPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(AppThreadPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(AppThreadPeer::APP_UID);
-
- $criteria->addSelectColumn(AppThreadPeer::APP_THREAD_INDEX);
-
- $criteria->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
-
- $criteria->addSelectColumn(AppThreadPeer::APP_THREAD_STATUS);
-
- $criteria->addSelectColumn(AppThreadPeer::DEL_INDEX);
-
- }
-
- const COUNT = 'COUNT(APP_THREAD.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APP_THREAD.APP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(AppThreadPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(AppThreadPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = AppThreadPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return AppThread
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = AppThreadPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return AppThreadPeer::populateObjects(AppThreadPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- AppThreadPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = AppThreadPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return AppThreadPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a AppThread or Criteria object.
- *
- * @param mixed $values Criteria or AppThread object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from AppThread object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a AppThread or Criteria object.
- *
- * @param mixed $values Criteria or AppThread object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(AppThreadPeer::APP_UID);
- $selectCriteria->add(AppThreadPeer::APP_UID, $criteria->remove(AppThreadPeer::APP_UID), $comparison);
-
- $comparison = $criteria->getComparison(AppThreadPeer::APP_THREAD_INDEX);
- $selectCriteria->add(AppThreadPeer::APP_THREAD_INDEX, $criteria->remove(AppThreadPeer::APP_THREAD_INDEX), $comparison);
-
- } else { // $values is AppThread object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APP_THREAD table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(AppThreadPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a AppThread or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or AppThread object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(AppThreadPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof AppThread) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
-
- $criteria->add(AppThreadPeer::APP_UID, $vals[0], Criteria::IN);
- $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $vals[1], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given AppThread object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param AppThread $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(AppThread $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(AppThreadPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(AppThreadPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(AppThreadPeer::APP_THREAD_STATUS))
- $columns[AppThreadPeer::APP_THREAD_STATUS] = $obj->getAppThreadStatus();
-
- }
-
- return BasePeer::doValidate(AppThreadPeer::DATABASE_NAME, AppThreadPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $app_uid
- @param int $app_thread_index
-
- * @param Connection $con
- * @return AppThread
- */
- public static function retrieveByPK( $app_uid, $app_thread_index, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(AppThreadPeer::APP_UID, $app_uid);
- $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $app_thread_index);
- $v = AppThreadPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseAppThreadPeer
+abstract class BaseAppThreadPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'APP_THREAD';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.AppThread';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APP_THREAD.APP_UID';
+
+ /** the column name for the APP_THREAD_INDEX field */
+ const APP_THREAD_INDEX = 'APP_THREAD.APP_THREAD_INDEX';
+
+ /** the column name for the APP_THREAD_PARENT field */
+ const APP_THREAD_PARENT = 'APP_THREAD.APP_THREAD_PARENT';
+
+ /** the column name for the APP_THREAD_STATUS field */
+ const APP_THREAD_STATUS = 'APP_THREAD.APP_THREAD_STATUS';
+
+ /** the column name for the DEL_INDEX field */
+ const DEL_INDEX = 'APP_THREAD.DEL_INDEX';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppThreadIndex', 'AppThreadParent', 'AppThreadStatus', 'DelIndex', ),
+ BasePeer::TYPE_COLNAME => array (AppThreadPeer::APP_UID, AppThreadPeer::APP_THREAD_INDEX, AppThreadPeer::APP_THREAD_PARENT, AppThreadPeer::APP_THREAD_STATUS, AppThreadPeer::DEL_INDEX, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_THREAD_INDEX', 'APP_THREAD_PARENT', 'APP_THREAD_STATUS', 'DEL_INDEX', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppThreadIndex' => 1, 'AppThreadParent' => 2, 'AppThreadStatus' => 3, 'DelIndex' => 4, ),
+ BasePeer::TYPE_COLNAME => array (AppThreadPeer::APP_UID => 0, AppThreadPeer::APP_THREAD_INDEX => 1, AppThreadPeer::APP_THREAD_PARENT => 2, AppThreadPeer::APP_THREAD_STATUS => 3, AppThreadPeer::DEL_INDEX => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_THREAD_INDEX' => 1, 'APP_THREAD_PARENT' => 2, 'APP_THREAD_STATUS' => 3, 'DEL_INDEX' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/AppThreadMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.AppThreadMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = AppThreadPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. AppThreadPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(AppThreadPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(AppThreadPeer::APP_UID);
+
+ $criteria->addSelectColumn(AppThreadPeer::APP_THREAD_INDEX);
+
+ $criteria->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
+
+ $criteria->addSelectColumn(AppThreadPeer::APP_THREAD_STATUS);
+
+ $criteria->addSelectColumn(AppThreadPeer::DEL_INDEX);
+
+ }
+
+ const COUNT = 'COUNT(APP_THREAD.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APP_THREAD.APP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(AppThreadPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(AppThreadPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = AppThreadPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return AppThread
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = AppThreadPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return AppThreadPeer::populateObjects(AppThreadPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ AppThreadPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = AppThreadPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return AppThreadPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a AppThread or Criteria object.
+ *
+ * @param mixed $values Criteria or AppThread object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from AppThread object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a AppThread or Criteria object.
+ *
+ * @param mixed $values Criteria or AppThread object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(AppThreadPeer::APP_UID);
+ $selectCriteria->add(AppThreadPeer::APP_UID, $criteria->remove(AppThreadPeer::APP_UID), $comparison);
+
+ $comparison = $criteria->getComparison(AppThreadPeer::APP_THREAD_INDEX);
+ $selectCriteria->add(AppThreadPeer::APP_THREAD_INDEX, $criteria->remove(AppThreadPeer::APP_THREAD_INDEX), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APP_THREAD table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(AppThreadPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a AppThread or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or AppThread object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(AppThreadPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof AppThread) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
+
+ $criteria->add(AppThreadPeer::APP_UID, $vals[0], Criteria::IN);
+ $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $vals[1], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given AppThread object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param AppThread $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(AppThread $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(AppThreadPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(AppThreadPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(AppThreadPeer::APP_THREAD_STATUS))
+ $columns[AppThreadPeer::APP_THREAD_STATUS] = $obj->getAppThreadStatus();
+
+ }
+
+ return BasePeer::doValidate(AppThreadPeer::DATABASE_NAME, AppThreadPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $app_uid
+ * @param int $app_thread_index
+ * @param Connection $con
+ * @return AppThread
+ */
+ public static function retrieveByPK($app_uid, $app_thread_index, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(AppThreadPeer::APP_UID, $app_uid);
+ $criteria->add(AppThreadPeer::APP_THREAD_INDEX, $app_thread_index);
+ $v = AppThreadPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseAppThreadPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseAppThreadPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/AppThreadMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.AppThreadMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/AppThreadMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.AppThreadMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseApplication.php b/workflow/engine/classes/model/om/BaseApplication.php
index 7cabd73ee..510481c0c 100755
--- a/workflow/engine/classes/model/om/BaseApplication.php
+++ b/workflow/engine/classes/model/om/BaseApplication.php
@@ -16,1372 +16,1461 @@ include_once 'classes/model/ApplicationPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseApplication extends BaseObject implements Persistent {
+abstract class BaseApplication extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ApplicationPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the app_number field.
+ * @var int
+ */
+ protected $app_number = 0;
+
+ /**
+ * The value for the app_parent field.
+ * @var string
+ */
+ protected $app_parent = '0';
+
+ /**
+ * The value for the app_status field.
+ * @var string
+ */
+ protected $app_status = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the app_proc_status field.
+ * @var string
+ */
+ protected $app_proc_status = '';
+
+ /**
+ * The value for the app_proc_code field.
+ * @var string
+ */
+ protected $app_proc_code = '';
+
+ /**
+ * The value for the app_parallel field.
+ * @var string
+ */
+ protected $app_parallel = 'NO';
+
+ /**
+ * The value for the app_init_user field.
+ * @var string
+ */
+ protected $app_init_user = '';
+
+ /**
+ * The value for the app_cur_user field.
+ * @var string
+ */
+ protected $app_cur_user = '';
+
+ /**
+ * The value for the app_create_date field.
+ * @var int
+ */
+ protected $app_create_date;
+
+ /**
+ * The value for the app_init_date field.
+ * @var int
+ */
+ protected $app_init_date;
+
+ /**
+ * The value for the app_finish_date field.
+ * @var int
+ */
+ protected $app_finish_date;
+
+ /**
+ * The value for the app_update_date field.
+ * @var int
+ */
+ protected $app_update_date;
+
+ /**
+ * The value for the app_data field.
+ * @var string
+ */
+ protected $app_data;
+
+ /**
+ * The value for the app_pin field.
+ * @var string
+ */
+ protected $app_pin = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [app_number] column value.
+ *
+ * @return int
+ */
+ public function getAppNumber()
+ {
+
+ return $this->app_number;
+ }
+
+ /**
+ * Get the [app_parent] column value.
+ *
+ * @return string
+ */
+ public function getAppParent()
+ {
+
+ return $this->app_parent;
+ }
+
+ /**
+ * Get the [app_status] column value.
+ *
+ * @return string
+ */
+ public function getAppStatus()
+ {
+
+ return $this->app_status;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [app_proc_status] column value.
+ *
+ * @return string
+ */
+ public function getAppProcStatus()
+ {
+
+ return $this->app_proc_status;
+ }
+
+ /**
+ * Get the [app_proc_code] column value.
+ *
+ * @return string
+ */
+ public function getAppProcCode()
+ {
+
+ return $this->app_proc_code;
+ }
+
+ /**
+ * Get the [app_parallel] column value.
+ *
+ * @return string
+ */
+ public function getAppParallel()
+ {
+
+ return $this->app_parallel;
+ }
+
+ /**
+ * Get the [app_init_user] column value.
+ *
+ * @return string
+ */
+ public function getAppInitUser()
+ {
+
+ return $this->app_init_user;
+ }
+
+ /**
+ * Get the [app_cur_user] column value.
+ *
+ * @return string
+ */
+ public function getAppCurUser()
+ {
+
+ return $this->app_cur_user;
+ }
+
+ /**
+ * Get the [optionally formatted] [app_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_create_date === null || $this->app_create_date === '') {
+ return null;
+ } elseif (!is_int($this->app_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_create_date] as date/time value: " .
+ var_export($this->app_create_date, true));
+ }
+ } else {
+ $ts = $this->app_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [app_init_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppInitDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_init_date === null || $this->app_init_date === '') {
+ return null;
+ } elseif (!is_int($this->app_init_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_init_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_init_date] as date/time value: " .
+ var_export($this->app_init_date, true));
+ }
+ } else {
+ $ts = $this->app_init_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [app_finish_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppFinishDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_finish_date === null || $this->app_finish_date === '') {
+ return null;
+ } elseif (!is_int($this->app_finish_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_finish_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_finish_date] as date/time value: " .
+ var_export($this->app_finish_date, true));
+ }
+ } else {
+ $ts = $this->app_finish_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [app_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getAppUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->app_update_date === null || $this->app_update_date === '') {
+ return null;
+ } elseif (!is_int($this->app_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->app_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [app_update_date] as date/time value: " .
+ var_export($this->app_update_date, true));
+ }
+ } else {
+ $ts = $this->app_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [app_data] column value.
+ *
+ * @return string
+ */
+ public function getAppData()
+ {
+
+ return $this->app_data;
+ }
+
+ /**
+ * Get the [app_pin] column value.
+ *
+ * @return string
+ */
+ public function getAppPin()
+ {
+
+ return $this->app_pin;
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [app_number] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppNumber($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->app_number !== $v || $v === 0) {
+ $this->app_number = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_NUMBER;
+ }
+
+ } // setAppNumber()
+
+ /**
+ * Set the value of [app_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_parent !== $v || $v === '0') {
+ $this->app_parent = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_PARENT;
+ }
+
+ } // setAppParent()
+
+ /**
+ * Set the value of [app_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_status !== $v || $v === '') {
+ $this->app_status = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_STATUS;
+ }
+
+ } // setAppStatus()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ApplicationPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [app_proc_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppProcStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_proc_status !== $v || $v === '') {
+ $this->app_proc_status = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_PROC_STATUS;
+ }
+
+ } // setAppProcStatus()
+
+ /**
+ * Set the value of [app_proc_code] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppProcCode($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_proc_code !== $v || $v === '') {
+ $this->app_proc_code = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_PROC_CODE;
+ }
+
+ } // setAppProcCode()
+
+ /**
+ * Set the value of [app_parallel] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppParallel($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_parallel !== $v || $v === 'NO') {
+ $this->app_parallel = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_PARALLEL;
+ }
+
+ } // setAppParallel()
+
+ /**
+ * Set the value of [app_init_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppInitUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_init_user !== $v || $v === '') {
+ $this->app_init_user = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_INIT_USER;
+ }
+
+ } // setAppInitUser()
+
+ /**
+ * Set the value of [app_cur_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppCurUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_cur_user !== $v || $v === '') {
+ $this->app_cur_user = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_CUR_USER;
+ }
+
+ } // setAppCurUser()
+
+ /**
+ * Set the value of [app_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_create_date !== $ts) {
+ $this->app_create_date = $ts;
+ $this->modifiedColumns[] = ApplicationPeer::APP_CREATE_DATE;
+ }
+
+ } // setAppCreateDate()
+
+ /**
+ * Set the value of [app_init_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppInitDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_init_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_init_date !== $ts) {
+ $this->app_init_date = $ts;
+ $this->modifiedColumns[] = ApplicationPeer::APP_INIT_DATE;
+ }
+
+ } // setAppInitDate()
+
+ /**
+ * Set the value of [app_finish_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppFinishDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_finish_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_finish_date !== $ts) {
+ $this->app_finish_date = $ts;
+ $this->modifiedColumns[] = ApplicationPeer::APP_FINISH_DATE;
+ }
+
+ } // setAppFinishDate()
+
+ /**
+ * Set the value of [app_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [app_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->app_update_date !== $ts) {
+ $this->app_update_date = $ts;
+ $this->modifiedColumns[] = ApplicationPeer::APP_UPDATE_DATE;
+ }
+
+ } // setAppUpdateDate()
+
+ /**
+ * Set the value of [app_data] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppData($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_data !== $v) {
+ $this->app_data = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_DATA;
+ }
+
+ } // setAppData()
+
+ /**
+ * Set the value of [app_pin] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppPin($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_pin !== $v || $v === '') {
+ $this->app_pin = $v;
+ $this->modifiedColumns[] = ApplicationPeer::APP_PIN;
+ }
+
+ } // setAppPin()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->app_number = $rs->getInt($startcol + 1);
+
+ $this->app_parent = $rs->getString($startcol + 2);
+
+ $this->app_status = $rs->getString($startcol + 3);
+
+ $this->pro_uid = $rs->getString($startcol + 4);
+
+ $this->app_proc_status = $rs->getString($startcol + 5);
+
+ $this->app_proc_code = $rs->getString($startcol + 6);
+
+ $this->app_parallel = $rs->getString($startcol + 7);
+
+ $this->app_init_user = $rs->getString($startcol + 8);
+
+ $this->app_cur_user = $rs->getString($startcol + 9);
+
+ $this->app_create_date = $rs->getTimestamp($startcol + 10, null);
+
+ $this->app_init_date = $rs->getTimestamp($startcol + 11, null);
+
+ $this->app_finish_date = $rs->getTimestamp($startcol + 12, null);
+
+ $this->app_update_date = $rs->getTimestamp($startcol + 13, null);
+
+ $this->app_data = $rs->getString($startcol + 14);
+
+ $this->app_pin = $rs->getString($startcol + 15);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 16; // 16 = ApplicationPeer::NUM_COLUMNS - ApplicationPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Application object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ApplicationPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ApplicationPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ApplicationPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ApplicationPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getAppNumber();
+ break;
+ case 2:
+ return $this->getAppParent();
+ break;
+ case 3:
+ return $this->getAppStatus();
+ break;
+ case 4:
+ return $this->getProUid();
+ break;
+ case 5:
+ return $this->getAppProcStatus();
+ break;
+ case 6:
+ return $this->getAppProcCode();
+ break;
+ case 7:
+ return $this->getAppParallel();
+ break;
+ case 8:
+ return $this->getAppInitUser();
+ break;
+ case 9:
+ return $this->getAppCurUser();
+ break;
+ case 10:
+ return $this->getAppCreateDate();
+ break;
+ case 11:
+ return $this->getAppInitDate();
+ break;
+ case 12:
+ return $this->getAppFinishDate();
+ break;
+ case 13:
+ return $this->getAppUpdateDate();
+ break;
+ case 14:
+ return $this->getAppData();
+ break;
+ case 15:
+ return $this->getAppPin();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ApplicationPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getAppNumber(),
+ $keys[2] => $this->getAppParent(),
+ $keys[3] => $this->getAppStatus(),
+ $keys[4] => $this->getProUid(),
+ $keys[5] => $this->getAppProcStatus(),
+ $keys[6] => $this->getAppProcCode(),
+ $keys[7] => $this->getAppParallel(),
+ $keys[8] => $this->getAppInitUser(),
+ $keys[9] => $this->getAppCurUser(),
+ $keys[10] => $this->getAppCreateDate(),
+ $keys[11] => $this->getAppInitDate(),
+ $keys[12] => $this->getAppFinishDate(),
+ $keys[13] => $this->getAppUpdateDate(),
+ $keys[14] => $this->getAppData(),
+ $keys[15] => $this->getAppPin(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setAppNumber($value);
+ break;
+ case 2:
+ $this->setAppParent($value);
+ break;
+ case 3:
+ $this->setAppStatus($value);
+ break;
+ case 4:
+ $this->setProUid($value);
+ break;
+ case 5:
+ $this->setAppProcStatus($value);
+ break;
+ case 6:
+ $this->setAppProcCode($value);
+ break;
+ case 7:
+ $this->setAppParallel($value);
+ break;
+ case 8:
+ $this->setAppInitUser($value);
+ break;
+ case 9:
+ $this->setAppCurUser($value);
+ break;
+ case 10:
+ $this->setAppCreateDate($value);
+ break;
+ case 11:
+ $this->setAppInitDate($value);
+ break;
+ case 12:
+ $this->setAppFinishDate($value);
+ break;
+ case 13:
+ $this->setAppUpdateDate($value);
+ break;
+ case 14:
+ $this->setAppData($value);
+ break;
+ case 15:
+ $this->setAppPin($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ApplicationPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setAppNumber($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setAppParent($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setAppStatus($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setProUid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setAppProcStatus($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setAppProcCode($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setAppParallel($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setAppInitUser($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setAppCurUser($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setAppCreateDate($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setAppInitDate($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setAppFinishDate($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setAppUpdateDate($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setAppData($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setAppPin($arr[$keys[15]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ApplicationPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ApplicationPeer::APP_UID)) {
+ $criteria->add(ApplicationPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_NUMBER)) {
+ $criteria->add(ApplicationPeer::APP_NUMBER, $this->app_number);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_PARENT)) {
+ $criteria->add(ApplicationPeer::APP_PARENT, $this->app_parent);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_STATUS)) {
+ $criteria->add(ApplicationPeer::APP_STATUS, $this->app_status);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::PRO_UID)) {
+ $criteria->add(ApplicationPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_PROC_STATUS)) {
+ $criteria->add(ApplicationPeer::APP_PROC_STATUS, $this->app_proc_status);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_PROC_CODE)) {
+ $criteria->add(ApplicationPeer::APP_PROC_CODE, $this->app_proc_code);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_PARALLEL)) {
+ $criteria->add(ApplicationPeer::APP_PARALLEL, $this->app_parallel);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_INIT_USER)) {
+ $criteria->add(ApplicationPeer::APP_INIT_USER, $this->app_init_user);
+ }
+
+ if ($this->isColumnModified(ApplicationPeer::APP_CUR_USER)) {
+ $criteria->add(ApplicationPeer::APP_CUR_USER, $this->app_cur_user);
+ }
+ if ($this->isColumnModified(ApplicationPeer::APP_CREATE_DATE)) {
+ $criteria->add(ApplicationPeer::APP_CREATE_DATE, $this->app_create_date);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ApplicationPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(ApplicationPeer::APP_INIT_DATE)) {
+ $criteria->add(ApplicationPeer::APP_INIT_DATE, $this->app_init_date);
+ }
+ if ($this->isColumnModified(ApplicationPeer::APP_FINISH_DATE)) {
+ $criteria->add(ApplicationPeer::APP_FINISH_DATE, $this->app_finish_date);
+ }
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
+ if ($this->isColumnModified(ApplicationPeer::APP_UPDATE_DATE)) {
+ $criteria->add(ApplicationPeer::APP_UPDATE_DATE, $this->app_update_date);
+ }
+ if ($this->isColumnModified(ApplicationPeer::APP_DATA)) {
+ $criteria->add(ApplicationPeer::APP_DATA, $this->app_data);
+ }
- /**
- * The value for the app_number field.
- * @var int
- */
- protected $app_number = 0;
+ if ($this->isColumnModified(ApplicationPeer::APP_PIN)) {
+ $criteria->add(ApplicationPeer::APP_PIN, $this->app_pin);
+ }
- /**
- * The value for the app_parent field.
- * @var string
- */
- protected $app_parent = '0';
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ApplicationPeer::DATABASE_NAME);
+
+ $criteria->add(ApplicationPeer::APP_UID, $this->app_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getAppUid();
+ }
+
+ /**
+ * Generic method to set the primary key (app_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setAppUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Application (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAppNumber($this->app_number);
+
+ $copyObj->setAppParent($this->app_parent);
+
+ $copyObj->setAppStatus($this->app_status);
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setAppProcStatus($this->app_proc_status);
+
+ $copyObj->setAppProcCode($this->app_proc_code);
+
+ $copyObj->setAppParallel($this->app_parallel);
+
+ $copyObj->setAppInitUser($this->app_init_user);
+
+ $copyObj->setAppCurUser($this->app_cur_user);
+
+ $copyObj->setAppCreateDate($this->app_create_date);
+
+ $copyObj->setAppInitDate($this->app_init_date);
+
+ $copyObj->setAppFinishDate($this->app_finish_date);
+
+ $copyObj->setAppUpdateDate($this->app_update_date);
+
+ $copyObj->setAppData($this->app_data);
+
+ $copyObj->setAppPin($this->app_pin);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Application Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ApplicationPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ApplicationPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The value for the app_status field.
- * @var string
- */
- protected $app_status = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the app_proc_status field.
- * @var string
- */
- protected $app_proc_status = '';
-
-
- /**
- * The value for the app_proc_code field.
- * @var string
- */
- protected $app_proc_code = '';
-
-
- /**
- * The value for the app_parallel field.
- * @var string
- */
- protected $app_parallel = 'NO';
-
-
- /**
- * The value for the app_init_user field.
- * @var string
- */
- protected $app_init_user = '';
-
-
- /**
- * The value for the app_cur_user field.
- * @var string
- */
- protected $app_cur_user = '';
-
-
- /**
- * The value for the app_create_date field.
- * @var int
- */
- protected $app_create_date;
-
-
- /**
- * The value for the app_init_date field.
- * @var int
- */
- protected $app_init_date;
-
-
- /**
- * The value for the app_finish_date field.
- * @var int
- */
- protected $app_finish_date;
-
-
- /**
- * The value for the app_update_date field.
- * @var int
- */
- protected $app_update_date;
-
-
- /**
- * The value for the app_data field.
- * @var string
- */
- protected $app_data;
-
-
- /**
- * The value for the app_pin field.
- * @var string
- */
- protected $app_pin = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [app_number] column value.
- *
- * @return int
- */
- public function getAppNumber()
- {
-
- return $this->app_number;
- }
-
- /**
- * Get the [app_parent] column value.
- *
- * @return string
- */
- public function getAppParent()
- {
-
- return $this->app_parent;
- }
-
- /**
- * Get the [app_status] column value.
- *
- * @return string
- */
- public function getAppStatus()
- {
-
- return $this->app_status;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [app_proc_status] column value.
- *
- * @return string
- */
- public function getAppProcStatus()
- {
-
- return $this->app_proc_status;
- }
-
- /**
- * Get the [app_proc_code] column value.
- *
- * @return string
- */
- public function getAppProcCode()
- {
-
- return $this->app_proc_code;
- }
-
- /**
- * Get the [app_parallel] column value.
- *
- * @return string
- */
- public function getAppParallel()
- {
-
- return $this->app_parallel;
- }
-
- /**
- * Get the [app_init_user] column value.
- *
- * @return string
- */
- public function getAppInitUser()
- {
-
- return $this->app_init_user;
- }
-
- /**
- * Get the [app_cur_user] column value.
- *
- * @return string
- */
- public function getAppCurUser()
- {
-
- return $this->app_cur_user;
- }
-
- /**
- * Get the [optionally formatted] [app_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_create_date === null || $this->app_create_date === '') {
- return null;
- } elseif (!is_int($this->app_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_create_date] as date/time value: " . var_export($this->app_create_date, true));
- }
- } else {
- $ts = $this->app_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [app_init_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppInitDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_init_date === null || $this->app_init_date === '') {
- return null;
- } elseif (!is_int($this->app_init_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_init_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_init_date] as date/time value: " . var_export($this->app_init_date, true));
- }
- } else {
- $ts = $this->app_init_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [app_finish_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppFinishDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_finish_date === null || $this->app_finish_date === '') {
- return null;
- } elseif (!is_int($this->app_finish_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_finish_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_finish_date] as date/time value: " . var_export($this->app_finish_date, true));
- }
- } else {
- $ts = $this->app_finish_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [app_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getAppUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->app_update_date === null || $this->app_update_date === '') {
- return null;
- } elseif (!is_int($this->app_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->app_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [app_update_date] as date/time value: " . var_export($this->app_update_date, true));
- }
- } else {
- $ts = $this->app_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [app_data] column value.
- *
- * @return string
- */
- public function getAppData()
- {
-
- return $this->app_data;
- }
-
- /**
- * Get the [app_pin] column value.
- *
- * @return string
- */
- public function getAppPin()
- {
-
- return $this->app_pin;
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [app_number] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppNumber($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->app_number !== $v || $v === 0) {
- $this->app_number = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_NUMBER;
- }
-
- } // setAppNumber()
-
- /**
- * Set the value of [app_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_parent !== $v || $v === '0') {
- $this->app_parent = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_PARENT;
- }
-
- } // setAppParent()
-
- /**
- * Set the value of [app_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_status !== $v || $v === '') {
- $this->app_status = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_STATUS;
- }
-
- } // setAppStatus()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ApplicationPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [app_proc_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppProcStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_proc_status !== $v || $v === '') {
- $this->app_proc_status = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_PROC_STATUS;
- }
-
- } // setAppProcStatus()
-
- /**
- * Set the value of [app_proc_code] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppProcCode($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_proc_code !== $v || $v === '') {
- $this->app_proc_code = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_PROC_CODE;
- }
-
- } // setAppProcCode()
-
- /**
- * Set the value of [app_parallel] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppParallel($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_parallel !== $v || $v === 'NO') {
- $this->app_parallel = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_PARALLEL;
- }
-
- } // setAppParallel()
-
- /**
- * Set the value of [app_init_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppInitUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_init_user !== $v || $v === '') {
- $this->app_init_user = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_INIT_USER;
- }
-
- } // setAppInitUser()
-
- /**
- * Set the value of [app_cur_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppCurUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_cur_user !== $v || $v === '') {
- $this->app_cur_user = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_CUR_USER;
- }
-
- } // setAppCurUser()
-
- /**
- * Set the value of [app_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_create_date !== $ts) {
- $this->app_create_date = $ts;
- $this->modifiedColumns[] = ApplicationPeer::APP_CREATE_DATE;
- }
-
- } // setAppCreateDate()
-
- /**
- * Set the value of [app_init_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppInitDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_init_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_init_date !== $ts) {
- $this->app_init_date = $ts;
- $this->modifiedColumns[] = ApplicationPeer::APP_INIT_DATE;
- }
-
- } // setAppInitDate()
-
- /**
- * Set the value of [app_finish_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppFinishDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_finish_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_finish_date !== $ts) {
- $this->app_finish_date = $ts;
- $this->modifiedColumns[] = ApplicationPeer::APP_FINISH_DATE;
- }
-
- } // setAppFinishDate()
-
- /**
- * Set the value of [app_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setAppUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [app_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->app_update_date !== $ts) {
- $this->app_update_date = $ts;
- $this->modifiedColumns[] = ApplicationPeer::APP_UPDATE_DATE;
- }
-
- } // setAppUpdateDate()
-
- /**
- * Set the value of [app_data] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppData($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_data !== $v) {
- $this->app_data = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_DATA;
- }
-
- } // setAppData()
-
- /**
- * Set the value of [app_pin] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppPin($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_pin !== $v || $v === '') {
- $this->app_pin = $v;
- $this->modifiedColumns[] = ApplicationPeer::APP_PIN;
- }
-
- } // setAppPin()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->app_number = $rs->getInt($startcol + 1);
-
- $this->app_parent = $rs->getString($startcol + 2);
-
- $this->app_status = $rs->getString($startcol + 3);
-
- $this->pro_uid = $rs->getString($startcol + 4);
-
- $this->app_proc_status = $rs->getString($startcol + 5);
-
- $this->app_proc_code = $rs->getString($startcol + 6);
-
- $this->app_parallel = $rs->getString($startcol + 7);
-
- $this->app_init_user = $rs->getString($startcol + 8);
-
- $this->app_cur_user = $rs->getString($startcol + 9);
-
- $this->app_create_date = $rs->getTimestamp($startcol + 10, null);
-
- $this->app_init_date = $rs->getTimestamp($startcol + 11, null);
-
- $this->app_finish_date = $rs->getTimestamp($startcol + 12, null);
-
- $this->app_update_date = $rs->getTimestamp($startcol + 13, null);
-
- $this->app_data = $rs->getString($startcol + 14);
-
- $this->app_pin = $rs->getString($startcol + 15);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 16; // 16 = ApplicationPeer::NUM_COLUMNS - ApplicationPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Application object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ApplicationPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ApplicationPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ApplicationPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ApplicationPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getAppNumber();
- break;
- case 2:
- return $this->getAppParent();
- break;
- case 3:
- return $this->getAppStatus();
- break;
- case 4:
- return $this->getProUid();
- break;
- case 5:
- return $this->getAppProcStatus();
- break;
- case 6:
- return $this->getAppProcCode();
- break;
- case 7:
- return $this->getAppParallel();
- break;
- case 8:
- return $this->getAppInitUser();
- break;
- case 9:
- return $this->getAppCurUser();
- break;
- case 10:
- return $this->getAppCreateDate();
- break;
- case 11:
- return $this->getAppInitDate();
- break;
- case 12:
- return $this->getAppFinishDate();
- break;
- case 13:
- return $this->getAppUpdateDate();
- break;
- case 14:
- return $this->getAppData();
- break;
- case 15:
- return $this->getAppPin();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ApplicationPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getAppNumber(),
- $keys[2] => $this->getAppParent(),
- $keys[3] => $this->getAppStatus(),
- $keys[4] => $this->getProUid(),
- $keys[5] => $this->getAppProcStatus(),
- $keys[6] => $this->getAppProcCode(),
- $keys[7] => $this->getAppParallel(),
- $keys[8] => $this->getAppInitUser(),
- $keys[9] => $this->getAppCurUser(),
- $keys[10] => $this->getAppCreateDate(),
- $keys[11] => $this->getAppInitDate(),
- $keys[12] => $this->getAppFinishDate(),
- $keys[13] => $this->getAppUpdateDate(),
- $keys[14] => $this->getAppData(),
- $keys[15] => $this->getAppPin(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setAppNumber($value);
- break;
- case 2:
- $this->setAppParent($value);
- break;
- case 3:
- $this->setAppStatus($value);
- break;
- case 4:
- $this->setProUid($value);
- break;
- case 5:
- $this->setAppProcStatus($value);
- break;
- case 6:
- $this->setAppProcCode($value);
- break;
- case 7:
- $this->setAppParallel($value);
- break;
- case 8:
- $this->setAppInitUser($value);
- break;
- case 9:
- $this->setAppCurUser($value);
- break;
- case 10:
- $this->setAppCreateDate($value);
- break;
- case 11:
- $this->setAppInitDate($value);
- break;
- case 12:
- $this->setAppFinishDate($value);
- break;
- case 13:
- $this->setAppUpdateDate($value);
- break;
- case 14:
- $this->setAppData($value);
- break;
- case 15:
- $this->setAppPin($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ApplicationPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAppNumber($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAppParent($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setAppStatus($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setProUid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setAppProcStatus($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setAppProcCode($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setAppParallel($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setAppInitUser($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setAppCurUser($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setAppCreateDate($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setAppInitDate($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setAppFinishDate($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setAppUpdateDate($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setAppData($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setAppPin($arr[$keys[15]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ApplicationPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ApplicationPeer::APP_UID)) $criteria->add(ApplicationPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(ApplicationPeer::APP_NUMBER)) $criteria->add(ApplicationPeer::APP_NUMBER, $this->app_number);
- if ($this->isColumnModified(ApplicationPeer::APP_PARENT)) $criteria->add(ApplicationPeer::APP_PARENT, $this->app_parent);
- if ($this->isColumnModified(ApplicationPeer::APP_STATUS)) $criteria->add(ApplicationPeer::APP_STATUS, $this->app_status);
- if ($this->isColumnModified(ApplicationPeer::PRO_UID)) $criteria->add(ApplicationPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(ApplicationPeer::APP_PROC_STATUS)) $criteria->add(ApplicationPeer::APP_PROC_STATUS, $this->app_proc_status);
- if ($this->isColumnModified(ApplicationPeer::APP_PROC_CODE)) $criteria->add(ApplicationPeer::APP_PROC_CODE, $this->app_proc_code);
- if ($this->isColumnModified(ApplicationPeer::APP_PARALLEL)) $criteria->add(ApplicationPeer::APP_PARALLEL, $this->app_parallel);
- if ($this->isColumnModified(ApplicationPeer::APP_INIT_USER)) $criteria->add(ApplicationPeer::APP_INIT_USER, $this->app_init_user);
- if ($this->isColumnModified(ApplicationPeer::APP_CUR_USER)) $criteria->add(ApplicationPeer::APP_CUR_USER, $this->app_cur_user);
- if ($this->isColumnModified(ApplicationPeer::APP_CREATE_DATE)) $criteria->add(ApplicationPeer::APP_CREATE_DATE, $this->app_create_date);
- if ($this->isColumnModified(ApplicationPeer::APP_INIT_DATE)) $criteria->add(ApplicationPeer::APP_INIT_DATE, $this->app_init_date);
- if ($this->isColumnModified(ApplicationPeer::APP_FINISH_DATE)) $criteria->add(ApplicationPeer::APP_FINISH_DATE, $this->app_finish_date);
- if ($this->isColumnModified(ApplicationPeer::APP_UPDATE_DATE)) $criteria->add(ApplicationPeer::APP_UPDATE_DATE, $this->app_update_date);
- if ($this->isColumnModified(ApplicationPeer::APP_DATA)) $criteria->add(ApplicationPeer::APP_DATA, $this->app_data);
- if ($this->isColumnModified(ApplicationPeer::APP_PIN)) $criteria->add(ApplicationPeer::APP_PIN, $this->app_pin);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ApplicationPeer::DATABASE_NAME);
-
- $criteria->add(ApplicationPeer::APP_UID, $this->app_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getAppUid();
- }
-
- /**
- * Generic method to set the primary key (app_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setAppUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Application (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAppNumber($this->app_number);
-
- $copyObj->setAppParent($this->app_parent);
-
- $copyObj->setAppStatus($this->app_status);
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setAppProcStatus($this->app_proc_status);
-
- $copyObj->setAppProcCode($this->app_proc_code);
-
- $copyObj->setAppParallel($this->app_parallel);
-
- $copyObj->setAppInitUser($this->app_init_user);
-
- $copyObj->setAppCurUser($this->app_cur_user);
-
- $copyObj->setAppCreateDate($this->app_create_date);
-
- $copyObj->setAppInitDate($this->app_init_date);
-
- $copyObj->setAppFinishDate($this->app_finish_date);
-
- $copyObj->setAppUpdateDate($this->app_update_date);
-
- $copyObj->setAppData($this->app_data);
-
- $copyObj->setAppPin($this->app_pin);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Application Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ApplicationPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ApplicationPeer();
- }
- return self::$peer;
- }
-
-} // BaseApplication
diff --git a/workflow/engine/classes/model/om/BaseApplicationPeer.php b/workflow/engine/classes/model/om/BaseApplicationPeer.php
index 6e528237b..b20f51730 100755
--- a/workflow/engine/classes/model/om/BaseApplicationPeer.php
+++ b/workflow/engine/classes/model/om/BaseApplicationPeer.php
@@ -12,632 +12,634 @@ include_once 'classes/model/Application.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseApplicationPeer {
+abstract class BaseApplicationPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'APPLICATION';
+ /** the table name for this class */
+ const TABLE_NAME = 'APPLICATION';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Application';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Application';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 16;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'APPLICATION.APP_UID';
+
+ /** the column name for the APP_NUMBER field */
+ const APP_NUMBER = 'APPLICATION.APP_NUMBER';
+
+ /** the column name for the APP_PARENT field */
+ const APP_PARENT = 'APPLICATION.APP_PARENT';
+
+ /** the column name for the APP_STATUS field */
+ const APP_STATUS = 'APPLICATION.APP_STATUS';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'APPLICATION.PRO_UID';
+
+ /** the column name for the APP_PROC_STATUS field */
+ const APP_PROC_STATUS = 'APPLICATION.APP_PROC_STATUS';
+
+ /** the column name for the APP_PROC_CODE field */
+ const APP_PROC_CODE = 'APPLICATION.APP_PROC_CODE';
+
+ /** the column name for the APP_PARALLEL field */
+ const APP_PARALLEL = 'APPLICATION.APP_PARALLEL';
+
+ /** the column name for the APP_INIT_USER field */
+ const APP_INIT_USER = 'APPLICATION.APP_INIT_USER';
+
+ /** the column name for the APP_CUR_USER field */
+ const APP_CUR_USER = 'APPLICATION.APP_CUR_USER';
+
+ /** the column name for the APP_CREATE_DATE field */
+ const APP_CREATE_DATE = 'APPLICATION.APP_CREATE_DATE';
+
+ /** the column name for the APP_INIT_DATE field */
+ const APP_INIT_DATE = 'APPLICATION.APP_INIT_DATE';
+
+ /** the column name for the APP_FINISH_DATE field */
+ const APP_FINISH_DATE = 'APPLICATION.APP_FINISH_DATE';
+
+ /** the column name for the APP_UPDATE_DATE field */
+ const APP_UPDATE_DATE = 'APPLICATION.APP_UPDATE_DATE';
+
+ /** the column name for the APP_DATA field */
+ const APP_DATA = 'APPLICATION.APP_DATA';
+
+ /** the column name for the APP_PIN field */
+ const APP_PIN = 'APPLICATION.APP_PIN';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppNumber', 'AppParent', 'AppStatus', 'ProUid', 'AppProcStatus', 'AppProcCode', 'AppParallel', 'AppInitUser', 'AppCurUser', 'AppCreateDate', 'AppInitDate', 'AppFinishDate', 'AppUpdateDate', 'AppData', 'AppPin', ),
+ BasePeer::TYPE_COLNAME => array (ApplicationPeer::APP_UID, ApplicationPeer::APP_NUMBER, ApplicationPeer::APP_PARENT, ApplicationPeer::APP_STATUS, ApplicationPeer::PRO_UID, ApplicationPeer::APP_PROC_STATUS, ApplicationPeer::APP_PROC_CODE, ApplicationPeer::APP_PARALLEL, ApplicationPeer::APP_INIT_USER, ApplicationPeer::APP_CUR_USER, ApplicationPeer::APP_CREATE_DATE, ApplicationPeer::APP_INIT_DATE, ApplicationPeer::APP_FINISH_DATE, ApplicationPeer::APP_UPDATE_DATE, ApplicationPeer::APP_DATA, ApplicationPeer::APP_PIN, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_NUMBER', 'APP_PARENT', 'APP_STATUS', 'PRO_UID', 'APP_PROC_STATUS', 'APP_PROC_CODE', 'APP_PARALLEL', 'APP_INIT_USER', 'APP_CUR_USER', 'APP_CREATE_DATE', 'APP_INIT_DATE', 'APP_FINISH_DATE', 'APP_UPDATE_DATE', 'APP_DATA', 'APP_PIN', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppNumber' => 1, 'AppParent' => 2, 'AppStatus' => 3, 'ProUid' => 4, 'AppProcStatus' => 5, 'AppProcCode' => 6, 'AppParallel' => 7, 'AppInitUser' => 8, 'AppCurUser' => 9, 'AppCreateDate' => 10, 'AppInitDate' => 11, 'AppFinishDate' => 12, 'AppUpdateDate' => 13, 'AppData' => 14, 'AppPin' => 15, ),
+ BasePeer::TYPE_COLNAME => array (ApplicationPeer::APP_UID => 0, ApplicationPeer::APP_NUMBER => 1, ApplicationPeer::APP_PARENT => 2, ApplicationPeer::APP_STATUS => 3, ApplicationPeer::PRO_UID => 4, ApplicationPeer::APP_PROC_STATUS => 5, ApplicationPeer::APP_PROC_CODE => 6, ApplicationPeer::APP_PARALLEL => 7, ApplicationPeer::APP_INIT_USER => 8, ApplicationPeer::APP_CUR_USER => 9, ApplicationPeer::APP_CREATE_DATE => 10, ApplicationPeer::APP_INIT_DATE => 11, ApplicationPeer::APP_FINISH_DATE => 12, ApplicationPeer::APP_UPDATE_DATE => 13, ApplicationPeer::APP_DATA => 14, ApplicationPeer::APP_PIN => 15, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_NUMBER' => 1, 'APP_PARENT' => 2, 'APP_STATUS' => 3, 'PRO_UID' => 4, 'APP_PROC_STATUS' => 5, 'APP_PROC_CODE' => 6, 'APP_PARALLEL' => 7, 'APP_INIT_USER' => 8, 'APP_CUR_USER' => 9, 'APP_CREATE_DATE' => 10, 'APP_INIT_DATE' => 11, 'APP_FINISH_DATE' => 12, 'APP_UPDATE_DATE' => 13, 'APP_DATA' => 14, 'APP_PIN' => 15, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ApplicationMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ApplicationMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ApplicationPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ApplicationPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ApplicationPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_UID);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_PARENT);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_STATUS);
+
+ $criteria->addSelectColumn(ApplicationPeer::PRO_UID);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_PROC_STATUS);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_PROC_CODE);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_PARALLEL);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_INIT_USER);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_CUR_USER);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_CREATE_DATE);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_INIT_DATE);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_FINISH_DATE);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_UPDATE_DATE);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_DATA);
+
+ $criteria->addSelectColumn(ApplicationPeer::APP_PIN);
+
+ }
+
+ const COUNT = 'COUNT(APPLICATION.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT APPLICATION.APP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ApplicationPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ApplicationPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ApplicationPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Application
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ApplicationPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ApplicationPeer::populateObjects(ApplicationPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ApplicationPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ApplicationPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ApplicationPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Application or Criteria object.
+ *
+ * @param mixed $values Criteria or Application object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Application object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Application or Criteria object.
+ *
+ * @param mixed $values Criteria or Application object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ApplicationPeer::APP_UID);
+ $selectCriteria->add(ApplicationPeer::APP_UID, $criteria->remove(ApplicationPeer::APP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the APPLICATION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ApplicationPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Application or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Application object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Application) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ApplicationPeer::APP_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Application object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Application $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Application $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ApplicationPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ApplicationPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(ApplicationPeer::APP_STATUS))
+ $columns[ApplicationPeer::APP_STATUS] = $obj->getAppStatus();
+
+ }
+
+ return BasePeer::doValidate(ApplicationPeer::DATABASE_NAME, ApplicationPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Application
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ApplicationPeer::DATABASE_NAME);
+
+ $criteria->add(ApplicationPeer::APP_UID, $pk);
+
+
+ $v = ApplicationPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ApplicationPeer::APP_UID, $pks, Criteria::IN);
+ $objs = ApplicationPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** The total number of columns. */
- const NUM_COLUMNS = 16;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_UID field */
- const APP_UID = 'APPLICATION.APP_UID';
-
- /** the column name for the APP_NUMBER field */
- const APP_NUMBER = 'APPLICATION.APP_NUMBER';
-
- /** the column name for the APP_PARENT field */
- const APP_PARENT = 'APPLICATION.APP_PARENT';
-
- /** the column name for the APP_STATUS field */
- const APP_STATUS = 'APPLICATION.APP_STATUS';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'APPLICATION.PRO_UID';
-
- /** the column name for the APP_PROC_STATUS field */
- const APP_PROC_STATUS = 'APPLICATION.APP_PROC_STATUS';
-
- /** the column name for the APP_PROC_CODE field */
- const APP_PROC_CODE = 'APPLICATION.APP_PROC_CODE';
-
- /** the column name for the APP_PARALLEL field */
- const APP_PARALLEL = 'APPLICATION.APP_PARALLEL';
-
- /** the column name for the APP_INIT_USER field */
- const APP_INIT_USER = 'APPLICATION.APP_INIT_USER';
-
- /** the column name for the APP_CUR_USER field */
- const APP_CUR_USER = 'APPLICATION.APP_CUR_USER';
-
- /** the column name for the APP_CREATE_DATE field */
- const APP_CREATE_DATE = 'APPLICATION.APP_CREATE_DATE';
-
- /** the column name for the APP_INIT_DATE field */
- const APP_INIT_DATE = 'APPLICATION.APP_INIT_DATE';
-
- /** the column name for the APP_FINISH_DATE field */
- const APP_FINISH_DATE = 'APPLICATION.APP_FINISH_DATE';
-
- /** the column name for the APP_UPDATE_DATE field */
- const APP_UPDATE_DATE = 'APPLICATION.APP_UPDATE_DATE';
-
- /** the column name for the APP_DATA field */
- const APP_DATA = 'APPLICATION.APP_DATA';
-
- /** the column name for the APP_PIN field */
- const APP_PIN = 'APPLICATION.APP_PIN';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppNumber', 'AppParent', 'AppStatus', 'ProUid', 'AppProcStatus', 'AppProcCode', 'AppParallel', 'AppInitUser', 'AppCurUser', 'AppCreateDate', 'AppInitDate', 'AppFinishDate', 'AppUpdateDate', 'AppData', 'AppPin', ),
- BasePeer::TYPE_COLNAME => array (ApplicationPeer::APP_UID, ApplicationPeer::APP_NUMBER, ApplicationPeer::APP_PARENT, ApplicationPeer::APP_STATUS, ApplicationPeer::PRO_UID, ApplicationPeer::APP_PROC_STATUS, ApplicationPeer::APP_PROC_CODE, ApplicationPeer::APP_PARALLEL, ApplicationPeer::APP_INIT_USER, ApplicationPeer::APP_CUR_USER, ApplicationPeer::APP_CREATE_DATE, ApplicationPeer::APP_INIT_DATE, ApplicationPeer::APP_FINISH_DATE, ApplicationPeer::APP_UPDATE_DATE, ApplicationPeer::APP_DATA, ApplicationPeer::APP_PIN, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_NUMBER', 'APP_PARENT', 'APP_STATUS', 'PRO_UID', 'APP_PROC_STATUS', 'APP_PROC_CODE', 'APP_PARALLEL', 'APP_INIT_USER', 'APP_CUR_USER', 'APP_CREATE_DATE', 'APP_INIT_DATE', 'APP_FINISH_DATE', 'APP_UPDATE_DATE', 'APP_DATA', 'APP_PIN', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppNumber' => 1, 'AppParent' => 2, 'AppStatus' => 3, 'ProUid' => 4, 'AppProcStatus' => 5, 'AppProcCode' => 6, 'AppParallel' => 7, 'AppInitUser' => 8, 'AppCurUser' => 9, 'AppCreateDate' => 10, 'AppInitDate' => 11, 'AppFinishDate' => 12, 'AppUpdateDate' => 13, 'AppData' => 14, 'AppPin' => 15, ),
- BasePeer::TYPE_COLNAME => array (ApplicationPeer::APP_UID => 0, ApplicationPeer::APP_NUMBER => 1, ApplicationPeer::APP_PARENT => 2, ApplicationPeer::APP_STATUS => 3, ApplicationPeer::PRO_UID => 4, ApplicationPeer::APP_PROC_STATUS => 5, ApplicationPeer::APP_PROC_CODE => 6, ApplicationPeer::APP_PARALLEL => 7, ApplicationPeer::APP_INIT_USER => 8, ApplicationPeer::APP_CUR_USER => 9, ApplicationPeer::APP_CREATE_DATE => 10, ApplicationPeer::APP_INIT_DATE => 11, ApplicationPeer::APP_FINISH_DATE => 12, ApplicationPeer::APP_UPDATE_DATE => 13, ApplicationPeer::APP_DATA => 14, ApplicationPeer::APP_PIN => 15, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_NUMBER' => 1, 'APP_PARENT' => 2, 'APP_STATUS' => 3, 'PRO_UID' => 4, 'APP_PROC_STATUS' => 5, 'APP_PROC_CODE' => 6, 'APP_PARALLEL' => 7, 'APP_INIT_USER' => 8, 'APP_CUR_USER' => 9, 'APP_CREATE_DATE' => 10, 'APP_INIT_DATE' => 11, 'APP_FINISH_DATE' => 12, 'APP_UPDATE_DATE' => 13, 'APP_DATA' => 14, 'APP_PIN' => 15, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ApplicationMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ApplicationMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ApplicationPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ApplicationPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ApplicationPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ApplicationPeer::APP_UID);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_PARENT);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_STATUS);
-
- $criteria->addSelectColumn(ApplicationPeer::PRO_UID);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_PROC_STATUS);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_PROC_CODE);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_PARALLEL);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_INIT_USER);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_CUR_USER);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_CREATE_DATE);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_INIT_DATE);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_FINISH_DATE);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_UPDATE_DATE);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_DATA);
-
- $criteria->addSelectColumn(ApplicationPeer::APP_PIN);
-
- }
-
- const COUNT = 'COUNT(APPLICATION.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT APPLICATION.APP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ApplicationPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ApplicationPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ApplicationPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Application
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ApplicationPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ApplicationPeer::populateObjects(ApplicationPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ApplicationPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ApplicationPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ApplicationPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Application or Criteria object.
- *
- * @param mixed $values Criteria or Application object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Application object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Application or Criteria object.
- *
- * @param mixed $values Criteria or Application object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ApplicationPeer::APP_UID);
- $selectCriteria->add(ApplicationPeer::APP_UID, $criteria->remove(ApplicationPeer::APP_UID), $comparison);
-
- } else { // $values is Application object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the APPLICATION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ApplicationPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Application or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Application object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Application) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ApplicationPeer::APP_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Application object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Application $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Application $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ApplicationPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ApplicationPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(ApplicationPeer::APP_STATUS))
- $columns[ApplicationPeer::APP_STATUS] = $obj->getAppStatus();
-
- }
-
- return BasePeer::doValidate(ApplicationPeer::DATABASE_NAME, ApplicationPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Application
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ApplicationPeer::DATABASE_NAME);
-
- $criteria->add(ApplicationPeer::APP_UID, $pk);
-
-
- $v = ApplicationPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ApplicationPeer::APP_UID, $pks, Criteria::IN);
- $objs = ApplicationPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseApplicationPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseApplicationPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseApplicationPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ApplicationMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ApplicationMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ApplicationMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ApplicationMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarAssignments.php b/workflow/engine/classes/model/om/BaseCalendarAssignments.php
index 3e9e6b2dd..49486abbe 100755
--- a/workflow/engine/classes/model/om/BaseCalendarAssignments.php
+++ b/workflow/engine/classes/model/om/BaseCalendarAssignments.php
@@ -16,595 +16,611 @@ include_once 'classes/model/CalendarAssignmentsPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarAssignments extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var CalendarAssignmentsPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the object_uid field.
- * @var string
- */
- protected $object_uid = '';
-
-
- /**
- * The value for the calendar_uid field.
- * @var string
- */
- protected $calendar_uid = '';
-
-
- /**
- * The value for the object_type field.
- * @var string
- */
- protected $object_type = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [object_uid] column value.
- *
- * @return string
- */
- public function getObjectUid()
- {
-
- return $this->object_uid;
- }
-
- /**
- * Get the [calendar_uid] column value.
- *
- * @return string
- */
- public function getCalendarUid()
- {
-
- return $this->calendar_uid;
- }
-
- /**
- * Get the [object_type] column value.
- *
- * @return string
- */
- public function getObjectType()
- {
-
- return $this->object_type;
- }
-
- /**
- * Set the value of [object_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setObjectUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->object_uid !== $v || $v === '') {
- $this->object_uid = $v;
- $this->modifiedColumns[] = CalendarAssignmentsPeer::OBJECT_UID;
- }
-
- } // setObjectUid()
-
- /**
- * Set the value of [calendar_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_uid !== $v || $v === '') {
- $this->calendar_uid = $v;
- $this->modifiedColumns[] = CalendarAssignmentsPeer::CALENDAR_UID;
- }
-
- } // setCalendarUid()
-
- /**
- * Set the value of [object_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setObjectType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->object_type !== $v || $v === '') {
- $this->object_type = $v;
- $this->modifiedColumns[] = CalendarAssignmentsPeer::OBJECT_TYPE;
- }
-
- } // setObjectType()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->object_uid = $rs->getString($startcol + 0);
-
- $this->calendar_uid = $rs->getString($startcol + 1);
-
- $this->object_type = $rs->getString($startcol + 2);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 3; // 3 = CalendarAssignmentsPeer::NUM_COLUMNS - CalendarAssignmentsPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CalendarAssignments object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarAssignmentsPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- CalendarAssignmentsPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarAssignmentsPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = CalendarAssignmentsPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += CalendarAssignmentsPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CalendarAssignmentsPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarAssignmentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getObjectUid();
- break;
- case 1:
- return $this->getCalendarUid();
- break;
- case 2:
- return $this->getObjectType();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarAssignmentsPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getObjectUid(),
- $keys[1] => $this->getCalendarUid(),
- $keys[2] => $this->getObjectType(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarAssignmentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setObjectUid($value);
- break;
- case 1:
- $this->setCalendarUid($value);
- break;
- case 2:
- $this->setObjectType($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarAssignmentsPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setObjectUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCalendarUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setObjectType($arr[$keys[2]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CalendarAssignmentsPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CalendarAssignmentsPeer::OBJECT_UID)) $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $this->object_uid);
- if ($this->isColumnModified(CalendarAssignmentsPeer::CALENDAR_UID)) $criteria->add(CalendarAssignmentsPeer::CALENDAR_UID, $this->calendar_uid);
- if ($this->isColumnModified(CalendarAssignmentsPeer::OBJECT_TYPE)) $criteria->add(CalendarAssignmentsPeer::OBJECT_TYPE, $this->object_type);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CalendarAssignmentsPeer::DATABASE_NAME);
-
- $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $this->object_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getObjectUid();
- }
-
- /**
- * Generic method to set the primary key (object_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setObjectUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CalendarAssignments (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setCalendarUid($this->calendar_uid);
-
- $copyObj->setObjectType($this->object_type);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setObjectUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CalendarAssignments Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CalendarAssignmentsPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CalendarAssignmentsPeer();
- }
- return self::$peer;
- }
-
-} // BaseCalendarAssignments
+abstract class BaseCalendarAssignments extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var CalendarAssignmentsPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the object_uid field.
+ * @var string
+ */
+ protected $object_uid = '';
+
+ /**
+ * The value for the calendar_uid field.
+ * @var string
+ */
+ protected $calendar_uid = '';
+
+ /**
+ * The value for the object_type field.
+ * @var string
+ */
+ protected $object_type = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [object_uid] column value.
+ *
+ * @return string
+ */
+ public function getObjectUid()
+ {
+
+ return $this->object_uid;
+ }
+
+ /**
+ * Get the [calendar_uid] column value.
+ *
+ * @return string
+ */
+ public function getCalendarUid()
+ {
+
+ return $this->calendar_uid;
+ }
+
+ /**
+ * Get the [object_type] column value.
+ *
+ * @return string
+ */
+ public function getObjectType()
+ {
+
+ return $this->object_type;
+ }
+
+ /**
+ * Set the value of [object_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setObjectUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->object_uid !== $v || $v === '') {
+ $this->object_uid = $v;
+ $this->modifiedColumns[] = CalendarAssignmentsPeer::OBJECT_UID;
+ }
+
+ } // setObjectUid()
+
+ /**
+ * Set the value of [calendar_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_uid !== $v || $v === '') {
+ $this->calendar_uid = $v;
+ $this->modifiedColumns[] = CalendarAssignmentsPeer::CALENDAR_UID;
+ }
+
+ } // setCalendarUid()
+
+ /**
+ * Set the value of [object_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setObjectType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->object_type !== $v || $v === '') {
+ $this->object_type = $v;
+ $this->modifiedColumns[] = CalendarAssignmentsPeer::OBJECT_TYPE;
+ }
+
+ } // setObjectType()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->object_uid = $rs->getString($startcol + 0);
+
+ $this->calendar_uid = $rs->getString($startcol + 1);
+
+ $this->object_type = $rs->getString($startcol + 2);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 3; // 3 = CalendarAssignmentsPeer::NUM_COLUMNS - CalendarAssignmentsPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating CalendarAssignments object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarAssignmentsPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ CalendarAssignmentsPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarAssignmentsPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = CalendarAssignmentsPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += CalendarAssignmentsPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = CalendarAssignmentsPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarAssignmentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getObjectUid();
+ break;
+ case 1:
+ return $this->getCalendarUid();
+ break;
+ case 2:
+ return $this->getObjectType();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarAssignmentsPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getObjectUid(),
+ $keys[1] => $this->getCalendarUid(),
+ $keys[2] => $this->getObjectType(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarAssignmentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setObjectUid($value);
+ break;
+ case 1:
+ $this->setCalendarUid($value);
+ break;
+ case 2:
+ $this->setObjectType($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarAssignmentsPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setObjectUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setCalendarUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setObjectType($arr[$keys[2]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CalendarAssignmentsPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(CalendarAssignmentsPeer::OBJECT_UID)) {
+ $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $this->object_uid);
+ }
+
+ if ($this->isColumnModified(CalendarAssignmentsPeer::CALENDAR_UID)) {
+ $criteria->add(CalendarAssignmentsPeer::CALENDAR_UID, $this->calendar_uid);
+ }
+
+ if ($this->isColumnModified(CalendarAssignmentsPeer::OBJECT_TYPE)) {
+ $criteria->add(CalendarAssignmentsPeer::OBJECT_TYPE, $this->object_type);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CalendarAssignmentsPeer::DATABASE_NAME);
+
+ $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $this->object_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getObjectUid();
+ }
+
+ /**
+ * Generic method to set the primary key (object_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setObjectUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of CalendarAssignments (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setCalendarUid($this->calendar_uid);
+
+ $copyObj->setObjectType($this->object_type);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setObjectUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return CalendarAssignments Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return CalendarAssignmentsPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new CalendarAssignmentsPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarAssignmentsPeer.php b/workflow/engine/classes/model/om/BaseCalendarAssignmentsPeer.php
index 73d11b5fe..3c7a2173c 100755
--- a/workflow/engine/classes/model/om/BaseCalendarAssignmentsPeer.php
+++ b/workflow/engine/classes/model/om/BaseCalendarAssignmentsPeer.php
@@ -12,564 +12,566 @@ include_once 'classes/model/CalendarAssignments.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarAssignmentsPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'CALENDAR_ASSIGNMENTS';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.CalendarAssignments';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 3;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the OBJECT_UID field */
- const OBJECT_UID = 'CALENDAR_ASSIGNMENTS.OBJECT_UID';
-
- /** the column name for the CALENDAR_UID field */
- const CALENDAR_UID = 'CALENDAR_ASSIGNMENTS.CALENDAR_UID';
-
- /** the column name for the OBJECT_TYPE field */
- const OBJECT_TYPE = 'CALENDAR_ASSIGNMENTS.OBJECT_TYPE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('ObjectUid', 'CalendarUid', 'ObjectType', ),
- BasePeer::TYPE_COLNAME => array (CalendarAssignmentsPeer::OBJECT_UID, CalendarAssignmentsPeer::CALENDAR_UID, CalendarAssignmentsPeer::OBJECT_TYPE, ),
- BasePeer::TYPE_FIELDNAME => array ('OBJECT_UID', 'CALENDAR_UID', 'OBJECT_TYPE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('ObjectUid' => 0, 'CalendarUid' => 1, 'ObjectType' => 2, ),
- BasePeer::TYPE_COLNAME => array (CalendarAssignmentsPeer::OBJECT_UID => 0, CalendarAssignmentsPeer::CALENDAR_UID => 1, CalendarAssignmentsPeer::OBJECT_TYPE => 2, ),
- BasePeer::TYPE_FIELDNAME => array ('OBJECT_UID' => 0, 'CALENDAR_UID' => 1, 'OBJECT_TYPE' => 2, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/CalendarAssignmentsMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.CalendarAssignmentsMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = CalendarAssignmentsPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CalendarAssignmentsPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CalendarAssignmentsPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(CalendarAssignmentsPeer::OBJECT_UID);
-
- $criteria->addSelectColumn(CalendarAssignmentsPeer::CALENDAR_UID);
-
- $criteria->addSelectColumn(CalendarAssignmentsPeer::OBJECT_TYPE);
-
- }
-
- const COUNT = 'COUNT(CALENDAR_ASSIGNMENTS.OBJECT_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_ASSIGNMENTS.OBJECT_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(CalendarAssignmentsPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(CalendarAssignmentsPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = CalendarAssignmentsPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return CalendarAssignments
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CalendarAssignmentsPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return CalendarAssignmentsPeer::populateObjects(CalendarAssignmentsPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- CalendarAssignmentsPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CalendarAssignmentsPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return CalendarAssignmentsPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a CalendarAssignments or Criteria object.
- *
- * @param mixed $values Criteria or CalendarAssignments object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CalendarAssignments object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a CalendarAssignments or Criteria object.
- *
- * @param mixed $values Criteria or CalendarAssignments object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CalendarAssignmentsPeer::OBJECT_UID);
- $selectCriteria->add(CalendarAssignmentsPeer::OBJECT_UID, $criteria->remove(CalendarAssignmentsPeer::OBJECT_UID), $comparison);
-
- } else { // $values is CalendarAssignments object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CALENDAR_ASSIGNMENTS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(CalendarAssignmentsPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a CalendarAssignments or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CalendarAssignments object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CalendarAssignmentsPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof CalendarAssignments) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CalendarAssignments object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CalendarAssignments $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(CalendarAssignments $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CalendarAssignmentsPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CalendarAssignmentsPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(CalendarAssignmentsPeer::DATABASE_NAME, CalendarAssignmentsPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return CalendarAssignments
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(CalendarAssignmentsPeer::DATABASE_NAME);
-
- $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $pk);
-
-
- $v = CalendarAssignmentsPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $pks, Criteria::IN);
- $objs = CalendarAssignmentsPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseCalendarAssignmentsPeer
+abstract class BaseCalendarAssignmentsPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'CALENDAR_ASSIGNMENTS';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.CalendarAssignments';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 3;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the OBJECT_UID field */
+ const OBJECT_UID = 'CALENDAR_ASSIGNMENTS.OBJECT_UID';
+
+ /** the column name for the CALENDAR_UID field */
+ const CALENDAR_UID = 'CALENDAR_ASSIGNMENTS.CALENDAR_UID';
+
+ /** the column name for the OBJECT_TYPE field */
+ const OBJECT_TYPE = 'CALENDAR_ASSIGNMENTS.OBJECT_TYPE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('ObjectUid', 'CalendarUid', 'ObjectType', ),
+ BasePeer::TYPE_COLNAME => array (CalendarAssignmentsPeer::OBJECT_UID, CalendarAssignmentsPeer::CALENDAR_UID, CalendarAssignmentsPeer::OBJECT_TYPE, ),
+ BasePeer::TYPE_FIELDNAME => array ('OBJECT_UID', 'CALENDAR_UID', 'OBJECT_TYPE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('ObjectUid' => 0, 'CalendarUid' => 1, 'ObjectType' => 2, ),
+ BasePeer::TYPE_COLNAME => array (CalendarAssignmentsPeer::OBJECT_UID => 0, CalendarAssignmentsPeer::CALENDAR_UID => 1, CalendarAssignmentsPeer::OBJECT_TYPE => 2, ),
+ BasePeer::TYPE_FIELDNAME => array ('OBJECT_UID' => 0, 'CALENDAR_UID' => 1, 'OBJECT_TYPE' => 2, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/CalendarAssignmentsMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.CalendarAssignmentsMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = CalendarAssignmentsPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. CalendarAssignmentsPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(CalendarAssignmentsPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(CalendarAssignmentsPeer::OBJECT_UID);
+
+ $criteria->addSelectColumn(CalendarAssignmentsPeer::CALENDAR_UID);
+
+ $criteria->addSelectColumn(CalendarAssignmentsPeer::OBJECT_TYPE);
+
+ }
+
+ const COUNT = 'COUNT(CALENDAR_ASSIGNMENTS.OBJECT_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_ASSIGNMENTS.OBJECT_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(CalendarAssignmentsPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(CalendarAssignmentsPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = CalendarAssignmentsPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return CalendarAssignments
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = CalendarAssignmentsPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return CalendarAssignmentsPeer::populateObjects(CalendarAssignmentsPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ CalendarAssignmentsPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = CalendarAssignmentsPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return CalendarAssignmentsPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a CalendarAssignments or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarAssignments object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from CalendarAssignments object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a CalendarAssignments or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarAssignments object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(CalendarAssignmentsPeer::OBJECT_UID);
+ $selectCriteria->add(CalendarAssignmentsPeer::OBJECT_UID, $criteria->remove(CalendarAssignmentsPeer::OBJECT_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CALENDAR_ASSIGNMENTS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(CalendarAssignmentsPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a CalendarAssignments or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CalendarAssignments object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarAssignmentsPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof CalendarAssignments) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given CalendarAssignments object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param CalendarAssignments $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(CalendarAssignments $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(CalendarAssignmentsPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(CalendarAssignmentsPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(CalendarAssignmentsPeer::DATABASE_NAME, CalendarAssignmentsPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return CalendarAssignments
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(CalendarAssignmentsPeer::DATABASE_NAME);
+
+ $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $pk);
+
+
+ $v = CalendarAssignmentsPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(CalendarAssignmentsPeer::OBJECT_UID, $pks, Criteria::IN);
+ $objs = CalendarAssignmentsPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseCalendarAssignmentsPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseCalendarAssignmentsPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/CalendarAssignmentsMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.CalendarAssignmentsMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/CalendarAssignmentsMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.CalendarAssignmentsMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarBusinessHours.php b/workflow/engine/classes/model/om/BaseCalendarBusinessHours.php
index 8e9342d59..dd4b94286 100755
--- a/workflow/engine/classes/model/om/BaseCalendarBusinessHours.php
+++ b/workflow/engine/classes/model/om/BaseCalendarBusinessHours.php
@@ -16,670 +16,691 @@ include_once 'classes/model/CalendarBusinessHoursPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarBusinessHours extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var CalendarBusinessHoursPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the calendar_uid field.
- * @var string
- */
- protected $calendar_uid = '';
-
-
- /**
- * The value for the calendar_business_day field.
- * @var string
- */
- protected $calendar_business_day = '';
-
-
- /**
- * The value for the calendar_business_start field.
- * @var string
- */
- protected $calendar_business_start = '';
-
-
- /**
- * The value for the calendar_business_end field.
- * @var string
- */
- protected $calendar_business_end = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [calendar_uid] column value.
- *
- * @return string
- */
- public function getCalendarUid()
- {
-
- return $this->calendar_uid;
- }
-
- /**
- * Get the [calendar_business_day] column value.
- *
- * @return string
- */
- public function getCalendarBusinessDay()
- {
-
- return $this->calendar_business_day;
- }
-
- /**
- * Get the [calendar_business_start] column value.
- *
- * @return string
- */
- public function getCalendarBusinessStart()
- {
-
- return $this->calendar_business_start;
- }
-
- /**
- * Get the [calendar_business_end] column value.
- *
- * @return string
- */
- public function getCalendarBusinessEnd()
- {
-
- return $this->calendar_business_end;
- }
-
- /**
- * Set the value of [calendar_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_uid !== $v || $v === '') {
- $this->calendar_uid = $v;
- $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_UID;
- }
-
- } // setCalendarUid()
-
- /**
- * Set the value of [calendar_business_day] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarBusinessDay($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_business_day !== $v || $v === '') {
- $this->calendar_business_day = $v;
- $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY;
- }
-
- } // setCalendarBusinessDay()
-
- /**
- * Set the value of [calendar_business_start] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarBusinessStart($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_business_start !== $v || $v === '') {
- $this->calendar_business_start = $v;
- $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START;
- }
-
- } // setCalendarBusinessStart()
-
- /**
- * Set the value of [calendar_business_end] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarBusinessEnd($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_business_end !== $v || $v === '') {
- $this->calendar_business_end = $v;
- $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END;
- }
-
- } // setCalendarBusinessEnd()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->calendar_uid = $rs->getString($startcol + 0);
-
- $this->calendar_business_day = $rs->getString($startcol + 1);
-
- $this->calendar_business_start = $rs->getString($startcol + 2);
-
- $this->calendar_business_end = $rs->getString($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = CalendarBusinessHoursPeer::NUM_COLUMNS - CalendarBusinessHoursPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CalendarBusinessHours object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarBusinessHoursPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- CalendarBusinessHoursPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarBusinessHoursPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = CalendarBusinessHoursPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += CalendarBusinessHoursPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CalendarBusinessHoursPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarBusinessHoursPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getCalendarUid();
- break;
- case 1:
- return $this->getCalendarBusinessDay();
- break;
- case 2:
- return $this->getCalendarBusinessStart();
- break;
- case 3:
- return $this->getCalendarBusinessEnd();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarBusinessHoursPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getCalendarUid(),
- $keys[1] => $this->getCalendarBusinessDay(),
- $keys[2] => $this->getCalendarBusinessStart(),
- $keys[3] => $this->getCalendarBusinessEnd(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarBusinessHoursPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setCalendarUid($value);
- break;
- case 1:
- $this->setCalendarBusinessDay($value);
- break;
- case 2:
- $this->setCalendarBusinessStart($value);
- break;
- case 3:
- $this->setCalendarBusinessEnd($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarBusinessHoursPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setCalendarUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCalendarBusinessDay($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCalendarBusinessStart($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCalendarBusinessEnd($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CalendarBusinessHoursPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_UID)) $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $this->calendar_uid);
- if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY)) $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $this->calendar_business_day);
- if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START)) $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $this->calendar_business_start);
- if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END)) $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $this->calendar_business_end);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CalendarBusinessHoursPeer::DATABASE_NAME);
-
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $this->calendar_uid);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $this->calendar_business_day);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $this->calendar_business_start);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $this->calendar_business_end);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getCalendarUid();
-
- $pks[1] = $this->getCalendarBusinessDay();
-
- $pks[2] = $this->getCalendarBusinessStart();
-
- $pks[3] = $this->getCalendarBusinessEnd();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setCalendarUid($keys[0]);
-
- $this->setCalendarBusinessDay($keys[1]);
-
- $this->setCalendarBusinessStart($keys[2]);
-
- $this->setCalendarBusinessEnd($keys[3]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CalendarBusinessHours (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
-
- $copyObj->setNew(true);
-
- $copyObj->setCalendarUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setCalendarBusinessDay(''); // this is a pkey column, so set to default value
-
- $copyObj->setCalendarBusinessStart(''); // this is a pkey column, so set to default value
-
- $copyObj->setCalendarBusinessEnd(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CalendarBusinessHours Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CalendarBusinessHoursPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CalendarBusinessHoursPeer();
- }
- return self::$peer;
- }
-
-} // BaseCalendarBusinessHours
+abstract class BaseCalendarBusinessHours extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var CalendarBusinessHoursPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the calendar_uid field.
+ * @var string
+ */
+ protected $calendar_uid = '';
+
+ /**
+ * The value for the calendar_business_day field.
+ * @var string
+ */
+ protected $calendar_business_day = '';
+
+ /**
+ * The value for the calendar_business_start field.
+ * @var string
+ */
+ protected $calendar_business_start = '';
+
+ /**
+ * The value for the calendar_business_end field.
+ * @var string
+ */
+ protected $calendar_business_end = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [calendar_uid] column value.
+ *
+ * @return string
+ */
+ public function getCalendarUid()
+ {
+
+ return $this->calendar_uid;
+ }
+
+ /**
+ * Get the [calendar_business_day] column value.
+ *
+ * @return string
+ */
+ public function getCalendarBusinessDay()
+ {
+
+ return $this->calendar_business_day;
+ }
+
+ /**
+ * Get the [calendar_business_start] column value.
+ *
+ * @return string
+ */
+ public function getCalendarBusinessStart()
+ {
+
+ return $this->calendar_business_start;
+ }
+
+ /**
+ * Get the [calendar_business_end] column value.
+ *
+ * @return string
+ */
+ public function getCalendarBusinessEnd()
+ {
+
+ return $this->calendar_business_end;
+ }
+
+ /**
+ * Set the value of [calendar_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_uid !== $v || $v === '') {
+ $this->calendar_uid = $v;
+ $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_UID;
+ }
+
+ } // setCalendarUid()
+
+ /**
+ * Set the value of [calendar_business_day] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarBusinessDay($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_business_day !== $v || $v === '') {
+ $this->calendar_business_day = $v;
+ $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY;
+ }
+
+ } // setCalendarBusinessDay()
+
+ /**
+ * Set the value of [calendar_business_start] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarBusinessStart($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_business_start !== $v || $v === '') {
+ $this->calendar_business_start = $v;
+ $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START;
+ }
+
+ } // setCalendarBusinessStart()
+
+ /**
+ * Set the value of [calendar_business_end] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarBusinessEnd($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_business_end !== $v || $v === '') {
+ $this->calendar_business_end = $v;
+ $this->modifiedColumns[] = CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END;
+ }
+
+ } // setCalendarBusinessEnd()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->calendar_uid = $rs->getString($startcol + 0);
+
+ $this->calendar_business_day = $rs->getString($startcol + 1);
+
+ $this->calendar_business_start = $rs->getString($startcol + 2);
+
+ $this->calendar_business_end = $rs->getString($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = CalendarBusinessHoursPeer::NUM_COLUMNS - CalendarBusinessHoursPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating CalendarBusinessHours object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarBusinessHoursPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ CalendarBusinessHoursPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarBusinessHoursPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = CalendarBusinessHoursPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += CalendarBusinessHoursPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = CalendarBusinessHoursPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarBusinessHoursPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getCalendarUid();
+ break;
+ case 1:
+ return $this->getCalendarBusinessDay();
+ break;
+ case 2:
+ return $this->getCalendarBusinessStart();
+ break;
+ case 3:
+ return $this->getCalendarBusinessEnd();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarBusinessHoursPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getCalendarUid(),
+ $keys[1] => $this->getCalendarBusinessDay(),
+ $keys[2] => $this->getCalendarBusinessStart(),
+ $keys[3] => $this->getCalendarBusinessEnd(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarBusinessHoursPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setCalendarUid($value);
+ break;
+ case 1:
+ $this->setCalendarBusinessDay($value);
+ break;
+ case 2:
+ $this->setCalendarBusinessStart($value);
+ break;
+ case 3:
+ $this->setCalendarBusinessEnd($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarBusinessHoursPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setCalendarUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setCalendarBusinessDay($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setCalendarBusinessStart($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setCalendarBusinessEnd($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CalendarBusinessHoursPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_UID)) {
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $this->calendar_uid);
+ }
+
+ if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY)) {
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $this->calendar_business_day);
+ }
+
+ if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START)) {
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $this->calendar_business_start);
+ }
+
+ if ($this->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END)) {
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $this->calendar_business_end);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CalendarBusinessHoursPeer::DATABASE_NAME);
+
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $this->calendar_uid);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $this->calendar_business_day);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $this->calendar_business_start);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $this->calendar_business_end);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getCalendarUid();
+
+ $pks[1] = $this->getCalendarBusinessDay();
+
+ $pks[2] = $this->getCalendarBusinessStart();
+
+ $pks[3] = $this->getCalendarBusinessEnd();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setCalendarUid($keys[0]);
+
+ $this->setCalendarBusinessDay($keys[1]);
+
+ $this->setCalendarBusinessStart($keys[2]);
+
+ $this->setCalendarBusinessEnd($keys[3]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of CalendarBusinessHours (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setCalendarUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setCalendarBusinessDay(''); // this is a pkey column, so set to default value
+
+ $copyObj->setCalendarBusinessStart(''); // this is a pkey column, so set to default value
+
+ $copyObj->setCalendarBusinessEnd(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return CalendarBusinessHours Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return CalendarBusinessHoursPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new CalendarBusinessHoursPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarBusinessHoursPeer.php b/workflow/engine/classes/model/om/BaseCalendarBusinessHoursPeer.php
index 28be96d77..bd2e4c2e7 100755
--- a/workflow/engine/classes/model/om/BaseCalendarBusinessHoursPeer.php
+++ b/workflow/engine/classes/model/om/BaseCalendarBusinessHoursPeer.php
@@ -12,577 +12,578 @@ include_once 'classes/model/CalendarBusinessHours.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarBusinessHoursPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'CALENDAR_BUSINESS_HOURS';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.CalendarBusinessHours';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the CALENDAR_UID field */
- const CALENDAR_UID = 'CALENDAR_BUSINESS_HOURS.CALENDAR_UID';
-
- /** the column name for the CALENDAR_BUSINESS_DAY field */
- const CALENDAR_BUSINESS_DAY = 'CALENDAR_BUSINESS_HOURS.CALENDAR_BUSINESS_DAY';
-
- /** the column name for the CALENDAR_BUSINESS_START field */
- const CALENDAR_BUSINESS_START = 'CALENDAR_BUSINESS_HOURS.CALENDAR_BUSINESS_START';
-
- /** the column name for the CALENDAR_BUSINESS_END field */
- const CALENDAR_BUSINESS_END = 'CALENDAR_BUSINESS_HOURS.CALENDAR_BUSINESS_END';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('CalendarUid', 'CalendarBusinessDay', 'CalendarBusinessStart', 'CalendarBusinessEnd', ),
- BasePeer::TYPE_COLNAME => array (CalendarBusinessHoursPeer::CALENDAR_UID, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, ),
- BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID', 'CALENDAR_BUSINESS_DAY', 'CALENDAR_BUSINESS_START', 'CALENDAR_BUSINESS_END', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('CalendarUid' => 0, 'CalendarBusinessDay' => 1, 'CalendarBusinessStart' => 2, 'CalendarBusinessEnd' => 3, ),
- BasePeer::TYPE_COLNAME => array (CalendarBusinessHoursPeer::CALENDAR_UID => 0, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY => 1, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START => 2, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID' => 0, 'CALENDAR_BUSINESS_DAY' => 1, 'CALENDAR_BUSINESS_START' => 2, 'CALENDAR_BUSINESS_END' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/CalendarBusinessHoursMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.CalendarBusinessHoursMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = CalendarBusinessHoursPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CalendarBusinessHoursPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CalendarBusinessHoursPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_UID);
-
- $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
-
- $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
-
- $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END);
-
- }
-
- const COUNT = 'COUNT(CALENDAR_BUSINESS_HOURS.CALENDAR_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_BUSINESS_HOURS.CALENDAR_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(CalendarBusinessHoursPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(CalendarBusinessHoursPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = CalendarBusinessHoursPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return CalendarBusinessHours
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CalendarBusinessHoursPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return CalendarBusinessHoursPeer::populateObjects(CalendarBusinessHoursPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- CalendarBusinessHoursPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CalendarBusinessHoursPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return CalendarBusinessHoursPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a CalendarBusinessHours or Criteria object.
- *
- * @param mixed $values Criteria or CalendarBusinessHours object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CalendarBusinessHours object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a CalendarBusinessHours or Criteria object.
- *
- * @param mixed $values Criteria or CalendarBusinessHours object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_UID);
- $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_UID), $comparison);
-
- $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
- $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY), $comparison);
-
- $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
- $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START), $comparison);
-
- $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END);
- $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END), $comparison);
-
- } else { // $values is CalendarBusinessHours object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CALENDAR_BUSINESS_HOURS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(CalendarBusinessHoursPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a CalendarBusinessHours or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CalendarBusinessHours object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CalendarBusinessHoursPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof CalendarBusinessHours) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- $vals[3][] = $value[3];
- }
-
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $vals[0], Criteria::IN);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $vals[1], Criteria::IN);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $vals[2], Criteria::IN);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $vals[3], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CalendarBusinessHours object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CalendarBusinessHours $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(CalendarBusinessHours $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CalendarBusinessHoursPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CalendarBusinessHoursPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY))
- $columns[CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY] = $obj->getCalendarBusinessDay();
-
- }
-
- return BasePeer::doValidate(CalendarBusinessHoursPeer::DATABASE_NAME, CalendarBusinessHoursPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $calendar_uid
- @param string $calendar_business_day
- @param string $calendar_business_start
- @param string $calendar_business_end
-
- * @param Connection $con
- * @return CalendarBusinessHours
- */
- public static function retrieveByPK( $calendar_uid, $calendar_business_day, $calendar_business_start, $calendar_business_end, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $calendar_uid);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $calendar_business_day);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $calendar_business_start);
- $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $calendar_business_end);
- $v = CalendarBusinessHoursPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseCalendarBusinessHoursPeer
+abstract class BaseCalendarBusinessHoursPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'CALENDAR_BUSINESS_HOURS';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.CalendarBusinessHours';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the CALENDAR_UID field */
+ const CALENDAR_UID = 'CALENDAR_BUSINESS_HOURS.CALENDAR_UID';
+
+ /** the column name for the CALENDAR_BUSINESS_DAY field */
+ const CALENDAR_BUSINESS_DAY = 'CALENDAR_BUSINESS_HOURS.CALENDAR_BUSINESS_DAY';
+
+ /** the column name for the CALENDAR_BUSINESS_START field */
+ const CALENDAR_BUSINESS_START = 'CALENDAR_BUSINESS_HOURS.CALENDAR_BUSINESS_START';
+
+ /** the column name for the CALENDAR_BUSINESS_END field */
+ const CALENDAR_BUSINESS_END = 'CALENDAR_BUSINESS_HOURS.CALENDAR_BUSINESS_END';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('CalendarUid', 'CalendarBusinessDay', 'CalendarBusinessStart', 'CalendarBusinessEnd', ),
+ BasePeer::TYPE_COLNAME => array (CalendarBusinessHoursPeer::CALENDAR_UID, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, ),
+ BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID', 'CALENDAR_BUSINESS_DAY', 'CALENDAR_BUSINESS_START', 'CALENDAR_BUSINESS_END', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('CalendarUid' => 0, 'CalendarBusinessDay' => 1, 'CalendarBusinessStart' => 2, 'CalendarBusinessEnd' => 3, ),
+ BasePeer::TYPE_COLNAME => array (CalendarBusinessHoursPeer::CALENDAR_UID => 0, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY => 1, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START => 2, CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID' => 0, 'CALENDAR_BUSINESS_DAY' => 1, 'CALENDAR_BUSINESS_START' => 2, 'CALENDAR_BUSINESS_END' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/CalendarBusinessHoursMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.CalendarBusinessHoursMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = CalendarBusinessHoursPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. CalendarBusinessHoursPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(CalendarBusinessHoursPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_UID);
+
+ $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
+
+ $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
+
+ $criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END);
+
+ }
+
+ const COUNT = 'COUNT(CALENDAR_BUSINESS_HOURS.CALENDAR_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_BUSINESS_HOURS.CALENDAR_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(CalendarBusinessHoursPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(CalendarBusinessHoursPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = CalendarBusinessHoursPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return CalendarBusinessHours
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = CalendarBusinessHoursPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return CalendarBusinessHoursPeer::populateObjects(CalendarBusinessHoursPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ CalendarBusinessHoursPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = CalendarBusinessHoursPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return CalendarBusinessHoursPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a CalendarBusinessHours or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarBusinessHours object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from CalendarBusinessHours object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a CalendarBusinessHours or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarBusinessHours object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_UID);
+ $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_UID), $comparison);
+
+ $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
+ $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY), $comparison);
+
+ $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
+ $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START), $comparison);
+
+ $comparison = $criteria->getComparison(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END);
+ $selectCriteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $criteria->remove(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CALENDAR_BUSINESS_HOURS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(CalendarBusinessHoursPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a CalendarBusinessHours or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CalendarBusinessHours object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarBusinessHoursPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof CalendarBusinessHours) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ $vals[3][] = $value[3];
+ }
+
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $vals[0], Criteria::IN);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $vals[1], Criteria::IN);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $vals[2], Criteria::IN);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $vals[3], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given CalendarBusinessHours object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param CalendarBusinessHours $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(CalendarBusinessHours $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(CalendarBusinessHoursPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(CalendarBusinessHoursPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY))
+ $columns[CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY] = $obj->getCalendarBusinessDay();
+
+ }
+
+ return BasePeer::doValidate(CalendarBusinessHoursPeer::DATABASE_NAME, CalendarBusinessHoursPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $calendar_uid
+ * @param string $calendar_business_day
+ * @param string $calendar_business_start
+ * @param string $calendar_business_end
+ * @param Connection $con
+ * @return CalendarBusinessHours
+ */
+ public static function retrieveByPK($calendar_uid, $calendar_business_day, $calendar_business_start, $calendar_business_end, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $calendar_uid);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY, $calendar_business_day);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START, $calendar_business_start);
+ $criteria->add(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END, $calendar_business_end);
+ $v = CalendarBusinessHoursPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseCalendarBusinessHoursPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseCalendarBusinessHoursPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/CalendarBusinessHoursMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.CalendarBusinessHoursMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/CalendarBusinessHoursMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.CalendarBusinessHoursMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarDefinition.php b/workflow/engine/classes/model/om/BaseCalendarDefinition.php
index f05075f48..5e1334c57 100755
--- a/workflow/engine/classes/model/om/BaseCalendarDefinition.php
+++ b/workflow/engine/classes/model/om/BaseCalendarDefinition.php
@@ -16,851 +16,891 @@ include_once 'classes/model/CalendarDefinitionPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarDefinition extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var CalendarDefinitionPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the calendar_uid field.
- * @var string
- */
- protected $calendar_uid = '';
-
-
- /**
- * The value for the calendar_name field.
- * @var string
- */
- protected $calendar_name = '';
-
-
- /**
- * The value for the calendar_create_date field.
- * @var int
- */
- protected $calendar_create_date;
-
-
- /**
- * The value for the calendar_update_date field.
- * @var int
- */
- protected $calendar_update_date;
-
-
- /**
- * The value for the calendar_work_days field.
- * @var string
- */
- protected $calendar_work_days = '';
-
-
- /**
- * The value for the calendar_description field.
- * @var string
- */
- protected $calendar_description;
-
-
- /**
- * The value for the calendar_status field.
- * @var string
- */
- protected $calendar_status = 'ACTIVE';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [calendar_uid] column value.
- *
- * @return string
- */
- public function getCalendarUid()
- {
-
- return $this->calendar_uid;
- }
-
- /**
- * Get the [calendar_name] column value.
- *
- * @return string
- */
- public function getCalendarName()
- {
-
- return $this->calendar_name;
- }
-
- /**
- * Get the [optionally formatted] [calendar_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getCalendarCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->calendar_create_date === null || $this->calendar_create_date === '') {
- return null;
- } elseif (!is_int($this->calendar_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->calendar_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [calendar_create_date] as date/time value: " . var_export($this->calendar_create_date, true));
- }
- } else {
- $ts = $this->calendar_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [calendar_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getCalendarUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->calendar_update_date === null || $this->calendar_update_date === '') {
- return null;
- } elseif (!is_int($this->calendar_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->calendar_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [calendar_update_date] as date/time value: " . var_export($this->calendar_update_date, true));
- }
- } else {
- $ts = $this->calendar_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [calendar_work_days] column value.
- *
- * @return string
- */
- public function getCalendarWorkDays()
- {
-
- return $this->calendar_work_days;
- }
-
- /**
- * Get the [calendar_description] column value.
- *
- * @return string
- */
- public function getCalendarDescription()
- {
-
- return $this->calendar_description;
- }
-
- /**
- * Get the [calendar_status] column value.
- *
- * @return string
- */
- public function getCalendarStatus()
- {
-
- return $this->calendar_status;
- }
-
- /**
- * Set the value of [calendar_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_uid !== $v || $v === '') {
- $this->calendar_uid = $v;
- $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_UID;
- }
-
- } // setCalendarUid()
-
- /**
- * Set the value of [calendar_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_name !== $v || $v === '') {
- $this->calendar_name = $v;
- $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_NAME;
- }
-
- } // setCalendarName()
-
- /**
- * Set the value of [calendar_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setCalendarCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [calendar_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->calendar_create_date !== $ts) {
- $this->calendar_create_date = $ts;
- $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_CREATE_DATE;
- }
-
- } // setCalendarCreateDate()
-
- /**
- * Set the value of [calendar_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setCalendarUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [calendar_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->calendar_update_date !== $ts) {
- $this->calendar_update_date = $ts;
- $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_UPDATE_DATE;
- }
-
- } // setCalendarUpdateDate()
-
- /**
- * Set the value of [calendar_work_days] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarWorkDays($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_work_days !== $v || $v === '') {
- $this->calendar_work_days = $v;
- $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_WORK_DAYS;
- }
-
- } // setCalendarWorkDays()
-
- /**
- * Set the value of [calendar_description] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarDescription($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_description !== $v) {
- $this->calendar_description = $v;
- $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_DESCRIPTION;
- }
-
- } // setCalendarDescription()
-
- /**
- * Set the value of [calendar_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_status !== $v || $v === 'ACTIVE') {
- $this->calendar_status = $v;
- $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_STATUS;
- }
-
- } // setCalendarStatus()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->calendar_uid = $rs->getString($startcol + 0);
-
- $this->calendar_name = $rs->getString($startcol + 1);
-
- $this->calendar_create_date = $rs->getTimestamp($startcol + 2, null);
-
- $this->calendar_update_date = $rs->getTimestamp($startcol + 3, null);
-
- $this->calendar_work_days = $rs->getString($startcol + 4);
-
- $this->calendar_description = $rs->getString($startcol + 5);
-
- $this->calendar_status = $rs->getString($startcol + 6);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 7; // 7 = CalendarDefinitionPeer::NUM_COLUMNS - CalendarDefinitionPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CalendarDefinition object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarDefinitionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- CalendarDefinitionPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarDefinitionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = CalendarDefinitionPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += CalendarDefinitionPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CalendarDefinitionPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarDefinitionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getCalendarUid();
- break;
- case 1:
- return $this->getCalendarName();
- break;
- case 2:
- return $this->getCalendarCreateDate();
- break;
- case 3:
- return $this->getCalendarUpdateDate();
- break;
- case 4:
- return $this->getCalendarWorkDays();
- break;
- case 5:
- return $this->getCalendarDescription();
- break;
- case 6:
- return $this->getCalendarStatus();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarDefinitionPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getCalendarUid(),
- $keys[1] => $this->getCalendarName(),
- $keys[2] => $this->getCalendarCreateDate(),
- $keys[3] => $this->getCalendarUpdateDate(),
- $keys[4] => $this->getCalendarWorkDays(),
- $keys[5] => $this->getCalendarDescription(),
- $keys[6] => $this->getCalendarStatus(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarDefinitionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setCalendarUid($value);
- break;
- case 1:
- $this->setCalendarName($value);
- break;
- case 2:
- $this->setCalendarCreateDate($value);
- break;
- case 3:
- $this->setCalendarUpdateDate($value);
- break;
- case 4:
- $this->setCalendarWorkDays($value);
- break;
- case 5:
- $this->setCalendarDescription($value);
- break;
- case 6:
- $this->setCalendarStatus($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarDefinitionPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setCalendarUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCalendarName($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCalendarCreateDate($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCalendarUpdateDate($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setCalendarWorkDays($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setCalendarDescription($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setCalendarStatus($arr[$keys[6]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CalendarDefinitionPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_UID)) $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $this->calendar_uid);
- if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_NAME)) $criteria->add(CalendarDefinitionPeer::CALENDAR_NAME, $this->calendar_name);
- if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_CREATE_DATE)) $criteria->add(CalendarDefinitionPeer::CALENDAR_CREATE_DATE, $this->calendar_create_date);
- if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE)) $criteria->add(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE, $this->calendar_update_date);
- if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_WORK_DAYS)) $criteria->add(CalendarDefinitionPeer::CALENDAR_WORK_DAYS, $this->calendar_work_days);
- if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_DESCRIPTION)) $criteria->add(CalendarDefinitionPeer::CALENDAR_DESCRIPTION, $this->calendar_description);
- if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_STATUS)) $criteria->add(CalendarDefinitionPeer::CALENDAR_STATUS, $this->calendar_status);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CalendarDefinitionPeer::DATABASE_NAME);
-
- $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $this->calendar_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getCalendarUid();
- }
-
- /**
- * Generic method to set the primary key (calendar_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setCalendarUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CalendarDefinition (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setCalendarName($this->calendar_name);
-
- $copyObj->setCalendarCreateDate($this->calendar_create_date);
-
- $copyObj->setCalendarUpdateDate($this->calendar_update_date);
-
- $copyObj->setCalendarWorkDays($this->calendar_work_days);
-
- $copyObj->setCalendarDescription($this->calendar_description);
-
- $copyObj->setCalendarStatus($this->calendar_status);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setCalendarUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CalendarDefinition Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CalendarDefinitionPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CalendarDefinitionPeer();
- }
- return self::$peer;
- }
-
-} // BaseCalendarDefinition
+abstract class BaseCalendarDefinition extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var CalendarDefinitionPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the calendar_uid field.
+ * @var string
+ */
+ protected $calendar_uid = '';
+
+ /**
+ * The value for the calendar_name field.
+ * @var string
+ */
+ protected $calendar_name = '';
+
+ /**
+ * The value for the calendar_create_date field.
+ * @var int
+ */
+ protected $calendar_create_date;
+
+ /**
+ * The value for the calendar_update_date field.
+ * @var int
+ */
+ protected $calendar_update_date;
+
+ /**
+ * The value for the calendar_work_days field.
+ * @var string
+ */
+ protected $calendar_work_days = '';
+
+ /**
+ * The value for the calendar_description field.
+ * @var string
+ */
+ protected $calendar_description;
+
+ /**
+ * The value for the calendar_status field.
+ * @var string
+ */
+ protected $calendar_status = 'ACTIVE';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [calendar_uid] column value.
+ *
+ * @return string
+ */
+ public function getCalendarUid()
+ {
+
+ return $this->calendar_uid;
+ }
+
+ /**
+ * Get the [calendar_name] column value.
+ *
+ * @return string
+ */
+ public function getCalendarName()
+ {
+
+ return $this->calendar_name;
+ }
+
+ /**
+ * Get the [optionally formatted] [calendar_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getCalendarCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->calendar_create_date === null || $this->calendar_create_date === '') {
+ return null;
+ } elseif (!is_int($this->calendar_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->calendar_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [calendar_create_date] as date/time value: " .
+ var_export($this->calendar_create_date, true));
+ }
+ } else {
+ $ts = $this->calendar_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [calendar_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getCalendarUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->calendar_update_date === null || $this->calendar_update_date === '') {
+ return null;
+ } elseif (!is_int($this->calendar_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->calendar_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [calendar_update_date] as date/time value: " .
+ var_export($this->calendar_update_date, true));
+ }
+ } else {
+ $ts = $this->calendar_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [calendar_work_days] column value.
+ *
+ * @return string
+ */
+ public function getCalendarWorkDays()
+ {
+
+ return $this->calendar_work_days;
+ }
+
+ /**
+ * Get the [calendar_description] column value.
+ *
+ * @return string
+ */
+ public function getCalendarDescription()
+ {
+
+ return $this->calendar_description;
+ }
+
+ /**
+ * Get the [calendar_status] column value.
+ *
+ * @return string
+ */
+ public function getCalendarStatus()
+ {
+
+ return $this->calendar_status;
+ }
+
+ /**
+ * Set the value of [calendar_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_uid !== $v || $v === '') {
+ $this->calendar_uid = $v;
+ $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_UID;
+ }
+
+ } // setCalendarUid()
+
+ /**
+ * Set the value of [calendar_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_name !== $v || $v === '') {
+ $this->calendar_name = $v;
+ $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_NAME;
+ }
+
+ } // setCalendarName()
+
+ /**
+ * Set the value of [calendar_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setCalendarCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [calendar_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->calendar_create_date !== $ts) {
+ $this->calendar_create_date = $ts;
+ $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_CREATE_DATE;
+ }
+
+ } // setCalendarCreateDate()
+
+ /**
+ * Set the value of [calendar_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setCalendarUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [calendar_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->calendar_update_date !== $ts) {
+ $this->calendar_update_date = $ts;
+ $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_UPDATE_DATE;
+ }
+
+ } // setCalendarUpdateDate()
+
+ /**
+ * Set the value of [calendar_work_days] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarWorkDays($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_work_days !== $v || $v === '') {
+ $this->calendar_work_days = $v;
+ $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_WORK_DAYS;
+ }
+
+ } // setCalendarWorkDays()
+
+ /**
+ * Set the value of [calendar_description] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarDescription($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_description !== $v) {
+ $this->calendar_description = $v;
+ $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_DESCRIPTION;
+ }
+
+ } // setCalendarDescription()
+
+ /**
+ * Set the value of [calendar_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_status !== $v || $v === 'ACTIVE') {
+ $this->calendar_status = $v;
+ $this->modifiedColumns[] = CalendarDefinitionPeer::CALENDAR_STATUS;
+ }
+
+ } // setCalendarStatus()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->calendar_uid = $rs->getString($startcol + 0);
+
+ $this->calendar_name = $rs->getString($startcol + 1);
+
+ $this->calendar_create_date = $rs->getTimestamp($startcol + 2, null);
+
+ $this->calendar_update_date = $rs->getTimestamp($startcol + 3, null);
+
+ $this->calendar_work_days = $rs->getString($startcol + 4);
+
+ $this->calendar_description = $rs->getString($startcol + 5);
+
+ $this->calendar_status = $rs->getString($startcol + 6);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 7; // 7 = CalendarDefinitionPeer::NUM_COLUMNS - CalendarDefinitionPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating CalendarDefinition object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarDefinitionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ CalendarDefinitionPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarDefinitionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = CalendarDefinitionPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += CalendarDefinitionPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = CalendarDefinitionPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarDefinitionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getCalendarUid();
+ break;
+ case 1:
+ return $this->getCalendarName();
+ break;
+ case 2:
+ return $this->getCalendarCreateDate();
+ break;
+ case 3:
+ return $this->getCalendarUpdateDate();
+ break;
+ case 4:
+ return $this->getCalendarWorkDays();
+ break;
+ case 5:
+ return $this->getCalendarDescription();
+ break;
+ case 6:
+ return $this->getCalendarStatus();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarDefinitionPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getCalendarUid(),
+ $keys[1] => $this->getCalendarName(),
+ $keys[2] => $this->getCalendarCreateDate(),
+ $keys[3] => $this->getCalendarUpdateDate(),
+ $keys[4] => $this->getCalendarWorkDays(),
+ $keys[5] => $this->getCalendarDescription(),
+ $keys[6] => $this->getCalendarStatus(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarDefinitionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setCalendarUid($value);
+ break;
+ case 1:
+ $this->setCalendarName($value);
+ break;
+ case 2:
+ $this->setCalendarCreateDate($value);
+ break;
+ case 3:
+ $this->setCalendarUpdateDate($value);
+ break;
+ case 4:
+ $this->setCalendarWorkDays($value);
+ break;
+ case 5:
+ $this->setCalendarDescription($value);
+ break;
+ case 6:
+ $this->setCalendarStatus($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarDefinitionPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setCalendarUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setCalendarName($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setCalendarCreateDate($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setCalendarUpdateDate($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setCalendarWorkDays($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setCalendarDescription($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setCalendarStatus($arr[$keys[6]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CalendarDefinitionPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_UID)) {
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $this->calendar_uid);
+ }
+
+ if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_NAME)) {
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_NAME, $this->calendar_name);
+ }
+
+ if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_CREATE_DATE)) {
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_CREATE_DATE, $this->calendar_create_date);
+ }
+
+ if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE)) {
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE, $this->calendar_update_date);
+ }
+
+ if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_WORK_DAYS)) {
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_WORK_DAYS, $this->calendar_work_days);
+ }
+
+ if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_DESCRIPTION)) {
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_DESCRIPTION, $this->calendar_description);
+ }
+
+ if ($this->isColumnModified(CalendarDefinitionPeer::CALENDAR_STATUS)) {
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_STATUS, $this->calendar_status);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CalendarDefinitionPeer::DATABASE_NAME);
+
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $this->calendar_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getCalendarUid();
+ }
+
+ /**
+ * Generic method to set the primary key (calendar_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setCalendarUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of CalendarDefinition (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setCalendarName($this->calendar_name);
+
+ $copyObj->setCalendarCreateDate($this->calendar_create_date);
+
+ $copyObj->setCalendarUpdateDate($this->calendar_update_date);
+
+ $copyObj->setCalendarWorkDays($this->calendar_work_days);
+
+ $copyObj->setCalendarDescription($this->calendar_description);
+
+ $copyObj->setCalendarStatus($this->calendar_status);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setCalendarUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return CalendarDefinition Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return CalendarDefinitionPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new CalendarDefinitionPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarDefinitionPeer.php b/workflow/engine/classes/model/om/BaseCalendarDefinitionPeer.php
index 295010041..066a03489 100755
--- a/workflow/engine/classes/model/om/BaseCalendarDefinitionPeer.php
+++ b/workflow/engine/classes/model/om/BaseCalendarDefinitionPeer.php
@@ -12,587 +12,589 @@ include_once 'classes/model/CalendarDefinition.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarDefinitionPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'CALENDAR_DEFINITION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.CalendarDefinition';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 7;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the CALENDAR_UID field */
- const CALENDAR_UID = 'CALENDAR_DEFINITION.CALENDAR_UID';
-
- /** the column name for the CALENDAR_NAME field */
- const CALENDAR_NAME = 'CALENDAR_DEFINITION.CALENDAR_NAME';
-
- /** the column name for the CALENDAR_CREATE_DATE field */
- const CALENDAR_CREATE_DATE = 'CALENDAR_DEFINITION.CALENDAR_CREATE_DATE';
-
- /** the column name for the CALENDAR_UPDATE_DATE field */
- const CALENDAR_UPDATE_DATE = 'CALENDAR_DEFINITION.CALENDAR_UPDATE_DATE';
-
- /** the column name for the CALENDAR_WORK_DAYS field */
- const CALENDAR_WORK_DAYS = 'CALENDAR_DEFINITION.CALENDAR_WORK_DAYS';
-
- /** the column name for the CALENDAR_DESCRIPTION field */
- const CALENDAR_DESCRIPTION = 'CALENDAR_DEFINITION.CALENDAR_DESCRIPTION';
-
- /** the column name for the CALENDAR_STATUS field */
- const CALENDAR_STATUS = 'CALENDAR_DEFINITION.CALENDAR_STATUS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('CalendarUid', 'CalendarName', 'CalendarCreateDate', 'CalendarUpdateDate', 'CalendarWorkDays', 'CalendarDescription', 'CalendarStatus', ),
- BasePeer::TYPE_COLNAME => array (CalendarDefinitionPeer::CALENDAR_UID, CalendarDefinitionPeer::CALENDAR_NAME, CalendarDefinitionPeer::CALENDAR_CREATE_DATE, CalendarDefinitionPeer::CALENDAR_UPDATE_DATE, CalendarDefinitionPeer::CALENDAR_WORK_DAYS, CalendarDefinitionPeer::CALENDAR_DESCRIPTION, CalendarDefinitionPeer::CALENDAR_STATUS, ),
- BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID', 'CALENDAR_NAME', 'CALENDAR_CREATE_DATE', 'CALENDAR_UPDATE_DATE', 'CALENDAR_WORK_DAYS', 'CALENDAR_DESCRIPTION', 'CALENDAR_STATUS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('CalendarUid' => 0, 'CalendarName' => 1, 'CalendarCreateDate' => 2, 'CalendarUpdateDate' => 3, 'CalendarWorkDays' => 4, 'CalendarDescription' => 5, 'CalendarStatus' => 6, ),
- BasePeer::TYPE_COLNAME => array (CalendarDefinitionPeer::CALENDAR_UID => 0, CalendarDefinitionPeer::CALENDAR_NAME => 1, CalendarDefinitionPeer::CALENDAR_CREATE_DATE => 2, CalendarDefinitionPeer::CALENDAR_UPDATE_DATE => 3, CalendarDefinitionPeer::CALENDAR_WORK_DAYS => 4, CalendarDefinitionPeer::CALENDAR_DESCRIPTION => 5, CalendarDefinitionPeer::CALENDAR_STATUS => 6, ),
- BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID' => 0, 'CALENDAR_NAME' => 1, 'CALENDAR_CREATE_DATE' => 2, 'CALENDAR_UPDATE_DATE' => 3, 'CALENDAR_WORK_DAYS' => 4, 'CALENDAR_DESCRIPTION' => 5, 'CALENDAR_STATUS' => 6, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/CalendarDefinitionMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.CalendarDefinitionMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = CalendarDefinitionPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CalendarDefinitionPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CalendarDefinitionPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UID);
-
- $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_NAME);
-
- $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_CREATE_DATE);
-
- $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE);
-
- $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_WORK_DAYS);
-
- $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_DESCRIPTION);
-
- $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_STATUS);
-
- }
-
- const COUNT = 'COUNT(CALENDAR_DEFINITION.CALENDAR_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_DEFINITION.CALENDAR_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(CalendarDefinitionPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(CalendarDefinitionPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = CalendarDefinitionPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return CalendarDefinition
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CalendarDefinitionPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return CalendarDefinitionPeer::populateObjects(CalendarDefinitionPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- CalendarDefinitionPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CalendarDefinitionPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return CalendarDefinitionPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a CalendarDefinition or Criteria object.
- *
- * @param mixed $values Criteria or CalendarDefinition object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CalendarDefinition object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a CalendarDefinition or Criteria object.
- *
- * @param mixed $values Criteria or CalendarDefinition object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CalendarDefinitionPeer::CALENDAR_UID);
- $selectCriteria->add(CalendarDefinitionPeer::CALENDAR_UID, $criteria->remove(CalendarDefinitionPeer::CALENDAR_UID), $comparison);
-
- } else { // $values is CalendarDefinition object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CALENDAR_DEFINITION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(CalendarDefinitionPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a CalendarDefinition or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CalendarDefinition object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CalendarDefinitionPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof CalendarDefinition) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CalendarDefinition object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CalendarDefinition $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(CalendarDefinition $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CalendarDefinitionPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CalendarDefinitionPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(CalendarDefinitionPeer::CALENDAR_STATUS))
- $columns[CalendarDefinitionPeer::CALENDAR_STATUS] = $obj->getCalendarStatus();
-
- }
-
- return BasePeer::doValidate(CalendarDefinitionPeer::DATABASE_NAME, CalendarDefinitionPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return CalendarDefinition
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(CalendarDefinitionPeer::DATABASE_NAME);
-
- $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $pk);
-
-
- $v = CalendarDefinitionPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $pks, Criteria::IN);
- $objs = CalendarDefinitionPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseCalendarDefinitionPeer
+abstract class BaseCalendarDefinitionPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'CALENDAR_DEFINITION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.CalendarDefinition';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 7;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the CALENDAR_UID field */
+ const CALENDAR_UID = 'CALENDAR_DEFINITION.CALENDAR_UID';
+
+ /** the column name for the CALENDAR_NAME field */
+ const CALENDAR_NAME = 'CALENDAR_DEFINITION.CALENDAR_NAME';
+
+ /** the column name for the CALENDAR_CREATE_DATE field */
+ const CALENDAR_CREATE_DATE = 'CALENDAR_DEFINITION.CALENDAR_CREATE_DATE';
+
+ /** the column name for the CALENDAR_UPDATE_DATE field */
+ const CALENDAR_UPDATE_DATE = 'CALENDAR_DEFINITION.CALENDAR_UPDATE_DATE';
+
+ /** the column name for the CALENDAR_WORK_DAYS field */
+ const CALENDAR_WORK_DAYS = 'CALENDAR_DEFINITION.CALENDAR_WORK_DAYS';
+
+ /** the column name for the CALENDAR_DESCRIPTION field */
+ const CALENDAR_DESCRIPTION = 'CALENDAR_DEFINITION.CALENDAR_DESCRIPTION';
+
+ /** the column name for the CALENDAR_STATUS field */
+ const CALENDAR_STATUS = 'CALENDAR_DEFINITION.CALENDAR_STATUS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('CalendarUid', 'CalendarName', 'CalendarCreateDate', 'CalendarUpdateDate', 'CalendarWorkDays', 'CalendarDescription', 'CalendarStatus', ),
+ BasePeer::TYPE_COLNAME => array (CalendarDefinitionPeer::CALENDAR_UID, CalendarDefinitionPeer::CALENDAR_NAME, CalendarDefinitionPeer::CALENDAR_CREATE_DATE, CalendarDefinitionPeer::CALENDAR_UPDATE_DATE, CalendarDefinitionPeer::CALENDAR_WORK_DAYS, CalendarDefinitionPeer::CALENDAR_DESCRIPTION, CalendarDefinitionPeer::CALENDAR_STATUS, ),
+ BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID', 'CALENDAR_NAME', 'CALENDAR_CREATE_DATE', 'CALENDAR_UPDATE_DATE', 'CALENDAR_WORK_DAYS', 'CALENDAR_DESCRIPTION', 'CALENDAR_STATUS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('CalendarUid' => 0, 'CalendarName' => 1, 'CalendarCreateDate' => 2, 'CalendarUpdateDate' => 3, 'CalendarWorkDays' => 4, 'CalendarDescription' => 5, 'CalendarStatus' => 6, ),
+ BasePeer::TYPE_COLNAME => array (CalendarDefinitionPeer::CALENDAR_UID => 0, CalendarDefinitionPeer::CALENDAR_NAME => 1, CalendarDefinitionPeer::CALENDAR_CREATE_DATE => 2, CalendarDefinitionPeer::CALENDAR_UPDATE_DATE => 3, CalendarDefinitionPeer::CALENDAR_WORK_DAYS => 4, CalendarDefinitionPeer::CALENDAR_DESCRIPTION => 5, CalendarDefinitionPeer::CALENDAR_STATUS => 6, ),
+ BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID' => 0, 'CALENDAR_NAME' => 1, 'CALENDAR_CREATE_DATE' => 2, 'CALENDAR_UPDATE_DATE' => 3, 'CALENDAR_WORK_DAYS' => 4, 'CALENDAR_DESCRIPTION' => 5, 'CALENDAR_STATUS' => 6, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/CalendarDefinitionMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.CalendarDefinitionMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = CalendarDefinitionPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. CalendarDefinitionPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(CalendarDefinitionPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UID);
+
+ $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_NAME);
+
+ $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_CREATE_DATE);
+
+ $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE);
+
+ $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_WORK_DAYS);
+
+ $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_DESCRIPTION);
+
+ $criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_STATUS);
+
+ }
+
+ const COUNT = 'COUNT(CALENDAR_DEFINITION.CALENDAR_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_DEFINITION.CALENDAR_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(CalendarDefinitionPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(CalendarDefinitionPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = CalendarDefinitionPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return CalendarDefinition
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = CalendarDefinitionPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return CalendarDefinitionPeer::populateObjects(CalendarDefinitionPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ CalendarDefinitionPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = CalendarDefinitionPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return CalendarDefinitionPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a CalendarDefinition or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarDefinition object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from CalendarDefinition object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a CalendarDefinition or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarDefinition object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(CalendarDefinitionPeer::CALENDAR_UID);
+ $selectCriteria->add(CalendarDefinitionPeer::CALENDAR_UID, $criteria->remove(CalendarDefinitionPeer::CALENDAR_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CALENDAR_DEFINITION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(CalendarDefinitionPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a CalendarDefinition or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CalendarDefinition object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarDefinitionPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof CalendarDefinition) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given CalendarDefinition object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param CalendarDefinition $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(CalendarDefinition $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(CalendarDefinitionPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(CalendarDefinitionPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(CalendarDefinitionPeer::CALENDAR_STATUS))
+ $columns[CalendarDefinitionPeer::CALENDAR_STATUS] = $obj->getCalendarStatus();
+
+ }
+
+ return BasePeer::doValidate(CalendarDefinitionPeer::DATABASE_NAME, CalendarDefinitionPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return CalendarDefinition
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(CalendarDefinitionPeer::DATABASE_NAME);
+
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $pk);
+
+
+ $v = CalendarDefinitionPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(CalendarDefinitionPeer::CALENDAR_UID, $pks, Criteria::IN);
+ $objs = CalendarDefinitionPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseCalendarDefinitionPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseCalendarDefinitionPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/CalendarDefinitionMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.CalendarDefinitionMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/CalendarDefinitionMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.CalendarDefinitionMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarHolidays.php b/workflow/engine/classes/model/om/BaseCalendarHolidays.php
index 669cb9734..caeff0b1e 100755
--- a/workflow/engine/classes/model/om/BaseCalendarHolidays.php
+++ b/workflow/engine/classes/model/om/BaseCalendarHolidays.php
@@ -16,704 +16,729 @@ include_once 'classes/model/CalendarHolidaysPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarHolidays extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var CalendarHolidaysPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the calendar_uid field.
- * @var string
- */
- protected $calendar_uid = '';
-
-
- /**
- * The value for the calendar_holiday_name field.
- * @var string
- */
- protected $calendar_holiday_name = '';
-
-
- /**
- * The value for the calendar_holiday_start field.
- * @var int
- */
- protected $calendar_holiday_start;
-
-
- /**
- * The value for the calendar_holiday_end field.
- * @var int
- */
- protected $calendar_holiday_end;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [calendar_uid] column value.
- *
- * @return string
- */
- public function getCalendarUid()
- {
-
- return $this->calendar_uid;
- }
-
- /**
- * Get the [calendar_holiday_name] column value.
- *
- * @return string
- */
- public function getCalendarHolidayName()
- {
-
- return $this->calendar_holiday_name;
- }
-
- /**
- * Get the [optionally formatted] [calendar_holiday_start] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getCalendarHolidayStart($format = 'Y-m-d H:i:s')
- {
-
- if ($this->calendar_holiday_start === null || $this->calendar_holiday_start === '') {
- return null;
- } elseif (!is_int($this->calendar_holiday_start)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->calendar_holiday_start);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [calendar_holiday_start] as date/time value: " . var_export($this->calendar_holiday_start, true));
- }
- } else {
- $ts = $this->calendar_holiday_start;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [calendar_holiday_end] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getCalendarHolidayEnd($format = 'Y-m-d H:i:s')
- {
-
- if ($this->calendar_holiday_end === null || $this->calendar_holiday_end === '') {
- return null;
- } elseif (!is_int($this->calendar_holiday_end)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->calendar_holiday_end);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [calendar_holiday_end] as date/time value: " . var_export($this->calendar_holiday_end, true));
- }
- } else {
- $ts = $this->calendar_holiday_end;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [calendar_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_uid !== $v || $v === '') {
- $this->calendar_uid = $v;
- $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_UID;
- }
-
- } // setCalendarUid()
-
- /**
- * Set the value of [calendar_holiday_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCalendarHolidayName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->calendar_holiday_name !== $v || $v === '') {
- $this->calendar_holiday_name = $v;
- $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME;
- }
-
- } // setCalendarHolidayName()
-
- /**
- * Set the value of [calendar_holiday_start] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setCalendarHolidayStart($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [calendar_holiday_start] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->calendar_holiday_start !== $ts) {
- $this->calendar_holiday_start = $ts;
- $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_HOLIDAY_START;
- }
-
- } // setCalendarHolidayStart()
-
- /**
- * Set the value of [calendar_holiday_end] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setCalendarHolidayEnd($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [calendar_holiday_end] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->calendar_holiday_end !== $ts) {
- $this->calendar_holiday_end = $ts;
- $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_HOLIDAY_END;
- }
-
- } // setCalendarHolidayEnd()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->calendar_uid = $rs->getString($startcol + 0);
-
- $this->calendar_holiday_name = $rs->getString($startcol + 1);
-
- $this->calendar_holiday_start = $rs->getTimestamp($startcol + 2, null);
-
- $this->calendar_holiday_end = $rs->getTimestamp($startcol + 3, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = CalendarHolidaysPeer::NUM_COLUMNS - CalendarHolidaysPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CalendarHolidays object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarHolidaysPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- CalendarHolidaysPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CalendarHolidaysPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = CalendarHolidaysPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += CalendarHolidaysPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CalendarHolidaysPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarHolidaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getCalendarUid();
- break;
- case 1:
- return $this->getCalendarHolidayName();
- break;
- case 2:
- return $this->getCalendarHolidayStart();
- break;
- case 3:
- return $this->getCalendarHolidayEnd();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarHolidaysPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getCalendarUid(),
- $keys[1] => $this->getCalendarHolidayName(),
- $keys[2] => $this->getCalendarHolidayStart(),
- $keys[3] => $this->getCalendarHolidayEnd(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CalendarHolidaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setCalendarUid($value);
- break;
- case 1:
- $this->setCalendarHolidayName($value);
- break;
- case 2:
- $this->setCalendarHolidayStart($value);
- break;
- case 3:
- $this->setCalendarHolidayEnd($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CalendarHolidaysPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setCalendarUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCalendarHolidayName($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCalendarHolidayStart($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCalendarHolidayEnd($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CalendarHolidaysPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_UID)) $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $this->calendar_uid);
- if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME)) $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $this->calendar_holiday_name);
- if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_HOLIDAY_START)) $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_START, $this->calendar_holiday_start);
- if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_HOLIDAY_END)) $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_END, $this->calendar_holiday_end);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CalendarHolidaysPeer::DATABASE_NAME);
-
- $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $this->calendar_uid);
- $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $this->calendar_holiday_name);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getCalendarUid();
-
- $pks[1] = $this->getCalendarHolidayName();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setCalendarUid($keys[0]);
-
- $this->setCalendarHolidayName($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CalendarHolidays (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setCalendarHolidayStart($this->calendar_holiday_start);
-
- $copyObj->setCalendarHolidayEnd($this->calendar_holiday_end);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setCalendarUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setCalendarHolidayName(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CalendarHolidays Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CalendarHolidaysPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CalendarHolidaysPeer();
- }
- return self::$peer;
- }
-
-} // BaseCalendarHolidays
+abstract class BaseCalendarHolidays extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var CalendarHolidaysPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the calendar_uid field.
+ * @var string
+ */
+ protected $calendar_uid = '';
+
+ /**
+ * The value for the calendar_holiday_name field.
+ * @var string
+ */
+ protected $calendar_holiday_name = '';
+
+ /**
+ * The value for the calendar_holiday_start field.
+ * @var int
+ */
+ protected $calendar_holiday_start;
+
+ /**
+ * The value for the calendar_holiday_end field.
+ * @var int
+ */
+ protected $calendar_holiday_end;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [calendar_uid] column value.
+ *
+ * @return string
+ */
+ public function getCalendarUid()
+ {
+
+ return $this->calendar_uid;
+ }
+
+ /**
+ * Get the [calendar_holiday_name] column value.
+ *
+ * @return string
+ */
+ public function getCalendarHolidayName()
+ {
+
+ return $this->calendar_holiday_name;
+ }
+
+ /**
+ * Get the [optionally formatted] [calendar_holiday_start] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getCalendarHolidayStart($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->calendar_holiday_start === null || $this->calendar_holiday_start === '') {
+ return null;
+ } elseif (!is_int($this->calendar_holiday_start)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->calendar_holiday_start);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [calendar_holiday_start] as date/time value: " .
+ var_export($this->calendar_holiday_start, true));
+ }
+ } else {
+ $ts = $this->calendar_holiday_start;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [calendar_holiday_end] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getCalendarHolidayEnd($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->calendar_holiday_end === null || $this->calendar_holiday_end === '') {
+ return null;
+ } elseif (!is_int($this->calendar_holiday_end)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->calendar_holiday_end);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [calendar_holiday_end] as date/time value: " .
+ var_export($this->calendar_holiday_end, true));
+ }
+ } else {
+ $ts = $this->calendar_holiday_end;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Set the value of [calendar_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_uid !== $v || $v === '') {
+ $this->calendar_uid = $v;
+ $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_UID;
+ }
+
+ } // setCalendarUid()
+
+ /**
+ * Set the value of [calendar_holiday_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCalendarHolidayName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->calendar_holiday_name !== $v || $v === '') {
+ $this->calendar_holiday_name = $v;
+ $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME;
+ }
+
+ } // setCalendarHolidayName()
+
+ /**
+ * Set the value of [calendar_holiday_start] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setCalendarHolidayStart($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [calendar_holiday_start] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->calendar_holiday_start !== $ts) {
+ $this->calendar_holiday_start = $ts;
+ $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_HOLIDAY_START;
+ }
+
+ } // setCalendarHolidayStart()
+
+ /**
+ * Set the value of [calendar_holiday_end] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setCalendarHolidayEnd($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [calendar_holiday_end] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->calendar_holiday_end !== $ts) {
+ $this->calendar_holiday_end = $ts;
+ $this->modifiedColumns[] = CalendarHolidaysPeer::CALENDAR_HOLIDAY_END;
+ }
+
+ } // setCalendarHolidayEnd()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->calendar_uid = $rs->getString($startcol + 0);
+
+ $this->calendar_holiday_name = $rs->getString($startcol + 1);
+
+ $this->calendar_holiday_start = $rs->getTimestamp($startcol + 2, null);
+
+ $this->calendar_holiday_end = $rs->getTimestamp($startcol + 3, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = CalendarHolidaysPeer::NUM_COLUMNS - CalendarHolidaysPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating CalendarHolidays object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarHolidaysPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ CalendarHolidaysPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarHolidaysPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = CalendarHolidaysPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += CalendarHolidaysPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = CalendarHolidaysPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarHolidaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getCalendarUid();
+ break;
+ case 1:
+ return $this->getCalendarHolidayName();
+ break;
+ case 2:
+ return $this->getCalendarHolidayStart();
+ break;
+ case 3:
+ return $this->getCalendarHolidayEnd();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarHolidaysPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getCalendarUid(),
+ $keys[1] => $this->getCalendarHolidayName(),
+ $keys[2] => $this->getCalendarHolidayStart(),
+ $keys[3] => $this->getCalendarHolidayEnd(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CalendarHolidaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setCalendarUid($value);
+ break;
+ case 1:
+ $this->setCalendarHolidayName($value);
+ break;
+ case 2:
+ $this->setCalendarHolidayStart($value);
+ break;
+ case 3:
+ $this->setCalendarHolidayEnd($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CalendarHolidaysPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setCalendarUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setCalendarHolidayName($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setCalendarHolidayStart($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setCalendarHolidayEnd($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CalendarHolidaysPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_UID)) {
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $this->calendar_uid);
+ }
+
+ if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME)) {
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $this->calendar_holiday_name);
+ }
+
+ if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_HOLIDAY_START)) {
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_START, $this->calendar_holiday_start);
+ }
+
+ if ($this->isColumnModified(CalendarHolidaysPeer::CALENDAR_HOLIDAY_END)) {
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_END, $this->calendar_holiday_end);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CalendarHolidaysPeer::DATABASE_NAME);
+
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $this->calendar_uid);
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $this->calendar_holiday_name);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getCalendarUid();
+
+ $pks[1] = $this->getCalendarHolidayName();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setCalendarUid($keys[0]);
+
+ $this->setCalendarHolidayName($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of CalendarHolidays (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setCalendarHolidayStart($this->calendar_holiday_start);
+
+ $copyObj->setCalendarHolidayEnd($this->calendar_holiday_end);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setCalendarUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setCalendarHolidayName(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return CalendarHolidays Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return CalendarHolidaysPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new CalendarHolidaysPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseCalendarHolidaysPeer.php b/workflow/engine/classes/model/om/BaseCalendarHolidaysPeer.php
index a3b0d0e91..c8513f9b3 100755
--- a/workflow/engine/classes/model/om/BaseCalendarHolidaysPeer.php
+++ b/workflow/engine/classes/model/om/BaseCalendarHolidaysPeer.php
@@ -12,560 +12,561 @@ include_once 'classes/model/CalendarHolidays.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCalendarHolidaysPeer {
+abstract class BaseCalendarHolidaysPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'CALENDAR_HOLIDAYS';
+ /** the table name for this class */
+ const TABLE_NAME = 'CALENDAR_HOLIDAYS';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.CalendarHolidays';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.CalendarHolidays';
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the CALENDAR_UID field */
- const CALENDAR_UID = 'CALENDAR_HOLIDAYS.CALENDAR_UID';
+ /** the column name for the CALENDAR_UID field */
+ const CALENDAR_UID = 'CALENDAR_HOLIDAYS.CALENDAR_UID';
- /** the column name for the CALENDAR_HOLIDAY_NAME field */
- const CALENDAR_HOLIDAY_NAME = 'CALENDAR_HOLIDAYS.CALENDAR_HOLIDAY_NAME';
+ /** the column name for the CALENDAR_HOLIDAY_NAME field */
+ const CALENDAR_HOLIDAY_NAME = 'CALENDAR_HOLIDAYS.CALENDAR_HOLIDAY_NAME';
- /** the column name for the CALENDAR_HOLIDAY_START field */
- const CALENDAR_HOLIDAY_START = 'CALENDAR_HOLIDAYS.CALENDAR_HOLIDAY_START';
+ /** the column name for the CALENDAR_HOLIDAY_START field */
+ const CALENDAR_HOLIDAY_START = 'CALENDAR_HOLIDAYS.CALENDAR_HOLIDAY_START';
- /** the column name for the CALENDAR_HOLIDAY_END field */
- const CALENDAR_HOLIDAY_END = 'CALENDAR_HOLIDAYS.CALENDAR_HOLIDAY_END';
+ /** the column name for the CALENDAR_HOLIDAY_END field */
+ const CALENDAR_HOLIDAY_END = 'CALENDAR_HOLIDAYS.CALENDAR_HOLIDAY_END';
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('CalendarUid', 'CalendarHolidayName', 'CalendarHolidayStart', 'CalendarHolidayEnd', ),
- BasePeer::TYPE_COLNAME => array (CalendarHolidaysPeer::CALENDAR_UID, CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, CalendarHolidaysPeer::CALENDAR_HOLIDAY_START, CalendarHolidaysPeer::CALENDAR_HOLIDAY_END, ),
- BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID', 'CALENDAR_HOLIDAY_NAME', 'CALENDAR_HOLIDAY_START', 'CALENDAR_HOLIDAY_END', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('CalendarUid', 'CalendarHolidayName', 'CalendarHolidayStart', 'CalendarHolidayEnd', ),
+ BasePeer::TYPE_COLNAME => array (CalendarHolidaysPeer::CALENDAR_UID, CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, CalendarHolidaysPeer::CALENDAR_HOLIDAY_START, CalendarHolidaysPeer::CALENDAR_HOLIDAY_END, ),
+ BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID', 'CALENDAR_HOLIDAY_NAME', 'CALENDAR_HOLIDAY_START', 'CALENDAR_HOLIDAY_END', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('CalendarUid' => 0, 'CalendarHolidayName' => 1, 'CalendarHolidayStart' => 2, 'CalendarHolidayEnd' => 3, ),
- BasePeer::TYPE_COLNAME => array (CalendarHolidaysPeer::CALENDAR_UID => 0, CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME => 1, CalendarHolidaysPeer::CALENDAR_HOLIDAY_START => 2, CalendarHolidaysPeer::CALENDAR_HOLIDAY_END => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID' => 0, 'CALENDAR_HOLIDAY_NAME' => 1, 'CALENDAR_HOLIDAY_START' => 2, 'CALENDAR_HOLIDAY_END' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('CalendarUid' => 0, 'CalendarHolidayName' => 1, 'CalendarHolidayStart' => 2, 'CalendarHolidayEnd' => 3, ),
+ BasePeer::TYPE_COLNAME => array (CalendarHolidaysPeer::CALENDAR_UID => 0, CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME => 1, CalendarHolidaysPeer::CALENDAR_HOLIDAY_START => 2, CalendarHolidaysPeer::CALENDAR_HOLIDAY_END => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('CALENDAR_UID' => 0, 'CALENDAR_HOLIDAY_NAME' => 1, 'CALENDAR_HOLIDAY_START' => 2, 'CALENDAR_HOLIDAY_END' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/CalendarHolidaysMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.CalendarHolidaysMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = CalendarHolidaysPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/CalendarHolidaysMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.CalendarHolidaysMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = CalendarHolidaysPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CalendarHolidaysPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CalendarHolidaysPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. CalendarHolidaysPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(CalendarHolidaysPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_UID);
+ $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_UID);
- $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME);
+ $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME);
- $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_START);
+ $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_START);
- $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_END);
+ $criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_END);
- }
+ }
- const COUNT = 'COUNT(CALENDAR_HOLIDAYS.CALENDAR_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_HOLIDAYS.CALENDAR_UID)';
+ const COUNT = 'COUNT(CALENDAR_HOLIDAYS.CALENDAR_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CALENDAR_HOLIDAYS.CALENDAR_UID)';
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(CalendarHolidaysPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(CalendarHolidaysPeer::COUNT);
- }
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(CalendarHolidaysPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(CalendarHolidaysPeer::COUNT);
+ }
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
- $rs = CalendarHolidaysPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return CalendarHolidays
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CalendarHolidaysPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return CalendarHolidaysPeer::populateObjects(CalendarHolidaysPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $rs = CalendarHolidaysPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return CalendarHolidays
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = CalendarHolidaysPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return CalendarHolidaysPeer::populateObjects(CalendarHolidaysPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- CalendarHolidaysPeer::addSelectColumns($criteria);
- }
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ CalendarHolidaysPeer::addSelectColumns($criteria);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CalendarHolidaysPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return CalendarHolidaysPeer::CLASS_DEFAULT;
- }
+ // set the class once to avoid overhead in the loop
+ $cls = CalendarHolidaysPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
- /**
- * Method perform an INSERT on the database, given a CalendarHolidays or Criteria object.
- *
- * @param mixed $values Criteria or CalendarHolidays object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CalendarHolidays object
- }
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return CalendarHolidaysPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a CalendarHolidays or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarHolidays object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from CalendarHolidays object
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
- return $pk;
- }
+ return $pk;
+ }
- /**
- * Method perform an UPDATE on the database, given a CalendarHolidays or Criteria object.
- *
- * @param mixed $values Criteria or CalendarHolidays object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Method perform an UPDATE on the database, given a CalendarHolidays or Criteria object.
+ *
+ * @param mixed $values Criteria or CalendarHolidays object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $selectCriteria = new Criteria(self::DATABASE_NAME);
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
- $comparison = $criteria->getComparison(CalendarHolidaysPeer::CALENDAR_UID);
- $selectCriteria->add(CalendarHolidaysPeer::CALENDAR_UID, $criteria->remove(CalendarHolidaysPeer::CALENDAR_UID), $comparison);
+ $comparison = $criteria->getComparison(CalendarHolidaysPeer::CALENDAR_UID);
+ $selectCriteria->add(CalendarHolidaysPeer::CALENDAR_UID, $criteria->remove(CalendarHolidaysPeer::CALENDAR_UID), $comparison);
- $comparison = $criteria->getComparison(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME);
- $selectCriteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $criteria->remove(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME), $comparison);
+ $comparison = $criteria->getComparison(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME);
+ $selectCriteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $criteria->remove(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME), $comparison);
- } else { // $values is CalendarHolidays object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
- /**
- * Method to DELETE all rows from the CALENDAR_HOLIDAYS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(CalendarHolidaysPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ /**
+ * Method to DELETE all rows from the CALENDAR_HOLIDAYS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(CalendarHolidaysPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- /**
- * Method perform a DELETE on the database, given a CalendarHolidays or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CalendarHolidays object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CalendarHolidaysPeer::DATABASE_NAME);
- }
+ /**
+ * Method perform a DELETE on the database, given a CalendarHolidays or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CalendarHolidays object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(CalendarHolidaysPeer::DATABASE_NAME);
+ }
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof CalendarHolidays) {
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof CalendarHolidays) {
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
- $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $vals[0], Criteria::IN);
- $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $vals[1], Criteria::IN);
- }
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $vals[0], Criteria::IN);
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $vals[1], Criteria::IN);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- $affectedRows = 0; // initialize var to track total num of affected rows
+ $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
- /**
- * Validates all modified columns of given CalendarHolidays object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CalendarHolidays $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(CalendarHolidays $obj, $cols = null)
- {
- $columns = array();
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CalendarHolidaysPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CalendarHolidaysPeer::TABLE_NAME);
+ /**
+ * Validates all modified columns of given CalendarHolidays object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param CalendarHolidays $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(CalendarHolidays $obj, $cols = null)
+ {
+ $columns = array();
- if (! is_array($cols)) {
- $cols = array($cols);
- }
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(CalendarHolidaysPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(CalendarHolidaysPeer::TABLE_NAME);
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
- }
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
- return BasePeer::doValidate(CalendarHolidaysPeer::DATABASE_NAME, CalendarHolidaysPeer::TABLE_NAME, $columns);
- }
+ }
- /**
- * Retrieve object using using composite pkey values.
- * @param string $calendar_uid
- @param string $calendar_holiday_name
-
- * @param Connection $con
- * @return CalendarHolidays
- */
- public static function retrieveByPK( $calendar_uid, $calendar_holiday_name, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $calendar_uid);
- $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $calendar_holiday_name);
- $v = CalendarHolidaysPeer::doSelect($criteria, $con);
+ return BasePeer::doValidate(CalendarHolidaysPeer::DATABASE_NAME, CalendarHolidaysPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $calendar_uid
+ * @param string $calendar_holiday_name
+ * @param Connection $con
+ * @return CalendarHolidays
+ */
+ public static function retrieveByPK($calendar_uid, $calendar_holiday_name, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $calendar_uid);
+ $criteria->add(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME, $calendar_holiday_name);
+ $v = CalendarHolidaysPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- return !empty($v) ? $v[0] : null;
- }
-} // BaseCalendarHolidaysPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseCalendarHolidaysPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseCalendarHolidaysPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/CalendarHolidaysMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.CalendarHolidaysMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/CalendarHolidaysMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.CalendarHolidaysMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseCaseScheduler.php b/workflow/engine/classes/model/om/BaseCaseScheduler.php
index 20440aa57..26d9f37f9 100755
--- a/workflow/engine/classes/model/om/BaseCaseScheduler.php
+++ b/workflow/engine/classes/model/om/BaseCaseScheduler.php
@@ -16,1871 +16,2007 @@ include_once 'classes/model/CaseSchedulerPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCaseScheduler extends BaseObject implements Persistent {
+abstract class BaseCaseScheduler extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var CaseSchedulerPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the sch_uid field.
+ * @var string
+ */
+ protected $sch_uid;
+
+ /**
+ * The value for the sch_del_user_name field.
+ * @var string
+ */
+ protected $sch_del_user_name;
+
+ /**
+ * The value for the sch_del_user_pass field.
+ * @var string
+ */
+ protected $sch_del_user_pass;
+
+ /**
+ * The value for the sch_del_user_uid field.
+ * @var string
+ */
+ protected $sch_del_user_uid;
+
+ /**
+ * The value for the sch_name field.
+ * @var string
+ */
+ protected $sch_name;
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the sch_time_next_run field.
+ * @var int
+ */
+ protected $sch_time_next_run;
+
+ /**
+ * The value for the sch_last_run_time field.
+ * @var int
+ */
+ protected $sch_last_run_time;
+
+ /**
+ * The value for the sch_state field.
+ * @var string
+ */
+ protected $sch_state = 'ACTIVE';
+
+ /**
+ * The value for the sch_last_state field.
+ * @var string
+ */
+ protected $sch_last_state = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the sch_option field.
+ * @var int
+ */
+ protected $sch_option = 0;
+
+ /**
+ * The value for the sch_start_time field.
+ * @var int
+ */
+ protected $sch_start_time;
+
+ /**
+ * The value for the sch_start_date field.
+ * @var int
+ */
+ protected $sch_start_date;
+
+ /**
+ * The value for the sch_days_perform_task field.
+ * @var string
+ */
+ protected $sch_days_perform_task = '';
+
+ /**
+ * The value for the sch_every_days field.
+ * @var int
+ */
+ protected $sch_every_days = 0;
+
+ /**
+ * The value for the sch_week_days field.
+ * @var string
+ */
+ protected $sch_week_days = '0|0|0|0|0|0|0';
+
+ /**
+ * The value for the sch_start_day field.
+ * @var string
+ */
+ protected $sch_start_day = '';
+
+ /**
+ * The value for the sch_months field.
+ * @var string
+ */
+ protected $sch_months = '0|0|0|0|0|0|0|0|0|0|0|0';
+
+ /**
+ * The value for the sch_end_date field.
+ * @var int
+ */
+ protected $sch_end_date;
+
+ /**
+ * The value for the sch_repeat_every field.
+ * @var string
+ */
+ protected $sch_repeat_every = '';
+
+ /**
+ * The value for the sch_repeat_until field.
+ * @var string
+ */
+ protected $sch_repeat_until = '';
+
+ /**
+ * The value for the sch_repeat_stop_if_running field.
+ * @var int
+ */
+ protected $sch_repeat_stop_if_running = 0;
+
+ /**
+ * The value for the case_sh_plugin_uid field.
+ * @var string
+ */
+ protected $case_sh_plugin_uid;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [sch_uid] column value.
+ *
+ * @return string
+ */
+ public function getSchUid()
+ {
+
+ return $this->sch_uid;
+ }
+
+ /**
+ * Get the [sch_del_user_name] column value.
+ *
+ * @return string
+ */
+ public function getSchDelUserName()
+ {
+
+ return $this->sch_del_user_name;
+ }
+
+ /**
+ * Get the [sch_del_user_pass] column value.
+ *
+ * @return string
+ */
+ public function getSchDelUserPass()
+ {
+
+ return $this->sch_del_user_pass;
+ }
+
+ /**
+ * Get the [sch_del_user_uid] column value.
+ *
+ * @return string
+ */
+ public function getSchDelUserUid()
+ {
+
+ return $this->sch_del_user_uid;
+ }
+
+ /**
+ * Get the [sch_name] column value.
+ *
+ * @return string
+ */
+ public function getSchName()
+ {
+
+ return $this->sch_name;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [optionally formatted] [sch_time_next_run] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getSchTimeNextRun($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->sch_time_next_run === null || $this->sch_time_next_run === '') {
+ return null;
+ } elseif (!is_int($this->sch_time_next_run)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->sch_time_next_run);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [sch_time_next_run] as date/time value: " .
+ var_export($this->sch_time_next_run, true));
+ }
+ } else {
+ $ts = $this->sch_time_next_run;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [sch_last_run_time] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getSchLastRunTime($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->sch_last_run_time === null || $this->sch_last_run_time === '') {
+ return null;
+ } elseif (!is_int($this->sch_last_run_time)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->sch_last_run_time);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [sch_last_run_time] as date/time value: " .
+ var_export($this->sch_last_run_time, true));
+ }
+ } else {
+ $ts = $this->sch_last_run_time;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [sch_state] column value.
+ *
+ * @return string
+ */
+ public function getSchState()
+ {
+
+ return $this->sch_state;
+ }
+
+ /**
+ * Get the [sch_last_state] column value.
+ *
+ * @return string
+ */
+ public function getSchLastState()
+ {
+
+ return $this->sch_last_state;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [sch_option] column value.
+ *
+ * @return int
+ */
+ public function getSchOption()
+ {
+
+ return $this->sch_option;
+ }
+
+ /**
+ * Get the [optionally formatted] [sch_start_time] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getSchStartTime($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->sch_start_time === null || $this->sch_start_time === '') {
+ return null;
+ } elseif (!is_int($this->sch_start_time)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->sch_start_time);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [sch_start_time] as date/time value: " .
+ var_export($this->sch_start_time, true));
+ }
+ } else {
+ $ts = $this->sch_start_time;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [sch_start_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getSchStartDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->sch_start_date === null || $this->sch_start_date === '') {
+ return null;
+ } elseif (!is_int($this->sch_start_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->sch_start_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [sch_start_date] as date/time value: " .
+ var_export($this->sch_start_date, true));
+ }
+ } else {
+ $ts = $this->sch_start_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [sch_days_perform_task] column value.
+ *
+ * @return string
+ */
+ public function getSchDaysPerformTask()
+ {
+
+ return $this->sch_days_perform_task;
+ }
+
+ /**
+ * Get the [sch_every_days] column value.
+ *
+ * @return int
+ */
+ public function getSchEveryDays()
+ {
+
+ return $this->sch_every_days;
+ }
+
+ /**
+ * Get the [sch_week_days] column value.
+ *
+ * @return string
+ */
+ public function getSchWeekDays()
+ {
+
+ return $this->sch_week_days;
+ }
+
+ /**
+ * Get the [sch_start_day] column value.
+ *
+ * @return string
+ */
+ public function getSchStartDay()
+ {
+
+ return $this->sch_start_day;
+ }
+
+ /**
+ * Get the [sch_months] column value.
+ *
+ * @return string
+ */
+ public function getSchMonths()
+ {
+
+ return $this->sch_months;
+ }
+
+ /**
+ * Get the [optionally formatted] [sch_end_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getSchEndDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->sch_end_date === null || $this->sch_end_date === '') {
+ return null;
+ } elseif (!is_int($this->sch_end_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->sch_end_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [sch_end_date] as date/time value: " .
+ var_export($this->sch_end_date, true));
+ }
+ } else {
+ $ts = $this->sch_end_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [sch_repeat_every] column value.
+ *
+ * @return string
+ */
+ public function getSchRepeatEvery()
+ {
+
+ return $this->sch_repeat_every;
+ }
+
+ /**
+ * Get the [sch_repeat_until] column value.
+ *
+ * @return string
+ */
+ public function getSchRepeatUntil()
+ {
+
+ return $this->sch_repeat_until;
+ }
+
+ /**
+ * Get the [sch_repeat_stop_if_running] column value.
+ *
+ * @return int
+ */
+ public function getSchRepeatStopIfRunning()
+ {
+
+ return $this->sch_repeat_stop_if_running;
+ }
+
+ /**
+ * Get the [case_sh_plugin_uid] column value.
+ *
+ * @return string
+ */
+ public function getCaseShPluginUid()
+ {
+
+ return $this->case_sh_plugin_uid;
+ }
+
+ /**
+ * Set the value of [sch_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_uid !== $v) {
+ $this->sch_uid = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_UID;
+ }
+
+ } // setSchUid()
+
+ /**
+ * Set the value of [sch_del_user_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchDelUserName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_del_user_name !== $v) {
+ $this->sch_del_user_name = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DEL_USER_NAME;
+ }
+
+ } // setSchDelUserName()
+
+ /**
+ * Set the value of [sch_del_user_pass] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchDelUserPass($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_del_user_pass !== $v) {
+ $this->sch_del_user_pass = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DEL_USER_PASS;
+ }
+
+ } // setSchDelUserPass()
+
+ /**
+ * Set the value of [sch_del_user_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchDelUserUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_del_user_uid !== $v) {
+ $this->sch_del_user_uid = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DEL_USER_UID;
+ }
+
+ } // setSchDelUserUid()
+
+ /**
+ * Set the value of [sch_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_name !== $v) {
+ $this->sch_name = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_NAME;
+ }
+
+ } // setSchName()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [sch_time_next_run] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchTimeNextRun($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [sch_time_next_run] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->sch_time_next_run !== $ts) {
+ $this->sch_time_next_run = $ts;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_TIME_NEXT_RUN;
+ }
+
+ } // setSchTimeNextRun()
+
+ /**
+ * Set the value of [sch_last_run_time] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchLastRunTime($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [sch_last_run_time] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->sch_last_run_time !== $ts) {
+ $this->sch_last_run_time = $ts;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_LAST_RUN_TIME;
+ }
+
+ } // setSchLastRunTime()
+
+ /**
+ * Set the value of [sch_state] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchState($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_state !== $v || $v === 'ACTIVE') {
+ $this->sch_state = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_STATE;
+ }
+
+ } // setSchState()
+
+ /**
+ * Set the value of [sch_last_state] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchLastState($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_last_state !== $v || $v === '') {
+ $this->sch_last_state = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_LAST_STATE;
+ }
+
+ } // setSchLastState()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [sch_option] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchOption($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->sch_option !== $v || $v === 0) {
+ $this->sch_option = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_OPTION;
+ }
+
+ } // setSchOption()
+
+ /**
+ * Set the value of [sch_start_time] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchStartTime($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [sch_start_time] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->sch_start_time !== $ts) {
+ $this->sch_start_time = $ts;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_START_TIME;
+ }
+
+ } // setSchStartTime()
+
+ /**
+ * Set the value of [sch_start_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchStartDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [sch_start_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->sch_start_date !== $ts) {
+ $this->sch_start_date = $ts;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_START_DATE;
+ }
+
+ } // setSchStartDate()
+
+ /**
+ * Set the value of [sch_days_perform_task] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchDaysPerformTask($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_days_perform_task !== $v || $v === '') {
+ $this->sch_days_perform_task = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK;
+ }
+
+ } // setSchDaysPerformTask()
+
+ /**
+ * Set the value of [sch_every_days] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchEveryDays($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->sch_every_days !== $v || $v === 0) {
+ $this->sch_every_days = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_EVERY_DAYS;
+ }
+
+ } // setSchEveryDays()
+
+ /**
+ * Set the value of [sch_week_days] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchWeekDays($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_week_days !== $v || $v === '0|0|0|0|0|0|0') {
+ $this->sch_week_days = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_WEEK_DAYS;
+ }
+
+ } // setSchWeekDays()
+
+ /**
+ * Set the value of [sch_start_day] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchStartDay($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_start_day !== $v || $v === '') {
+ $this->sch_start_day = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_START_DAY;
+ }
+
+ } // setSchStartDay()
+
+ /**
+ * Set the value of [sch_months] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchMonths($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_months !== $v || $v === '0|0|0|0|0|0|0|0|0|0|0|0') {
+ $this->sch_months = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_MONTHS;
+ }
+
+ } // setSchMonths()
+
+ /**
+ * Set the value of [sch_end_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchEndDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [sch_end_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->sch_end_date !== $ts) {
+ $this->sch_end_date = $ts;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_END_DATE;
+ }
+
+ } // setSchEndDate()
+
+ /**
+ * Set the value of [sch_repeat_every] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchRepeatEvery($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_repeat_every !== $v || $v === '') {
+ $this->sch_repeat_every = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_REPEAT_EVERY;
+ }
+
+ } // setSchRepeatEvery()
+
+ /**
+ * Set the value of [sch_repeat_until] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchRepeatUntil($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_repeat_until !== $v || $v === '') {
+ $this->sch_repeat_until = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_REPEAT_UNTIL;
+ }
+
+ } // setSchRepeatUntil()
+
+ /**
+ * Set the value of [sch_repeat_stop_if_running] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSchRepeatStopIfRunning($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->sch_repeat_stop_if_running !== $v || $v === 0) {
+ $this->sch_repeat_stop_if_running = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING;
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var CaseSchedulerPeer
- */
- protected static $peer;
+ } // setSchRepeatStopIfRunning()
+ /**
+ * Set the value of [case_sh_plugin_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCaseShPluginUid($v)
+ {
- /**
- * The value for the sch_uid field.
- * @var string
- */
- protected $sch_uid;
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->case_sh_plugin_uid !== $v) {
+ $this->case_sh_plugin_uid = $v;
+ $this->modifiedColumns[] = CaseSchedulerPeer::CASE_SH_PLUGIN_UID;
+ }
+ } // setCaseShPluginUid()
- /**
- * The value for the sch_del_user_name field.
- * @var string
- */
- protected $sch_del_user_name;
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->sch_uid = $rs->getString($startcol + 0);
+
+ $this->sch_del_user_name = $rs->getString($startcol + 1);
+
+ $this->sch_del_user_pass = $rs->getString($startcol + 2);
+
+ $this->sch_del_user_uid = $rs->getString($startcol + 3);
+
+ $this->sch_name = $rs->getString($startcol + 4);
+
+ $this->pro_uid = $rs->getString($startcol + 5);
+
+ $this->tas_uid = $rs->getString($startcol + 6);
+
+ $this->sch_time_next_run = $rs->getTimestamp($startcol + 7, null);
+
+ $this->sch_last_run_time = $rs->getTimestamp($startcol + 8, null);
+
+ $this->sch_state = $rs->getString($startcol + 9);
+
+ $this->sch_last_state = $rs->getString($startcol + 10);
+
+ $this->usr_uid = $rs->getString($startcol + 11);
+
+ $this->sch_option = $rs->getInt($startcol + 12);
+
+ $this->sch_start_time = $rs->getTimestamp($startcol + 13, null);
+
+ $this->sch_start_date = $rs->getTimestamp($startcol + 14, null);
+
+ $this->sch_days_perform_task = $rs->getString($startcol + 15);
+
+ $this->sch_every_days = $rs->getInt($startcol + 16);
+
+ $this->sch_week_days = $rs->getString($startcol + 17);
+
+ $this->sch_start_day = $rs->getString($startcol + 18);
+
+ $this->sch_months = $rs->getString($startcol + 19);
+
+ $this->sch_end_date = $rs->getTimestamp($startcol + 20, null);
+
+ $this->sch_repeat_every = $rs->getString($startcol + 21);
+
+ $this->sch_repeat_until = $rs->getString($startcol + 22);
+
+ $this->sch_repeat_stop_if_running = $rs->getInt($startcol + 23);
+
+ $this->case_sh_plugin_uid = $rs->getString($startcol + 24);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 25; // 25 = CaseSchedulerPeer::NUM_COLUMNS - CaseSchedulerPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating CaseScheduler object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CaseSchedulerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ CaseSchedulerPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CaseSchedulerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = CaseSchedulerPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += CaseSchedulerPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = CaseSchedulerPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CaseSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getSchUid();
+ break;
+ case 1:
+ return $this->getSchDelUserName();
+ break;
+ case 2:
+ return $this->getSchDelUserPass();
+ break;
+ case 3:
+ return $this->getSchDelUserUid();
+ break;
+ case 4:
+ return $this->getSchName();
+ break;
+ case 5:
+ return $this->getProUid();
+ break;
+ case 6:
+ return $this->getTasUid();
+ break;
+ case 7:
+ return $this->getSchTimeNextRun();
+ break;
+ case 8:
+ return $this->getSchLastRunTime();
+ break;
+ case 9:
+ return $this->getSchState();
+ break;
+ case 10:
+ return $this->getSchLastState();
+ break;
+ case 11:
+ return $this->getUsrUid();
+ break;
+ case 12:
+ return $this->getSchOption();
+ break;
+ case 13:
+ return $this->getSchStartTime();
+ break;
+ case 14:
+ return $this->getSchStartDate();
+ break;
+ case 15:
+ return $this->getSchDaysPerformTask();
+ break;
+ case 16:
+ return $this->getSchEveryDays();
+ break;
+ case 17:
+ return $this->getSchWeekDays();
+ break;
+ case 18:
+ return $this->getSchStartDay();
+ break;
+ case 19:
+ return $this->getSchMonths();
+ break;
+ case 20:
+ return $this->getSchEndDate();
+ break;
+ case 21:
+ return $this->getSchRepeatEvery();
+ break;
+ case 22:
+ return $this->getSchRepeatUntil();
+ break;
+ case 23:
+ return $this->getSchRepeatStopIfRunning();
+ break;
+ case 24:
+ return $this->getCaseShPluginUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CaseSchedulerPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getSchUid(),
+ $keys[1] => $this->getSchDelUserName(),
+ $keys[2] => $this->getSchDelUserPass(),
+ $keys[3] => $this->getSchDelUserUid(),
+ $keys[4] => $this->getSchName(),
+ $keys[5] => $this->getProUid(),
+ $keys[6] => $this->getTasUid(),
+ $keys[7] => $this->getSchTimeNextRun(),
+ $keys[8] => $this->getSchLastRunTime(),
+ $keys[9] => $this->getSchState(),
+ $keys[10] => $this->getSchLastState(),
+ $keys[11] => $this->getUsrUid(),
+ $keys[12] => $this->getSchOption(),
+ $keys[13] => $this->getSchStartTime(),
+ $keys[14] => $this->getSchStartDate(),
+ $keys[15] => $this->getSchDaysPerformTask(),
+ $keys[16] => $this->getSchEveryDays(),
+ $keys[17] => $this->getSchWeekDays(),
+ $keys[18] => $this->getSchStartDay(),
+ $keys[19] => $this->getSchMonths(),
+ $keys[20] => $this->getSchEndDate(),
+ $keys[21] => $this->getSchRepeatEvery(),
+ $keys[22] => $this->getSchRepeatUntil(),
+ $keys[23] => $this->getSchRepeatStopIfRunning(),
+ $keys[24] => $this->getCaseShPluginUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CaseSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setSchUid($value);
+ break;
+ case 1:
+ $this->setSchDelUserName($value);
+ break;
+ case 2:
+ $this->setSchDelUserPass($value);
+ break;
+ case 3:
+ $this->setSchDelUserUid($value);
+ break;
+ case 4:
+ $this->setSchName($value);
+ break;
+ case 5:
+ $this->setProUid($value);
+ break;
+ case 6:
+ $this->setTasUid($value);
+ break;
+ case 7:
+ $this->setSchTimeNextRun($value);
+ break;
+ case 8:
+ $this->setSchLastRunTime($value);
+ break;
+ case 9:
+ $this->setSchState($value);
+ break;
+ case 10:
+ $this->setSchLastState($value);
+ break;
+ case 11:
+ $this->setUsrUid($value);
+ break;
+ case 12:
+ $this->setSchOption($value);
+ break;
+ case 13:
+ $this->setSchStartTime($value);
+ break;
+ case 14:
+ $this->setSchStartDate($value);
+ break;
+ case 15:
+ $this->setSchDaysPerformTask($value);
+ break;
+ case 16:
+ $this->setSchEveryDays($value);
+ break;
+ case 17:
+ $this->setSchWeekDays($value);
+ break;
+ case 18:
+ $this->setSchStartDay($value);
+ break;
+ case 19:
+ $this->setSchMonths($value);
+ break;
+ case 20:
+ $this->setSchEndDate($value);
+ break;
+ case 21:
+ $this->setSchRepeatEvery($value);
+ break;
+ case 22:
+ $this->setSchRepeatUntil($value);
+ break;
+ case 23:
+ $this->setSchRepeatStopIfRunning($value);
+ break;
+ case 24:
+ $this->setCaseShPluginUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CaseSchedulerPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setSchUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setSchDelUserName($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setSchDelUserPass($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setSchDelUserUid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setSchName($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setProUid($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setTasUid($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setSchTimeNextRun($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setSchLastRunTime($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setSchState($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setSchLastState($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setUsrUid($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setSchOption($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setSchStartTime($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setSchStartDate($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setSchDaysPerformTask($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setSchEveryDays($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setSchWeekDays($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setSchStartDay($arr[$keys[18]]);
+ }
+
+ if (array_key_exists($keys[19], $arr)) {
+ $this->setSchMonths($arr[$keys[19]]);
+ }
+
+ if (array_key_exists($keys[20], $arr)) {
+ $this->setSchEndDate($arr[$keys[20]]);
+ }
+
+ if (array_key_exists($keys[21], $arr)) {
+ $this->setSchRepeatEvery($arr[$keys[21]]);
+ }
+
+ if (array_key_exists($keys[22], $arr)) {
+ $this->setSchRepeatUntil($arr[$keys[22]]);
+ }
+
+ if (array_key_exists($keys[23], $arr)) {
+ $this->setSchRepeatStopIfRunning($arr[$keys[23]]);
+ }
+
+ if (array_key_exists($keys[24], $arr)) {
+ $this->setCaseShPluginUid($arr[$keys[24]]);
+ }
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CaseSchedulerPeer::DATABASE_NAME);
- /**
- * The value for the sch_del_user_pass field.
- * @var string
- */
- protected $sch_del_user_pass;
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_UID)) {
+ $criteria->add(CaseSchedulerPeer::SCH_UID, $this->sch_uid);
+ }
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_DEL_USER_NAME)) {
+ $criteria->add(CaseSchedulerPeer::SCH_DEL_USER_NAME, $this->sch_del_user_name);
+ }
- /**
- * The value for the sch_del_user_uid field.
- * @var string
- */
- protected $sch_del_user_uid;
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_DEL_USER_PASS)) {
+ $criteria->add(CaseSchedulerPeer::SCH_DEL_USER_PASS, $this->sch_del_user_pass);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_DEL_USER_UID)) {
+ $criteria->add(CaseSchedulerPeer::SCH_DEL_USER_UID, $this->sch_del_user_uid);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_NAME)) {
+ $criteria->add(CaseSchedulerPeer::SCH_NAME, $this->sch_name);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::PRO_UID)) {
+ $criteria->add(CaseSchedulerPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::TAS_UID)) {
+ $criteria->add(CaseSchedulerPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_TIME_NEXT_RUN)) {
+ $criteria->add(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $this->sch_time_next_run);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_LAST_RUN_TIME)) {
+ $criteria->add(CaseSchedulerPeer::SCH_LAST_RUN_TIME, $this->sch_last_run_time);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_STATE)) {
+ $criteria->add(CaseSchedulerPeer::SCH_STATE, $this->sch_state);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_LAST_STATE)) {
+ $criteria->add(CaseSchedulerPeer::SCH_LAST_STATE, $this->sch_last_state);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::USR_UID)) {
+ $criteria->add(CaseSchedulerPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_OPTION)) {
+ $criteria->add(CaseSchedulerPeer::SCH_OPTION, $this->sch_option);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_START_TIME)) {
+ $criteria->add(CaseSchedulerPeer::SCH_START_TIME, $this->sch_start_time);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_START_DATE)) {
+ $criteria->add(CaseSchedulerPeer::SCH_START_DATE, $this->sch_start_date);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK)) {
+ $criteria->add(CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK, $this->sch_days_perform_task);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_EVERY_DAYS)) {
+ $criteria->add(CaseSchedulerPeer::SCH_EVERY_DAYS, $this->sch_every_days);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_WEEK_DAYS)) {
+ $criteria->add(CaseSchedulerPeer::SCH_WEEK_DAYS, $this->sch_week_days);
+ }
+
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_START_DAY)) {
+ $criteria->add(CaseSchedulerPeer::SCH_START_DAY, $this->sch_start_day);
+ }
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_MONTHS)) {
+ $criteria->add(CaseSchedulerPeer::SCH_MONTHS, $this->sch_months);
+ }
- /**
- * The value for the sch_name field.
- * @var string
- */
- protected $sch_name;
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_END_DATE)) {
+ $criteria->add(CaseSchedulerPeer::SCH_END_DATE, $this->sch_end_date);
+ }
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_REPEAT_EVERY)) {
+ $criteria->add(CaseSchedulerPeer::SCH_REPEAT_EVERY, $this->sch_repeat_every);
+ }
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_REPEAT_UNTIL)) {
+ $criteria->add(CaseSchedulerPeer::SCH_REPEAT_UNTIL, $this->sch_repeat_until);
+ }
+ if ($this->isColumnModified(CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING)) {
+ $criteria->add(CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING, $this->sch_repeat_stop_if_running);
+ }
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
+ if ($this->isColumnModified(CaseSchedulerPeer::CASE_SH_PLUGIN_UID)) {
+ $criteria->add(CaseSchedulerPeer::CASE_SH_PLUGIN_UID, $this->case_sh_plugin_uid);
+ }
- /**
- * The value for the sch_time_next_run field.
- * @var int
- */
- protected $sch_time_next_run;
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CaseSchedulerPeer::DATABASE_NAME);
- /**
- * The value for the sch_last_run_time field.
- * @var int
- */
- protected $sch_last_run_time;
+ $criteria->add(CaseSchedulerPeer::SCH_UID, $this->sch_uid);
+ return $criteria;
+ }
- /**
- * The value for the sch_state field.
- * @var string
- */
- protected $sch_state = 'ACTIVE';
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getSchUid();
+ }
+ /**
+ * Generic method to set the primary key (sch_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setSchUid($key);
+ }
- /**
- * The value for the sch_last_state field.
- * @var string
- */
- protected $sch_last_state = '';
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of CaseScheduler (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+ $copyObj->setSchDelUserName($this->sch_del_user_name);
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
+ $copyObj->setSchDelUserPass($this->sch_del_user_pass);
+ $copyObj->setSchDelUserUid($this->sch_del_user_uid);
- /**
- * The value for the sch_option field.
- * @var int
- */
- protected $sch_option = 0;
+ $copyObj->setSchName($this->sch_name);
+ $copyObj->setProUid($this->pro_uid);
- /**
- * The value for the sch_start_time field.
- * @var int
- */
- protected $sch_start_time;
+ $copyObj->setTasUid($this->tas_uid);
+ $copyObj->setSchTimeNextRun($this->sch_time_next_run);
- /**
- * The value for the sch_start_date field.
- * @var int
- */
- protected $sch_start_date;
+ $copyObj->setSchLastRunTime($this->sch_last_run_time);
+ $copyObj->setSchState($this->sch_state);
- /**
- * The value for the sch_days_perform_task field.
- * @var string
- */
- protected $sch_days_perform_task = '';
+ $copyObj->setSchLastState($this->sch_last_state);
+ $copyObj->setUsrUid($this->usr_uid);
- /**
- * The value for the sch_every_days field.
- * @var int
- */
- protected $sch_every_days = 0;
+ $copyObj->setSchOption($this->sch_option);
+ $copyObj->setSchStartTime($this->sch_start_time);
- /**
- * The value for the sch_week_days field.
- * @var string
- */
- protected $sch_week_days = '0|0|0|0|0|0|0';
+ $copyObj->setSchStartDate($this->sch_start_date);
+ $copyObj->setSchDaysPerformTask($this->sch_days_perform_task);
- /**
- * The value for the sch_start_day field.
- * @var string
- */
- protected $sch_start_day = '';
+ $copyObj->setSchEveryDays($this->sch_every_days);
+ $copyObj->setSchWeekDays($this->sch_week_days);
- /**
- * The value for the sch_months field.
- * @var string
- */
- protected $sch_months = '0|0|0|0|0|0|0|0|0|0|0|0';
-
+ $copyObj->setSchStartDay($this->sch_start_day);
- /**
- * The value for the sch_end_date field.
- * @var int
- */
- protected $sch_end_date;
-
-
- /**
- * The value for the sch_repeat_every field.
- * @var string
- */
- protected $sch_repeat_every = '';
-
-
- /**
- * The value for the sch_repeat_until field.
- * @var string
- */
- protected $sch_repeat_until = '';
-
-
- /**
- * The value for the sch_repeat_stop_if_running field.
- * @var int
- */
- protected $sch_repeat_stop_if_running = 0;
-
-
- /**
- * The value for the case_sh_plugin_uid field.
- * @var string
- */
- protected $case_sh_plugin_uid;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [sch_uid] column value.
- *
- * @return string
- */
- public function getSchUid()
- {
-
- return $this->sch_uid;
- }
-
- /**
- * Get the [sch_del_user_name] column value.
- *
- * @return string
- */
- public function getSchDelUserName()
- {
-
- return $this->sch_del_user_name;
- }
-
- /**
- * Get the [sch_del_user_pass] column value.
- *
- * @return string
- */
- public function getSchDelUserPass()
- {
-
- return $this->sch_del_user_pass;
- }
-
- /**
- * Get the [sch_del_user_uid] column value.
- *
- * @return string
- */
- public function getSchDelUserUid()
- {
-
- return $this->sch_del_user_uid;
- }
-
- /**
- * Get the [sch_name] column value.
- *
- * @return string
- */
- public function getSchName()
- {
-
- return $this->sch_name;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [optionally formatted] [sch_time_next_run] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getSchTimeNextRun($format = 'Y-m-d H:i:s')
- {
-
- if ($this->sch_time_next_run === null || $this->sch_time_next_run === '') {
- return null;
- } elseif (!is_int($this->sch_time_next_run)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->sch_time_next_run);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [sch_time_next_run] as date/time value: " . var_export($this->sch_time_next_run, true));
- }
- } else {
- $ts = $this->sch_time_next_run;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [sch_last_run_time] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getSchLastRunTime($format = 'Y-m-d H:i:s')
- {
-
- if ($this->sch_last_run_time === null || $this->sch_last_run_time === '') {
- return null;
- } elseif (!is_int($this->sch_last_run_time)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->sch_last_run_time);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [sch_last_run_time] as date/time value: " . var_export($this->sch_last_run_time, true));
- }
- } else {
- $ts = $this->sch_last_run_time;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [sch_state] column value.
- *
- * @return string
- */
- public function getSchState()
- {
-
- return $this->sch_state;
- }
-
- /**
- * Get the [sch_last_state] column value.
- *
- * @return string
- */
- public function getSchLastState()
- {
-
- return $this->sch_last_state;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [sch_option] column value.
- *
- * @return int
- */
- public function getSchOption()
- {
-
- return $this->sch_option;
- }
-
- /**
- * Get the [optionally formatted] [sch_start_time] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getSchStartTime($format = 'Y-m-d H:i:s')
- {
-
- if ($this->sch_start_time === null || $this->sch_start_time === '') {
- return null;
- } elseif (!is_int($this->sch_start_time)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->sch_start_time);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [sch_start_time] as date/time value: " . var_export($this->sch_start_time, true));
- }
- } else {
- $ts = $this->sch_start_time;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [sch_start_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getSchStartDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->sch_start_date === null || $this->sch_start_date === '') {
- return null;
- } elseif (!is_int($this->sch_start_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->sch_start_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [sch_start_date] as date/time value: " . var_export($this->sch_start_date, true));
- }
- } else {
- $ts = $this->sch_start_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [sch_days_perform_task] column value.
- *
- * @return string
- */
- public function getSchDaysPerformTask()
- {
-
- return $this->sch_days_perform_task;
- }
-
- /**
- * Get the [sch_every_days] column value.
- *
- * @return int
- */
- public function getSchEveryDays()
- {
-
- return $this->sch_every_days;
- }
-
- /**
- * Get the [sch_week_days] column value.
- *
- * @return string
- */
- public function getSchWeekDays()
- {
-
- return $this->sch_week_days;
- }
-
- /**
- * Get the [sch_start_day] column value.
- *
- * @return string
- */
- public function getSchStartDay()
- {
-
- return $this->sch_start_day;
- }
-
- /**
- * Get the [sch_months] column value.
- *
- * @return string
- */
- public function getSchMonths()
- {
-
- return $this->sch_months;
- }
-
- /**
- * Get the [optionally formatted] [sch_end_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getSchEndDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->sch_end_date === null || $this->sch_end_date === '') {
- return null;
- } elseif (!is_int($this->sch_end_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->sch_end_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [sch_end_date] as date/time value: " . var_export($this->sch_end_date, true));
- }
- } else {
- $ts = $this->sch_end_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [sch_repeat_every] column value.
- *
- * @return string
- */
- public function getSchRepeatEvery()
- {
-
- return $this->sch_repeat_every;
- }
-
- /**
- * Get the [sch_repeat_until] column value.
- *
- * @return string
- */
- public function getSchRepeatUntil()
- {
-
- return $this->sch_repeat_until;
- }
-
- /**
- * Get the [sch_repeat_stop_if_running] column value.
- *
- * @return int
- */
- public function getSchRepeatStopIfRunning()
- {
-
- return $this->sch_repeat_stop_if_running;
- }
-
- /**
- * Get the [case_sh_plugin_uid] column value.
- *
- * @return string
- */
- public function getCaseShPluginUid()
- {
-
- return $this->case_sh_plugin_uid;
- }
-
- /**
- * Set the value of [sch_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_uid !== $v) {
- $this->sch_uid = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_UID;
- }
-
- } // setSchUid()
-
- /**
- * Set the value of [sch_del_user_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchDelUserName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_del_user_name !== $v) {
- $this->sch_del_user_name = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DEL_USER_NAME;
- }
-
- } // setSchDelUserName()
-
- /**
- * Set the value of [sch_del_user_pass] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchDelUserPass($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_del_user_pass !== $v) {
- $this->sch_del_user_pass = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DEL_USER_PASS;
- }
-
- } // setSchDelUserPass()
-
- /**
- * Set the value of [sch_del_user_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchDelUserUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_del_user_uid !== $v) {
- $this->sch_del_user_uid = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DEL_USER_UID;
- }
-
- } // setSchDelUserUid()
-
- /**
- * Set the value of [sch_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_name !== $v) {
- $this->sch_name = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_NAME;
- }
-
- } // setSchName()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [sch_time_next_run] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchTimeNextRun($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [sch_time_next_run] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->sch_time_next_run !== $ts) {
- $this->sch_time_next_run = $ts;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_TIME_NEXT_RUN;
- }
-
- } // setSchTimeNextRun()
-
- /**
- * Set the value of [sch_last_run_time] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchLastRunTime($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [sch_last_run_time] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->sch_last_run_time !== $ts) {
- $this->sch_last_run_time = $ts;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_LAST_RUN_TIME;
- }
-
- } // setSchLastRunTime()
-
- /**
- * Set the value of [sch_state] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchState($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_state !== $v || $v === 'ACTIVE') {
- $this->sch_state = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_STATE;
- }
-
- } // setSchState()
-
- /**
- * Set the value of [sch_last_state] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchLastState($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_last_state !== $v || $v === '') {
- $this->sch_last_state = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_LAST_STATE;
- }
-
- } // setSchLastState()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [sch_option] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchOption($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->sch_option !== $v || $v === 0) {
- $this->sch_option = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_OPTION;
- }
-
- } // setSchOption()
-
- /**
- * Set the value of [sch_start_time] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchStartTime($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [sch_start_time] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->sch_start_time !== $ts) {
- $this->sch_start_time = $ts;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_START_TIME;
- }
-
- } // setSchStartTime()
-
- /**
- * Set the value of [sch_start_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchStartDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [sch_start_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->sch_start_date !== $ts) {
- $this->sch_start_date = $ts;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_START_DATE;
- }
-
- } // setSchStartDate()
-
- /**
- * Set the value of [sch_days_perform_task] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchDaysPerformTask($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_days_perform_task !== $v || $v === '') {
- $this->sch_days_perform_task = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK;
- }
-
- } // setSchDaysPerformTask()
-
- /**
- * Set the value of [sch_every_days] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchEveryDays($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->sch_every_days !== $v || $v === 0) {
- $this->sch_every_days = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_EVERY_DAYS;
- }
-
- } // setSchEveryDays()
-
- /**
- * Set the value of [sch_week_days] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchWeekDays($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_week_days !== $v || $v === '0|0|0|0|0|0|0') {
- $this->sch_week_days = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_WEEK_DAYS;
- }
-
- } // setSchWeekDays()
-
- /**
- * Set the value of [sch_start_day] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchStartDay($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_start_day !== $v || $v === '') {
- $this->sch_start_day = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_START_DAY;
- }
-
- } // setSchStartDay()
-
- /**
- * Set the value of [sch_months] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchMonths($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_months !== $v || $v === '0|0|0|0|0|0|0|0|0|0|0|0') {
- $this->sch_months = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_MONTHS;
- }
-
- } // setSchMonths()
-
- /**
- * Set the value of [sch_end_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchEndDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [sch_end_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->sch_end_date !== $ts) {
- $this->sch_end_date = $ts;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_END_DATE;
- }
-
- } // setSchEndDate()
-
- /**
- * Set the value of [sch_repeat_every] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchRepeatEvery($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_repeat_every !== $v || $v === '') {
- $this->sch_repeat_every = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_REPEAT_EVERY;
- }
-
- } // setSchRepeatEvery()
-
- /**
- * Set the value of [sch_repeat_until] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchRepeatUntil($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_repeat_until !== $v || $v === '') {
- $this->sch_repeat_until = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_REPEAT_UNTIL;
- }
-
- } // setSchRepeatUntil()
-
- /**
- * Set the value of [sch_repeat_stop_if_running] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSchRepeatStopIfRunning($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;
- }
+ $copyObj->setSchMonths($this->sch_months);
- if ($this->sch_repeat_stop_if_running !== $v || $v === 0) {
- $this->sch_repeat_stop_if_running = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING;
- }
+ $copyObj->setSchEndDate($this->sch_end_date);
- } // setSchRepeatStopIfRunning()
+ $copyObj->setSchRepeatEvery($this->sch_repeat_every);
- /**
- * Set the value of [case_sh_plugin_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCaseShPluginUid($v)
- {
+ $copyObj->setSchRepeatUntil($this->sch_repeat_until);
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->case_sh_plugin_uid !== $v) {
- $this->case_sh_plugin_uid = $v;
- $this->modifiedColumns[] = CaseSchedulerPeer::CASE_SH_PLUGIN_UID;
- }
+ $copyObj->setSchRepeatStopIfRunning($this->sch_repeat_stop_if_running);
- } // setCaseShPluginUid()
+ $copyObj->setCaseShPluginUid($this->case_sh_plugin_uid);
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->sch_uid = $rs->getString($startcol + 0);
-
- $this->sch_del_user_name = $rs->getString($startcol + 1);
-
- $this->sch_del_user_pass = $rs->getString($startcol + 2);
-
- $this->sch_del_user_uid = $rs->getString($startcol + 3);
-
- $this->sch_name = $rs->getString($startcol + 4);
-
- $this->pro_uid = $rs->getString($startcol + 5);
-
- $this->tas_uid = $rs->getString($startcol + 6);
-
- $this->sch_time_next_run = $rs->getTimestamp($startcol + 7, null);
-
- $this->sch_last_run_time = $rs->getTimestamp($startcol + 8, null);
-
- $this->sch_state = $rs->getString($startcol + 9);
-
- $this->sch_last_state = $rs->getString($startcol + 10);
-
- $this->usr_uid = $rs->getString($startcol + 11);
-
- $this->sch_option = $rs->getInt($startcol + 12);
-
- $this->sch_start_time = $rs->getTimestamp($startcol + 13, null);
-
- $this->sch_start_date = $rs->getTimestamp($startcol + 14, null);
-
- $this->sch_days_perform_task = $rs->getString($startcol + 15);
-
- $this->sch_every_days = $rs->getInt($startcol + 16);
-
- $this->sch_week_days = $rs->getString($startcol + 17);
-
- $this->sch_start_day = $rs->getString($startcol + 18);
-
- $this->sch_months = $rs->getString($startcol + 19);
-
- $this->sch_end_date = $rs->getTimestamp($startcol + 20, null);
-
- $this->sch_repeat_every = $rs->getString($startcol + 21);
-
- $this->sch_repeat_until = $rs->getString($startcol + 22);
-
- $this->sch_repeat_stop_if_running = $rs->getInt($startcol + 23);
-
- $this->case_sh_plugin_uid = $rs->getString($startcol + 24);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 25; // 25 = CaseSchedulerPeer::NUM_COLUMNS - CaseSchedulerPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CaseScheduler object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CaseSchedulerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- CaseSchedulerPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CaseSchedulerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = CaseSchedulerPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += CaseSchedulerPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CaseSchedulerPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CaseSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getSchUid();
- break;
- case 1:
- return $this->getSchDelUserName();
- break;
- case 2:
- return $this->getSchDelUserPass();
- break;
- case 3:
- return $this->getSchDelUserUid();
- break;
- case 4:
- return $this->getSchName();
- break;
- case 5:
- return $this->getProUid();
- break;
- case 6:
- return $this->getTasUid();
- break;
- case 7:
- return $this->getSchTimeNextRun();
- break;
- case 8:
- return $this->getSchLastRunTime();
- break;
- case 9:
- return $this->getSchState();
- break;
- case 10:
- return $this->getSchLastState();
- break;
- case 11:
- return $this->getUsrUid();
- break;
- case 12:
- return $this->getSchOption();
- break;
- case 13:
- return $this->getSchStartTime();
- break;
- case 14:
- return $this->getSchStartDate();
- break;
- case 15:
- return $this->getSchDaysPerformTask();
- break;
- case 16:
- return $this->getSchEveryDays();
- break;
- case 17:
- return $this->getSchWeekDays();
- break;
- case 18:
- return $this->getSchStartDay();
- break;
- case 19:
- return $this->getSchMonths();
- break;
- case 20:
- return $this->getSchEndDate();
- break;
- case 21:
- return $this->getSchRepeatEvery();
- break;
- case 22:
- return $this->getSchRepeatUntil();
- break;
- case 23:
- return $this->getSchRepeatStopIfRunning();
- break;
- case 24:
- return $this->getCaseShPluginUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CaseSchedulerPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getSchUid(),
- $keys[1] => $this->getSchDelUserName(),
- $keys[2] => $this->getSchDelUserPass(),
- $keys[3] => $this->getSchDelUserUid(),
- $keys[4] => $this->getSchName(),
- $keys[5] => $this->getProUid(),
- $keys[6] => $this->getTasUid(),
- $keys[7] => $this->getSchTimeNextRun(),
- $keys[8] => $this->getSchLastRunTime(),
- $keys[9] => $this->getSchState(),
- $keys[10] => $this->getSchLastState(),
- $keys[11] => $this->getUsrUid(),
- $keys[12] => $this->getSchOption(),
- $keys[13] => $this->getSchStartTime(),
- $keys[14] => $this->getSchStartDate(),
- $keys[15] => $this->getSchDaysPerformTask(),
- $keys[16] => $this->getSchEveryDays(),
- $keys[17] => $this->getSchWeekDays(),
- $keys[18] => $this->getSchStartDay(),
- $keys[19] => $this->getSchMonths(),
- $keys[20] => $this->getSchEndDate(),
- $keys[21] => $this->getSchRepeatEvery(),
- $keys[22] => $this->getSchRepeatUntil(),
- $keys[23] => $this->getSchRepeatStopIfRunning(),
- $keys[24] => $this->getCaseShPluginUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CaseSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setSchUid($value);
- break;
- case 1:
- $this->setSchDelUserName($value);
- break;
- case 2:
- $this->setSchDelUserPass($value);
- break;
- case 3:
- $this->setSchDelUserUid($value);
- break;
- case 4:
- $this->setSchName($value);
- break;
- case 5:
- $this->setProUid($value);
- break;
- case 6:
- $this->setTasUid($value);
- break;
- case 7:
- $this->setSchTimeNextRun($value);
- break;
- case 8:
- $this->setSchLastRunTime($value);
- break;
- case 9:
- $this->setSchState($value);
- break;
- case 10:
- $this->setSchLastState($value);
- break;
- case 11:
- $this->setUsrUid($value);
- break;
- case 12:
- $this->setSchOption($value);
- break;
- case 13:
- $this->setSchStartTime($value);
- break;
- case 14:
- $this->setSchStartDate($value);
- break;
- case 15:
- $this->setSchDaysPerformTask($value);
- break;
- case 16:
- $this->setSchEveryDays($value);
- break;
- case 17:
- $this->setSchWeekDays($value);
- break;
- case 18:
- $this->setSchStartDay($value);
- break;
- case 19:
- $this->setSchMonths($value);
- break;
- case 20:
- $this->setSchEndDate($value);
- break;
- case 21:
- $this->setSchRepeatEvery($value);
- break;
- case 22:
- $this->setSchRepeatUntil($value);
- break;
- case 23:
- $this->setSchRepeatStopIfRunning($value);
- break;
- case 24:
- $this->setCaseShPluginUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CaseSchedulerPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setSchUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setSchDelUserName($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setSchDelUserPass($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setSchDelUserUid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setSchName($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setProUid($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setTasUid($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setSchTimeNextRun($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setSchLastRunTime($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setSchState($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setSchLastState($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setUsrUid($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setSchOption($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setSchStartTime($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setSchStartDate($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setSchDaysPerformTask($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setSchEveryDays($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setSchWeekDays($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setSchStartDay($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setSchMonths($arr[$keys[19]]);
- if (array_key_exists($keys[20], $arr)) $this->setSchEndDate($arr[$keys[20]]);
- if (array_key_exists($keys[21], $arr)) $this->setSchRepeatEvery($arr[$keys[21]]);
- if (array_key_exists($keys[22], $arr)) $this->setSchRepeatUntil($arr[$keys[22]]);
- if (array_key_exists($keys[23], $arr)) $this->setSchRepeatStopIfRunning($arr[$keys[23]]);
- if (array_key_exists($keys[24], $arr)) $this->setCaseShPluginUid($arr[$keys[24]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CaseSchedulerPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_UID)) $criteria->add(CaseSchedulerPeer::SCH_UID, $this->sch_uid);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_DEL_USER_NAME)) $criteria->add(CaseSchedulerPeer::SCH_DEL_USER_NAME, $this->sch_del_user_name);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_DEL_USER_PASS)) $criteria->add(CaseSchedulerPeer::SCH_DEL_USER_PASS, $this->sch_del_user_pass);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_DEL_USER_UID)) $criteria->add(CaseSchedulerPeer::SCH_DEL_USER_UID, $this->sch_del_user_uid);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_NAME)) $criteria->add(CaseSchedulerPeer::SCH_NAME, $this->sch_name);
- if ($this->isColumnModified(CaseSchedulerPeer::PRO_UID)) $criteria->add(CaseSchedulerPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(CaseSchedulerPeer::TAS_UID)) $criteria->add(CaseSchedulerPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_TIME_NEXT_RUN)) $criteria->add(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $this->sch_time_next_run);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_LAST_RUN_TIME)) $criteria->add(CaseSchedulerPeer::SCH_LAST_RUN_TIME, $this->sch_last_run_time);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_STATE)) $criteria->add(CaseSchedulerPeer::SCH_STATE, $this->sch_state);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_LAST_STATE)) $criteria->add(CaseSchedulerPeer::SCH_LAST_STATE, $this->sch_last_state);
- if ($this->isColumnModified(CaseSchedulerPeer::USR_UID)) $criteria->add(CaseSchedulerPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_OPTION)) $criteria->add(CaseSchedulerPeer::SCH_OPTION, $this->sch_option);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_START_TIME)) $criteria->add(CaseSchedulerPeer::SCH_START_TIME, $this->sch_start_time);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_START_DATE)) $criteria->add(CaseSchedulerPeer::SCH_START_DATE, $this->sch_start_date);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK)) $criteria->add(CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK, $this->sch_days_perform_task);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_EVERY_DAYS)) $criteria->add(CaseSchedulerPeer::SCH_EVERY_DAYS, $this->sch_every_days);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_WEEK_DAYS)) $criteria->add(CaseSchedulerPeer::SCH_WEEK_DAYS, $this->sch_week_days);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_START_DAY)) $criteria->add(CaseSchedulerPeer::SCH_START_DAY, $this->sch_start_day);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_MONTHS)) $criteria->add(CaseSchedulerPeer::SCH_MONTHS, $this->sch_months);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_END_DATE)) $criteria->add(CaseSchedulerPeer::SCH_END_DATE, $this->sch_end_date);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_REPEAT_EVERY)) $criteria->add(CaseSchedulerPeer::SCH_REPEAT_EVERY, $this->sch_repeat_every);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_REPEAT_UNTIL)) $criteria->add(CaseSchedulerPeer::SCH_REPEAT_UNTIL, $this->sch_repeat_until);
- if ($this->isColumnModified(CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING)) $criteria->add(CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING, $this->sch_repeat_stop_if_running);
- if ($this->isColumnModified(CaseSchedulerPeer::CASE_SH_PLUGIN_UID)) $criteria->add(CaseSchedulerPeer::CASE_SH_PLUGIN_UID, $this->case_sh_plugin_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CaseSchedulerPeer::DATABASE_NAME);
-
- $criteria->add(CaseSchedulerPeer::SCH_UID, $this->sch_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getSchUid();
- }
-
- /**
- * Generic method to set the primary key (sch_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setSchUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CaseScheduler (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setSchDelUserName($this->sch_del_user_name);
-
- $copyObj->setSchDelUserPass($this->sch_del_user_pass);
-
- $copyObj->setSchDelUserUid($this->sch_del_user_uid);
-
- $copyObj->setSchName($this->sch_name);
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setSchTimeNextRun($this->sch_time_next_run);
-
- $copyObj->setSchLastRunTime($this->sch_last_run_time);
-
- $copyObj->setSchState($this->sch_state);
-
- $copyObj->setSchLastState($this->sch_last_state);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setSchOption($this->sch_option);
-
- $copyObj->setSchStartTime($this->sch_start_time);
-
- $copyObj->setSchStartDate($this->sch_start_date);
-
- $copyObj->setSchDaysPerformTask($this->sch_days_perform_task);
-
- $copyObj->setSchEveryDays($this->sch_every_days);
-
- $copyObj->setSchWeekDays($this->sch_week_days);
-
- $copyObj->setSchStartDay($this->sch_start_day);
-
- $copyObj->setSchMonths($this->sch_months);
-
- $copyObj->setSchEndDate($this->sch_end_date);
- $copyObj->setSchRepeatEvery($this->sch_repeat_every);
+ $copyObj->setNew(true);
- $copyObj->setSchRepeatUntil($this->sch_repeat_until);
+ $copyObj->setSchUid(NULL); // this is a pkey column, so set to default value
- $copyObj->setSchRepeatStopIfRunning($this->sch_repeat_stop_if_running);
+ }
- $copyObj->setCaseShPluginUid($this->case_sh_plugin_uid);
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return CaseScheduler Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return CaseSchedulerPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new CaseSchedulerPeer();
+ }
+ return self::$peer;
+ }
+}
- $copyObj->setNew(true);
-
- $copyObj->setSchUid(NULL); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CaseScheduler Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CaseSchedulerPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CaseSchedulerPeer();
- }
- return self::$peer;
- }
-
-} // BaseCaseScheduler
diff --git a/workflow/engine/classes/model/om/BaseCaseSchedulerPeer.php b/workflow/engine/classes/model/om/BaseCaseSchedulerPeer.php
index f5ea1820a..721e92bce 100755
--- a/workflow/engine/classes/model/om/BaseCaseSchedulerPeer.php
+++ b/workflow/engine/classes/model/om/BaseCaseSchedulerPeer.php
@@ -12,674 +12,676 @@ include_once 'classes/model/CaseScheduler.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCaseSchedulerPeer {
+abstract class BaseCaseSchedulerPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'CASE_SCHEDULER';
+ /** the table name for this class */
+ const TABLE_NAME = 'CASE_SCHEDULER';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.CaseScheduler';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.CaseScheduler';
- /** The total number of columns. */
- const NUM_COLUMNS = 25;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 25;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the SCH_UID field */
- const SCH_UID = 'CASE_SCHEDULER.SCH_UID';
+ /** the column name for the SCH_UID field */
+ const SCH_UID = 'CASE_SCHEDULER.SCH_UID';
- /** the column name for the SCH_DEL_USER_NAME field */
- const SCH_DEL_USER_NAME = 'CASE_SCHEDULER.SCH_DEL_USER_NAME';
+ /** the column name for the SCH_DEL_USER_NAME field */
+ const SCH_DEL_USER_NAME = 'CASE_SCHEDULER.SCH_DEL_USER_NAME';
- /** the column name for the SCH_DEL_USER_PASS field */
- const SCH_DEL_USER_PASS = 'CASE_SCHEDULER.SCH_DEL_USER_PASS';
+ /** the column name for the SCH_DEL_USER_PASS field */
+ const SCH_DEL_USER_PASS = 'CASE_SCHEDULER.SCH_DEL_USER_PASS';
- /** the column name for the SCH_DEL_USER_UID field */
- const SCH_DEL_USER_UID = 'CASE_SCHEDULER.SCH_DEL_USER_UID';
+ /** the column name for the SCH_DEL_USER_UID field */
+ const SCH_DEL_USER_UID = 'CASE_SCHEDULER.SCH_DEL_USER_UID';
- /** the column name for the SCH_NAME field */
- const SCH_NAME = 'CASE_SCHEDULER.SCH_NAME';
+ /** the column name for the SCH_NAME field */
+ const SCH_NAME = 'CASE_SCHEDULER.SCH_NAME';
- /** the column name for the PRO_UID field */
- const PRO_UID = 'CASE_SCHEDULER.PRO_UID';
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'CASE_SCHEDULER.PRO_UID';
- /** the column name for the TAS_UID field */
- const TAS_UID = 'CASE_SCHEDULER.TAS_UID';
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'CASE_SCHEDULER.TAS_UID';
- /** the column name for the SCH_TIME_NEXT_RUN field */
- const SCH_TIME_NEXT_RUN = 'CASE_SCHEDULER.SCH_TIME_NEXT_RUN';
+ /** the column name for the SCH_TIME_NEXT_RUN field */
+ const SCH_TIME_NEXT_RUN = 'CASE_SCHEDULER.SCH_TIME_NEXT_RUN';
- /** the column name for the SCH_LAST_RUN_TIME field */
- const SCH_LAST_RUN_TIME = 'CASE_SCHEDULER.SCH_LAST_RUN_TIME';
+ /** the column name for the SCH_LAST_RUN_TIME field */
+ const SCH_LAST_RUN_TIME = 'CASE_SCHEDULER.SCH_LAST_RUN_TIME';
+
+ /** the column name for the SCH_STATE field */
+ const SCH_STATE = 'CASE_SCHEDULER.SCH_STATE';
+
+ /** the column name for the SCH_LAST_STATE field */
+ const SCH_LAST_STATE = 'CASE_SCHEDULER.SCH_LAST_STATE';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'CASE_SCHEDULER.USR_UID';
+
+ /** the column name for the SCH_OPTION field */
+ const SCH_OPTION = 'CASE_SCHEDULER.SCH_OPTION';
+
+ /** the column name for the SCH_START_TIME field */
+ const SCH_START_TIME = 'CASE_SCHEDULER.SCH_START_TIME';
+
+ /** the column name for the SCH_START_DATE field */
+ const SCH_START_DATE = 'CASE_SCHEDULER.SCH_START_DATE';
+
+ /** the column name for the SCH_DAYS_PERFORM_TASK field */
+ const SCH_DAYS_PERFORM_TASK = 'CASE_SCHEDULER.SCH_DAYS_PERFORM_TASK';
+
+ /** the column name for the SCH_EVERY_DAYS field */
+ const SCH_EVERY_DAYS = 'CASE_SCHEDULER.SCH_EVERY_DAYS';
+
+ /** the column name for the SCH_WEEK_DAYS field */
+ const SCH_WEEK_DAYS = 'CASE_SCHEDULER.SCH_WEEK_DAYS';
+
+ /** the column name for the SCH_START_DAY field */
+ const SCH_START_DAY = 'CASE_SCHEDULER.SCH_START_DAY';
+
+ /** the column name for the SCH_MONTHS field */
+ const SCH_MONTHS = 'CASE_SCHEDULER.SCH_MONTHS';
+
+ /** the column name for the SCH_END_DATE field */
+ const SCH_END_DATE = 'CASE_SCHEDULER.SCH_END_DATE';
+
+ /** the column name for the SCH_REPEAT_EVERY field */
+ const SCH_REPEAT_EVERY = 'CASE_SCHEDULER.SCH_REPEAT_EVERY';
+
+ /** the column name for the SCH_REPEAT_UNTIL field */
+ const SCH_REPEAT_UNTIL = 'CASE_SCHEDULER.SCH_REPEAT_UNTIL';
+
+ /** the column name for the SCH_REPEAT_STOP_IF_RUNNING field */
+ const SCH_REPEAT_STOP_IF_RUNNING = 'CASE_SCHEDULER.SCH_REPEAT_STOP_IF_RUNNING';
+
+ /** the column name for the CASE_SH_PLUGIN_UID field */
+ const CASE_SH_PLUGIN_UID = 'CASE_SCHEDULER.CASE_SH_PLUGIN_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('SchUid', 'SchDelUserName', 'SchDelUserPass', 'SchDelUserUid', 'SchName', 'ProUid', 'TasUid', 'SchTimeNextRun', 'SchLastRunTime', 'SchState', 'SchLastState', 'UsrUid', 'SchOption', 'SchStartTime', 'SchStartDate', 'SchDaysPerformTask', 'SchEveryDays', 'SchWeekDays', 'SchStartDay', 'SchMonths', 'SchEndDate', 'SchRepeatEvery', 'SchRepeatUntil', 'SchRepeatStopIfRunning', 'CaseShPluginUid', ),
+ BasePeer::TYPE_COLNAME => array (CaseSchedulerPeer::SCH_UID, CaseSchedulerPeer::SCH_DEL_USER_NAME, CaseSchedulerPeer::SCH_DEL_USER_PASS, CaseSchedulerPeer::SCH_DEL_USER_UID, CaseSchedulerPeer::SCH_NAME, CaseSchedulerPeer::PRO_UID, CaseSchedulerPeer::TAS_UID, CaseSchedulerPeer::SCH_TIME_NEXT_RUN, CaseSchedulerPeer::SCH_LAST_RUN_TIME, CaseSchedulerPeer::SCH_STATE, CaseSchedulerPeer::SCH_LAST_STATE, CaseSchedulerPeer::USR_UID, CaseSchedulerPeer::SCH_OPTION, CaseSchedulerPeer::SCH_START_TIME, CaseSchedulerPeer::SCH_START_DATE, CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK, CaseSchedulerPeer::SCH_EVERY_DAYS, CaseSchedulerPeer::SCH_WEEK_DAYS, CaseSchedulerPeer::SCH_START_DAY, CaseSchedulerPeer::SCH_MONTHS, CaseSchedulerPeer::SCH_END_DATE, CaseSchedulerPeer::SCH_REPEAT_EVERY, CaseSchedulerPeer::SCH_REPEAT_UNTIL, CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING, CaseSchedulerPeer::CASE_SH_PLUGIN_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('SCH_UID', 'SCH_DEL_USER_NAME', 'SCH_DEL_USER_PASS', 'SCH_DEL_USER_UID', 'SCH_NAME', 'PRO_UID', 'TAS_UID', 'SCH_TIME_NEXT_RUN', 'SCH_LAST_RUN_TIME', 'SCH_STATE', 'SCH_LAST_STATE', 'USR_UID', 'SCH_OPTION', 'SCH_START_TIME', 'SCH_START_DATE', 'SCH_DAYS_PERFORM_TASK', 'SCH_EVERY_DAYS', 'SCH_WEEK_DAYS', 'SCH_START_DAY', 'SCH_MONTHS', 'SCH_END_DATE', 'SCH_REPEAT_EVERY', 'SCH_REPEAT_UNTIL', 'SCH_REPEAT_STOP_IF_RUNNING', 'CASE_SH_PLUGIN_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('SchUid' => 0, 'SchDelUserName' => 1, 'SchDelUserPass' => 2, 'SchDelUserUid' => 3, 'SchName' => 4, 'ProUid' => 5, 'TasUid' => 6, 'SchTimeNextRun' => 7, 'SchLastRunTime' => 8, 'SchState' => 9, 'SchLastState' => 10, 'UsrUid' => 11, 'SchOption' => 12, 'SchStartTime' => 13, 'SchStartDate' => 14, 'SchDaysPerformTask' => 15, 'SchEveryDays' => 16, 'SchWeekDays' => 17, 'SchStartDay' => 18, 'SchMonths' => 19, 'SchEndDate' => 20, 'SchRepeatEvery' => 21, 'SchRepeatUntil' => 22, 'SchRepeatStopIfRunning' => 23, 'CaseShPluginUid' => 24, ),
+ BasePeer::TYPE_COLNAME => array (CaseSchedulerPeer::SCH_UID => 0, CaseSchedulerPeer::SCH_DEL_USER_NAME => 1, CaseSchedulerPeer::SCH_DEL_USER_PASS => 2, CaseSchedulerPeer::SCH_DEL_USER_UID => 3, CaseSchedulerPeer::SCH_NAME => 4, CaseSchedulerPeer::PRO_UID => 5, CaseSchedulerPeer::TAS_UID => 6, CaseSchedulerPeer::SCH_TIME_NEXT_RUN => 7, CaseSchedulerPeer::SCH_LAST_RUN_TIME => 8, CaseSchedulerPeer::SCH_STATE => 9, CaseSchedulerPeer::SCH_LAST_STATE => 10, CaseSchedulerPeer::USR_UID => 11, CaseSchedulerPeer::SCH_OPTION => 12, CaseSchedulerPeer::SCH_START_TIME => 13, CaseSchedulerPeer::SCH_START_DATE => 14, CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK => 15, CaseSchedulerPeer::SCH_EVERY_DAYS => 16, CaseSchedulerPeer::SCH_WEEK_DAYS => 17, CaseSchedulerPeer::SCH_START_DAY => 18, CaseSchedulerPeer::SCH_MONTHS => 19, CaseSchedulerPeer::SCH_END_DATE => 20, CaseSchedulerPeer::SCH_REPEAT_EVERY => 21, CaseSchedulerPeer::SCH_REPEAT_UNTIL => 22, CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING => 23, CaseSchedulerPeer::CASE_SH_PLUGIN_UID => 24, ),
+ BasePeer::TYPE_FIELDNAME => array ('SCH_UID' => 0, 'SCH_DEL_USER_NAME' => 1, 'SCH_DEL_USER_PASS' => 2, 'SCH_DEL_USER_UID' => 3, 'SCH_NAME' => 4, 'PRO_UID' => 5, 'TAS_UID' => 6, 'SCH_TIME_NEXT_RUN' => 7, 'SCH_LAST_RUN_TIME' => 8, 'SCH_STATE' => 9, 'SCH_LAST_STATE' => 10, 'USR_UID' => 11, 'SCH_OPTION' => 12, 'SCH_START_TIME' => 13, 'SCH_START_DATE' => 14, 'SCH_DAYS_PERFORM_TASK' => 15, 'SCH_EVERY_DAYS' => 16, 'SCH_WEEK_DAYS' => 17, 'SCH_START_DAY' => 18, 'SCH_MONTHS' => 19, 'SCH_END_DATE' => 20, 'SCH_REPEAT_EVERY' => 21, 'SCH_REPEAT_UNTIL' => 22, 'SCH_REPEAT_STOP_IF_RUNNING' => 23, 'CASE_SH_PLUGIN_UID' => 24, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/CaseSchedulerMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.CaseSchedulerMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = CaseSchedulerPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. CaseSchedulerPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(CaseSchedulerPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_UID);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DEL_USER_NAME);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DEL_USER_PASS);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DEL_USER_UID);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_NAME);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::PRO_UID);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::TAS_UID);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_TIME_NEXT_RUN);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_LAST_RUN_TIME);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_STATE);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_LAST_STATE);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::USR_UID);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_OPTION);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_START_TIME);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_START_DATE);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_EVERY_DAYS);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_WEEK_DAYS);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_START_DAY);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_MONTHS);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_END_DATE);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_REPEAT_EVERY);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_REPEAT_UNTIL);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING);
+
+ $criteria->addSelectColumn(CaseSchedulerPeer::CASE_SH_PLUGIN_UID);
+
+ }
+
+ const COUNT = 'COUNT(CASE_SCHEDULER.SCH_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CASE_SCHEDULER.SCH_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(CaseSchedulerPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(CaseSchedulerPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = CaseSchedulerPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return CaseScheduler
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = CaseSchedulerPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return CaseSchedulerPeer::populateObjects(CaseSchedulerPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ CaseSchedulerPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = CaseSchedulerPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return CaseSchedulerPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a CaseScheduler or Criteria object.
+ *
+ * @param mixed $values Criteria or CaseScheduler object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from CaseScheduler object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a CaseScheduler or Criteria object.
+ *
+ * @param mixed $values Criteria or CaseScheduler object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(CaseSchedulerPeer::SCH_UID);
+ $selectCriteria->add(CaseSchedulerPeer::SCH_UID, $criteria->remove(CaseSchedulerPeer::SCH_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CASE_SCHEDULER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(CaseSchedulerPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a CaseScheduler or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CaseScheduler object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(CaseSchedulerPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof CaseScheduler) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(CaseSchedulerPeer::SCH_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given CaseScheduler object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param CaseScheduler $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(CaseScheduler $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(CaseSchedulerPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(CaseSchedulerPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(CaseSchedulerPeer::DATABASE_NAME, CaseSchedulerPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return CaseScheduler
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(CaseSchedulerPeer::DATABASE_NAME);
+
+ $criteria->add(CaseSchedulerPeer::SCH_UID, $pk);
+
+
+ $v = CaseSchedulerPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(CaseSchedulerPeer::SCH_UID, $pks, Criteria::IN);
+ $objs = CaseSchedulerPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** the column name for the SCH_STATE field */
- const SCH_STATE = 'CASE_SCHEDULER.SCH_STATE';
-
- /** the column name for the SCH_LAST_STATE field */
- const SCH_LAST_STATE = 'CASE_SCHEDULER.SCH_LAST_STATE';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'CASE_SCHEDULER.USR_UID';
-
- /** the column name for the SCH_OPTION field */
- const SCH_OPTION = 'CASE_SCHEDULER.SCH_OPTION';
-
- /** the column name for the SCH_START_TIME field */
- const SCH_START_TIME = 'CASE_SCHEDULER.SCH_START_TIME';
-
- /** the column name for the SCH_START_DATE field */
- const SCH_START_DATE = 'CASE_SCHEDULER.SCH_START_DATE';
-
- /** the column name for the SCH_DAYS_PERFORM_TASK field */
- const SCH_DAYS_PERFORM_TASK = 'CASE_SCHEDULER.SCH_DAYS_PERFORM_TASK';
-
- /** the column name for the SCH_EVERY_DAYS field */
- const SCH_EVERY_DAYS = 'CASE_SCHEDULER.SCH_EVERY_DAYS';
-
- /** the column name for the SCH_WEEK_DAYS field */
- const SCH_WEEK_DAYS = 'CASE_SCHEDULER.SCH_WEEK_DAYS';
-
- /** the column name for the SCH_START_DAY field */
- const SCH_START_DAY = 'CASE_SCHEDULER.SCH_START_DAY';
-
- /** the column name for the SCH_MONTHS field */
- const SCH_MONTHS = 'CASE_SCHEDULER.SCH_MONTHS';
-
- /** the column name for the SCH_END_DATE field */
- const SCH_END_DATE = 'CASE_SCHEDULER.SCH_END_DATE';
-
- /** the column name for the SCH_REPEAT_EVERY field */
- const SCH_REPEAT_EVERY = 'CASE_SCHEDULER.SCH_REPEAT_EVERY';
-
- /** the column name for the SCH_REPEAT_UNTIL field */
- const SCH_REPEAT_UNTIL = 'CASE_SCHEDULER.SCH_REPEAT_UNTIL';
-
- /** the column name for the SCH_REPEAT_STOP_IF_RUNNING field */
- const SCH_REPEAT_STOP_IF_RUNNING = 'CASE_SCHEDULER.SCH_REPEAT_STOP_IF_RUNNING';
-
- /** the column name for the CASE_SH_PLUGIN_UID field */
- const CASE_SH_PLUGIN_UID = 'CASE_SCHEDULER.CASE_SH_PLUGIN_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('SchUid', 'SchDelUserName', 'SchDelUserPass', 'SchDelUserUid', 'SchName', 'ProUid', 'TasUid', 'SchTimeNextRun', 'SchLastRunTime', 'SchState', 'SchLastState', 'UsrUid', 'SchOption', 'SchStartTime', 'SchStartDate', 'SchDaysPerformTask', 'SchEveryDays', 'SchWeekDays', 'SchStartDay', 'SchMonths', 'SchEndDate', 'SchRepeatEvery', 'SchRepeatUntil', 'SchRepeatStopIfRunning', 'CaseShPluginUid', ),
- BasePeer::TYPE_COLNAME => array (CaseSchedulerPeer::SCH_UID, CaseSchedulerPeer::SCH_DEL_USER_NAME, CaseSchedulerPeer::SCH_DEL_USER_PASS, CaseSchedulerPeer::SCH_DEL_USER_UID, CaseSchedulerPeer::SCH_NAME, CaseSchedulerPeer::PRO_UID, CaseSchedulerPeer::TAS_UID, CaseSchedulerPeer::SCH_TIME_NEXT_RUN, CaseSchedulerPeer::SCH_LAST_RUN_TIME, CaseSchedulerPeer::SCH_STATE, CaseSchedulerPeer::SCH_LAST_STATE, CaseSchedulerPeer::USR_UID, CaseSchedulerPeer::SCH_OPTION, CaseSchedulerPeer::SCH_START_TIME, CaseSchedulerPeer::SCH_START_DATE, CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK, CaseSchedulerPeer::SCH_EVERY_DAYS, CaseSchedulerPeer::SCH_WEEK_DAYS, CaseSchedulerPeer::SCH_START_DAY, CaseSchedulerPeer::SCH_MONTHS, CaseSchedulerPeer::SCH_END_DATE, CaseSchedulerPeer::SCH_REPEAT_EVERY, CaseSchedulerPeer::SCH_REPEAT_UNTIL, CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING, CaseSchedulerPeer::CASE_SH_PLUGIN_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('SCH_UID', 'SCH_DEL_USER_NAME', 'SCH_DEL_USER_PASS', 'SCH_DEL_USER_UID', 'SCH_NAME', 'PRO_UID', 'TAS_UID', 'SCH_TIME_NEXT_RUN', 'SCH_LAST_RUN_TIME', 'SCH_STATE', 'SCH_LAST_STATE', 'USR_UID', 'SCH_OPTION', 'SCH_START_TIME', 'SCH_START_DATE', 'SCH_DAYS_PERFORM_TASK', 'SCH_EVERY_DAYS', 'SCH_WEEK_DAYS', 'SCH_START_DAY', 'SCH_MONTHS', 'SCH_END_DATE', 'SCH_REPEAT_EVERY', 'SCH_REPEAT_UNTIL', 'SCH_REPEAT_STOP_IF_RUNNING', 'CASE_SH_PLUGIN_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('SchUid' => 0, 'SchDelUserName' => 1, 'SchDelUserPass' => 2, 'SchDelUserUid' => 3, 'SchName' => 4, 'ProUid' => 5, 'TasUid' => 6, 'SchTimeNextRun' => 7, 'SchLastRunTime' => 8, 'SchState' => 9, 'SchLastState' => 10, 'UsrUid' => 11, 'SchOption' => 12, 'SchStartTime' => 13, 'SchStartDate' => 14, 'SchDaysPerformTask' => 15, 'SchEveryDays' => 16, 'SchWeekDays' => 17, 'SchStartDay' => 18, 'SchMonths' => 19, 'SchEndDate' => 20, 'SchRepeatEvery' => 21, 'SchRepeatUntil' => 22, 'SchRepeatStopIfRunning' => 23, 'CaseShPluginUid' => 24, ),
- BasePeer::TYPE_COLNAME => array (CaseSchedulerPeer::SCH_UID => 0, CaseSchedulerPeer::SCH_DEL_USER_NAME => 1, CaseSchedulerPeer::SCH_DEL_USER_PASS => 2, CaseSchedulerPeer::SCH_DEL_USER_UID => 3, CaseSchedulerPeer::SCH_NAME => 4, CaseSchedulerPeer::PRO_UID => 5, CaseSchedulerPeer::TAS_UID => 6, CaseSchedulerPeer::SCH_TIME_NEXT_RUN => 7, CaseSchedulerPeer::SCH_LAST_RUN_TIME => 8, CaseSchedulerPeer::SCH_STATE => 9, CaseSchedulerPeer::SCH_LAST_STATE => 10, CaseSchedulerPeer::USR_UID => 11, CaseSchedulerPeer::SCH_OPTION => 12, CaseSchedulerPeer::SCH_START_TIME => 13, CaseSchedulerPeer::SCH_START_DATE => 14, CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK => 15, CaseSchedulerPeer::SCH_EVERY_DAYS => 16, CaseSchedulerPeer::SCH_WEEK_DAYS => 17, CaseSchedulerPeer::SCH_START_DAY => 18, CaseSchedulerPeer::SCH_MONTHS => 19, CaseSchedulerPeer::SCH_END_DATE => 20, CaseSchedulerPeer::SCH_REPEAT_EVERY => 21, CaseSchedulerPeer::SCH_REPEAT_UNTIL => 22, CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING => 23, CaseSchedulerPeer::CASE_SH_PLUGIN_UID => 24, ),
- BasePeer::TYPE_FIELDNAME => array ('SCH_UID' => 0, 'SCH_DEL_USER_NAME' => 1, 'SCH_DEL_USER_PASS' => 2, 'SCH_DEL_USER_UID' => 3, 'SCH_NAME' => 4, 'PRO_UID' => 5, 'TAS_UID' => 6, 'SCH_TIME_NEXT_RUN' => 7, 'SCH_LAST_RUN_TIME' => 8, 'SCH_STATE' => 9, 'SCH_LAST_STATE' => 10, 'USR_UID' => 11, 'SCH_OPTION' => 12, 'SCH_START_TIME' => 13, 'SCH_START_DATE' => 14, 'SCH_DAYS_PERFORM_TASK' => 15, 'SCH_EVERY_DAYS' => 16, 'SCH_WEEK_DAYS' => 17, 'SCH_START_DAY' => 18, 'SCH_MONTHS' => 19, 'SCH_END_DATE' => 20, 'SCH_REPEAT_EVERY' => 21, 'SCH_REPEAT_UNTIL' => 22, 'SCH_REPEAT_STOP_IF_RUNNING' => 23, 'CASE_SH_PLUGIN_UID' => 24, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/CaseSchedulerMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.CaseSchedulerMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = CaseSchedulerPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CaseSchedulerPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CaseSchedulerPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_UID);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DEL_USER_NAME);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DEL_USER_PASS);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DEL_USER_UID);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_NAME);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::PRO_UID);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::TAS_UID);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_TIME_NEXT_RUN);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_LAST_RUN_TIME);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_STATE);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_LAST_STATE);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::USR_UID);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_OPTION);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_START_TIME);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_START_DATE);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_DAYS_PERFORM_TASK);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_EVERY_DAYS);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_WEEK_DAYS);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_START_DAY);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_MONTHS);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_END_DATE);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_REPEAT_EVERY);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_REPEAT_UNTIL);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::SCH_REPEAT_STOP_IF_RUNNING);
-
- $criteria->addSelectColumn(CaseSchedulerPeer::CASE_SH_PLUGIN_UID);
-
- }
-
- const COUNT = 'COUNT(CASE_SCHEDULER.SCH_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CASE_SCHEDULER.SCH_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(CaseSchedulerPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(CaseSchedulerPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = CaseSchedulerPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return CaseScheduler
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CaseSchedulerPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return CaseSchedulerPeer::populateObjects(CaseSchedulerPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- CaseSchedulerPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CaseSchedulerPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return CaseSchedulerPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a CaseScheduler or Criteria object.
- *
- * @param mixed $values Criteria or CaseScheduler object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CaseScheduler object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a CaseScheduler or Criteria object.
- *
- * @param mixed $values Criteria or CaseScheduler object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CaseSchedulerPeer::SCH_UID);
- $selectCriteria->add(CaseSchedulerPeer::SCH_UID, $criteria->remove(CaseSchedulerPeer::SCH_UID), $comparison);
-
- } else { // $values is CaseScheduler object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CASE_SCHEDULER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(CaseSchedulerPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a CaseScheduler or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CaseScheduler object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CaseSchedulerPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof CaseScheduler) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(CaseSchedulerPeer::SCH_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CaseScheduler object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CaseScheduler $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(CaseScheduler $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CaseSchedulerPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CaseSchedulerPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(CaseSchedulerPeer::DATABASE_NAME, CaseSchedulerPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return CaseScheduler
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(CaseSchedulerPeer::DATABASE_NAME);
-
- $criteria->add(CaseSchedulerPeer::SCH_UID, $pk);
-
-
- $v = CaseSchedulerPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(CaseSchedulerPeer::SCH_UID, $pks, Criteria::IN);
- $objs = CaseSchedulerPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseCaseSchedulerPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseCaseSchedulerPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseCaseSchedulerPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/CaseSchedulerMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.CaseSchedulerMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/CaseSchedulerMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.CaseSchedulerMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseCaseTracker.php b/workflow/engine/classes/model/om/BaseCaseTracker.php
index ed2e28b5d..000e105be 100755
--- a/workflow/engine/classes/model/om/BaseCaseTracker.php
+++ b/workflow/engine/classes/model/om/BaseCaseTracker.php
@@ -16,648 +16,669 @@ include_once 'classes/model/CaseTrackerPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCaseTracker extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var CaseTrackerPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the ct_map_type field.
- * @var string
- */
- protected $ct_map_type = '0';
-
-
- /**
- * The value for the ct_derivation_history field.
- * @var int
- */
- protected $ct_derivation_history = 0;
-
-
- /**
- * The value for the ct_message_history field.
- * @var int
- */
- protected $ct_message_history = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [ct_map_type] column value.
- *
- * @return string
- */
- public function getCtMapType()
- {
-
- return $this->ct_map_type;
- }
-
- /**
- * Get the [ct_derivation_history] column value.
- *
- * @return int
- */
- public function getCtDerivationHistory()
- {
-
- return $this->ct_derivation_history;
- }
-
- /**
- * Get the [ct_message_history] column value.
- *
- * @return int
- */
- public function getCtMessageHistory()
- {
-
- return $this->ct_message_history;
- }
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = CaseTrackerPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [ct_map_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCtMapType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ct_map_type !== $v || $v === '0') {
- $this->ct_map_type = $v;
- $this->modifiedColumns[] = CaseTrackerPeer::CT_MAP_TYPE;
- }
-
- } // setCtMapType()
-
- /**
- * Set the value of [ct_derivation_history] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setCtDerivationHistory($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->ct_derivation_history !== $v || $v === 0) {
- $this->ct_derivation_history = $v;
- $this->modifiedColumns[] = CaseTrackerPeer::CT_DERIVATION_HISTORY;
- }
-
- } // setCtDerivationHistory()
-
- /**
- * Set the value of [ct_message_history] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setCtMessageHistory($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->ct_message_history !== $v || $v === 0) {
- $this->ct_message_history = $v;
- $this->modifiedColumns[] = CaseTrackerPeer::CT_MESSAGE_HISTORY;
- }
-
- } // setCtMessageHistory()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->pro_uid = $rs->getString($startcol + 0);
-
- $this->ct_map_type = $rs->getString($startcol + 1);
-
- $this->ct_derivation_history = $rs->getInt($startcol + 2);
-
- $this->ct_message_history = $rs->getInt($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = CaseTrackerPeer::NUM_COLUMNS - CaseTrackerPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CaseTracker object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- CaseTrackerPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = CaseTrackerPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += CaseTrackerPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CaseTrackerPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CaseTrackerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getProUid();
- break;
- case 1:
- return $this->getCtMapType();
- break;
- case 2:
- return $this->getCtDerivationHistory();
- break;
- case 3:
- return $this->getCtMessageHistory();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CaseTrackerPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getProUid(),
- $keys[1] => $this->getCtMapType(),
- $keys[2] => $this->getCtDerivationHistory(),
- $keys[3] => $this->getCtMessageHistory(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CaseTrackerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setProUid($value);
- break;
- case 1:
- $this->setCtMapType($value);
- break;
- case 2:
- $this->setCtDerivationHistory($value);
- break;
- case 3:
- $this->setCtMessageHistory($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CaseTrackerPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setProUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCtMapType($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCtDerivationHistory($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCtMessageHistory($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CaseTrackerPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CaseTrackerPeer::PRO_UID)) $criteria->add(CaseTrackerPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(CaseTrackerPeer::CT_MAP_TYPE)) $criteria->add(CaseTrackerPeer::CT_MAP_TYPE, $this->ct_map_type);
- if ($this->isColumnModified(CaseTrackerPeer::CT_DERIVATION_HISTORY)) $criteria->add(CaseTrackerPeer::CT_DERIVATION_HISTORY, $this->ct_derivation_history);
- if ($this->isColumnModified(CaseTrackerPeer::CT_MESSAGE_HISTORY)) $criteria->add(CaseTrackerPeer::CT_MESSAGE_HISTORY, $this->ct_message_history);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CaseTrackerPeer::DATABASE_NAME);
-
- $criteria->add(CaseTrackerPeer::PRO_UID, $this->pro_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getProUid();
- }
-
- /**
- * Generic method to set the primary key (pro_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setProUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CaseTracker (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setCtMapType($this->ct_map_type);
-
- $copyObj->setCtDerivationHistory($this->ct_derivation_history);
-
- $copyObj->setCtMessageHistory($this->ct_message_history);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setProUid('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CaseTracker Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CaseTrackerPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CaseTrackerPeer();
- }
- return self::$peer;
- }
-
-} // BaseCaseTracker
+abstract class BaseCaseTracker extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var CaseTrackerPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the ct_map_type field.
+ * @var string
+ */
+ protected $ct_map_type = '0';
+
+ /**
+ * The value for the ct_derivation_history field.
+ * @var int
+ */
+ protected $ct_derivation_history = 0;
+
+ /**
+ * The value for the ct_message_history field.
+ * @var int
+ */
+ protected $ct_message_history = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [ct_map_type] column value.
+ *
+ * @return string
+ */
+ public function getCtMapType()
+ {
+
+ return $this->ct_map_type;
+ }
+
+ /**
+ * Get the [ct_derivation_history] column value.
+ *
+ * @return int
+ */
+ public function getCtDerivationHistory()
+ {
+
+ return $this->ct_derivation_history;
+ }
+
+ /**
+ * Get the [ct_message_history] column value.
+ *
+ * @return int
+ */
+ public function getCtMessageHistory()
+ {
+
+ return $this->ct_message_history;
+ }
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = CaseTrackerPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [ct_map_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCtMapType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ct_map_type !== $v || $v === '0') {
+ $this->ct_map_type = $v;
+ $this->modifiedColumns[] = CaseTrackerPeer::CT_MAP_TYPE;
+ }
+
+ } // setCtMapType()
+
+ /**
+ * Set the value of [ct_derivation_history] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setCtDerivationHistory($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->ct_derivation_history !== $v || $v === 0) {
+ $this->ct_derivation_history = $v;
+ $this->modifiedColumns[] = CaseTrackerPeer::CT_DERIVATION_HISTORY;
+ }
+
+ } // setCtDerivationHistory()
+
+ /**
+ * Set the value of [ct_message_history] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setCtMessageHistory($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->ct_message_history !== $v || $v === 0) {
+ $this->ct_message_history = $v;
+ $this->modifiedColumns[] = CaseTrackerPeer::CT_MESSAGE_HISTORY;
+ }
+
+ } // setCtMessageHistory()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->pro_uid = $rs->getString($startcol + 0);
+
+ $this->ct_map_type = $rs->getString($startcol + 1);
+
+ $this->ct_derivation_history = $rs->getInt($startcol + 2);
+
+ $this->ct_message_history = $rs->getInt($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = CaseTrackerPeer::NUM_COLUMNS - CaseTrackerPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating CaseTracker object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ CaseTrackerPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = CaseTrackerPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += CaseTrackerPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = CaseTrackerPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CaseTrackerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getProUid();
+ break;
+ case 1:
+ return $this->getCtMapType();
+ break;
+ case 2:
+ return $this->getCtDerivationHistory();
+ break;
+ case 3:
+ return $this->getCtMessageHistory();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CaseTrackerPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getProUid(),
+ $keys[1] => $this->getCtMapType(),
+ $keys[2] => $this->getCtDerivationHistory(),
+ $keys[3] => $this->getCtMessageHistory(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CaseTrackerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setProUid($value);
+ break;
+ case 1:
+ $this->setCtMapType($value);
+ break;
+ case 2:
+ $this->setCtDerivationHistory($value);
+ break;
+ case 3:
+ $this->setCtMessageHistory($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CaseTrackerPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setProUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setCtMapType($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setCtDerivationHistory($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setCtMessageHistory($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CaseTrackerPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(CaseTrackerPeer::PRO_UID)) {
+ $criteria->add(CaseTrackerPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(CaseTrackerPeer::CT_MAP_TYPE)) {
+ $criteria->add(CaseTrackerPeer::CT_MAP_TYPE, $this->ct_map_type);
+ }
+
+ if ($this->isColumnModified(CaseTrackerPeer::CT_DERIVATION_HISTORY)) {
+ $criteria->add(CaseTrackerPeer::CT_DERIVATION_HISTORY, $this->ct_derivation_history);
+ }
+
+ if ($this->isColumnModified(CaseTrackerPeer::CT_MESSAGE_HISTORY)) {
+ $criteria->add(CaseTrackerPeer::CT_MESSAGE_HISTORY, $this->ct_message_history);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CaseTrackerPeer::DATABASE_NAME);
+
+ $criteria->add(CaseTrackerPeer::PRO_UID, $this->pro_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getProUid();
+ }
+
+ /**
+ * Generic method to set the primary key (pro_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setProUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of CaseTracker (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setCtMapType($this->ct_map_type);
+
+ $copyObj->setCtDerivationHistory($this->ct_derivation_history);
+
+ $copyObj->setCtMessageHistory($this->ct_message_history);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setProUid('0'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return CaseTracker Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return CaseTrackerPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new CaseTrackerPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseCaseTrackerObject.php b/workflow/engine/classes/model/om/BaseCaseTrackerObject.php
index 47a86baef..ba8dc4403 100755
--- a/workflow/engine/classes/model/om/BaseCaseTrackerObject.php
+++ b/workflow/engine/classes/model/om/BaseCaseTrackerObject.php
@@ -16,754 +16,785 @@ include_once 'classes/model/CaseTrackerObjectPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCaseTrackerObject extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var CaseTrackerObjectPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the cto_uid field.
- * @var string
- */
- protected $cto_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the cto_type_obj field.
- * @var string
- */
- protected $cto_type_obj = 'DYNAFORM';
-
-
- /**
- * The value for the cto_uid_obj field.
- * @var string
- */
- protected $cto_uid_obj = '0';
-
-
- /**
- * The value for the cto_condition field.
- * @var string
- */
- protected $cto_condition;
-
-
- /**
- * The value for the cto_position field.
- * @var int
- */
- protected $cto_position = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [cto_uid] column value.
- *
- * @return string
- */
- public function getCtoUid()
- {
-
- return $this->cto_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [cto_type_obj] column value.
- *
- * @return string
- */
- public function getCtoTypeObj()
- {
-
- return $this->cto_type_obj;
- }
-
- /**
- * Get the [cto_uid_obj] column value.
- *
- * @return string
- */
- public function getCtoUidObj()
- {
-
- return $this->cto_uid_obj;
- }
-
- /**
- * Get the [cto_condition] column value.
- *
- * @return string
- */
- public function getCtoCondition()
- {
-
- return $this->cto_condition;
- }
-
- /**
- * Get the [cto_position] column value.
- *
- * @return int
- */
- public function getCtoPosition()
- {
-
- return $this->cto_position;
- }
-
- /**
- * Set the value of [cto_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCtoUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->cto_uid !== $v || $v === '') {
- $this->cto_uid = $v;
- $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_UID;
- }
-
- } // setCtoUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = CaseTrackerObjectPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [cto_type_obj] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCtoTypeObj($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->cto_type_obj !== $v || $v === 'DYNAFORM') {
- $this->cto_type_obj = $v;
- $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_TYPE_OBJ;
- }
-
- } // setCtoTypeObj()
-
- /**
- * Set the value of [cto_uid_obj] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCtoUidObj($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->cto_uid_obj !== $v || $v === '0') {
- $this->cto_uid_obj = $v;
- $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_UID_OBJ;
- }
-
- } // setCtoUidObj()
-
- /**
- * Set the value of [cto_condition] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCtoCondition($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->cto_condition !== $v) {
- $this->cto_condition = $v;
- $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_CONDITION;
- }
-
- } // setCtoCondition()
-
- /**
- * Set the value of [cto_position] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setCtoPosition($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->cto_position !== $v || $v === 0) {
- $this->cto_position = $v;
- $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_POSITION;
- }
-
- } // setCtoPosition()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->cto_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->cto_type_obj = $rs->getString($startcol + 2);
-
- $this->cto_uid_obj = $rs->getString($startcol + 3);
-
- $this->cto_condition = $rs->getString($startcol + 4);
-
- $this->cto_position = $rs->getInt($startcol + 5);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 6; // 6 = CaseTrackerObjectPeer::NUM_COLUMNS - CaseTrackerObjectPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CaseTrackerObject object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- CaseTrackerObjectPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = CaseTrackerObjectPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += CaseTrackerObjectPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = CaseTrackerObjectPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CaseTrackerObjectPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getCtoUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getCtoTypeObj();
- break;
- case 3:
- return $this->getCtoUidObj();
- break;
- case 4:
- return $this->getCtoCondition();
- break;
- case 5:
- return $this->getCtoPosition();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CaseTrackerObjectPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getCtoUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getCtoTypeObj(),
- $keys[3] => $this->getCtoUidObj(),
- $keys[4] => $this->getCtoCondition(),
- $keys[5] => $this->getCtoPosition(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CaseTrackerObjectPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setCtoUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setCtoTypeObj($value);
- break;
- case 3:
- $this->setCtoUidObj($value);
- break;
- case 4:
- $this->setCtoCondition($value);
- break;
- case 5:
- $this->setCtoPosition($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CaseTrackerObjectPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setCtoUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCtoTypeObj($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCtoUidObj($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setCtoCondition($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setCtoPosition($arr[$keys[5]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CaseTrackerObjectPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_UID)) $criteria->add(CaseTrackerObjectPeer::CTO_UID, $this->cto_uid);
- if ($this->isColumnModified(CaseTrackerObjectPeer::PRO_UID)) $criteria->add(CaseTrackerObjectPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_TYPE_OBJ)) $criteria->add(CaseTrackerObjectPeer::CTO_TYPE_OBJ, $this->cto_type_obj);
- if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_UID_OBJ)) $criteria->add(CaseTrackerObjectPeer::CTO_UID_OBJ, $this->cto_uid_obj);
- if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_CONDITION)) $criteria->add(CaseTrackerObjectPeer::CTO_CONDITION, $this->cto_condition);
- if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_POSITION)) $criteria->add(CaseTrackerObjectPeer::CTO_POSITION, $this->cto_position);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CaseTrackerObjectPeer::DATABASE_NAME);
-
- $criteria->add(CaseTrackerObjectPeer::CTO_UID, $this->cto_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getCtoUid();
- }
-
- /**
- * Generic method to set the primary key (cto_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setCtoUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CaseTrackerObject (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setCtoTypeObj($this->cto_type_obj);
-
- $copyObj->setCtoUidObj($this->cto_uid_obj);
-
- $copyObj->setCtoCondition($this->cto_condition);
-
- $copyObj->setCtoPosition($this->cto_position);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setCtoUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CaseTrackerObject Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CaseTrackerObjectPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CaseTrackerObjectPeer();
- }
- return self::$peer;
- }
-
-} // BaseCaseTrackerObject
+abstract class BaseCaseTrackerObject extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var CaseTrackerObjectPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the cto_uid field.
+ * @var string
+ */
+ protected $cto_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the cto_type_obj field.
+ * @var string
+ */
+ protected $cto_type_obj = 'DYNAFORM';
+
+ /**
+ * The value for the cto_uid_obj field.
+ * @var string
+ */
+ protected $cto_uid_obj = '0';
+
+ /**
+ * The value for the cto_condition field.
+ * @var string
+ */
+ protected $cto_condition;
+
+ /**
+ * The value for the cto_position field.
+ * @var int
+ */
+ protected $cto_position = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [cto_uid] column value.
+ *
+ * @return string
+ */
+ public function getCtoUid()
+ {
+
+ return $this->cto_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [cto_type_obj] column value.
+ *
+ * @return string
+ */
+ public function getCtoTypeObj()
+ {
+
+ return $this->cto_type_obj;
+ }
+
+ /**
+ * Get the [cto_uid_obj] column value.
+ *
+ * @return string
+ */
+ public function getCtoUidObj()
+ {
+
+ return $this->cto_uid_obj;
+ }
+
+ /**
+ * Get the [cto_condition] column value.
+ *
+ * @return string
+ */
+ public function getCtoCondition()
+ {
+
+ return $this->cto_condition;
+ }
+
+ /**
+ * Get the [cto_position] column value.
+ *
+ * @return int
+ */
+ public function getCtoPosition()
+ {
+
+ return $this->cto_position;
+ }
+
+ /**
+ * Set the value of [cto_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCtoUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->cto_uid !== $v || $v === '') {
+ $this->cto_uid = $v;
+ $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_UID;
+ }
+
+ } // setCtoUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = CaseTrackerObjectPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [cto_type_obj] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCtoTypeObj($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->cto_type_obj !== $v || $v === 'DYNAFORM') {
+ $this->cto_type_obj = $v;
+ $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_TYPE_OBJ;
+ }
+
+ } // setCtoTypeObj()
+
+ /**
+ * Set the value of [cto_uid_obj] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCtoUidObj($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->cto_uid_obj !== $v || $v === '0') {
+ $this->cto_uid_obj = $v;
+ $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_UID_OBJ;
+ }
+
+ } // setCtoUidObj()
+
+ /**
+ * Set the value of [cto_condition] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCtoCondition($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->cto_condition !== $v) {
+ $this->cto_condition = $v;
+ $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_CONDITION;
+ }
+
+ } // setCtoCondition()
+
+ /**
+ * Set the value of [cto_position] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setCtoPosition($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->cto_position !== $v || $v === 0) {
+ $this->cto_position = $v;
+ $this->modifiedColumns[] = CaseTrackerObjectPeer::CTO_POSITION;
+ }
+
+ } // setCtoPosition()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->cto_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->cto_type_obj = $rs->getString($startcol + 2);
+
+ $this->cto_uid_obj = $rs->getString($startcol + 3);
+
+ $this->cto_condition = $rs->getString($startcol + 4);
+
+ $this->cto_position = $rs->getInt($startcol + 5);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 6; // 6 = CaseTrackerObjectPeer::NUM_COLUMNS - CaseTrackerObjectPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating CaseTrackerObject object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ CaseTrackerObjectPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = CaseTrackerObjectPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += CaseTrackerObjectPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = CaseTrackerObjectPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CaseTrackerObjectPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getCtoUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getCtoTypeObj();
+ break;
+ case 3:
+ return $this->getCtoUidObj();
+ break;
+ case 4:
+ return $this->getCtoCondition();
+ break;
+ case 5:
+ return $this->getCtoPosition();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CaseTrackerObjectPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getCtoUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getCtoTypeObj(),
+ $keys[3] => $this->getCtoUidObj(),
+ $keys[4] => $this->getCtoCondition(),
+ $keys[5] => $this->getCtoPosition(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = CaseTrackerObjectPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setCtoUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setCtoTypeObj($value);
+ break;
+ case 3:
+ $this->setCtoUidObj($value);
+ break;
+ case 4:
+ $this->setCtoCondition($value);
+ break;
+ case 5:
+ $this->setCtoPosition($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = CaseTrackerObjectPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setCtoUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setCtoTypeObj($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setCtoUidObj($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setCtoCondition($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setCtoPosition($arr[$keys[5]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(CaseTrackerObjectPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_UID)) {
+ $criteria->add(CaseTrackerObjectPeer::CTO_UID, $this->cto_uid);
+ }
+
+ if ($this->isColumnModified(CaseTrackerObjectPeer::PRO_UID)) {
+ $criteria->add(CaseTrackerObjectPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_TYPE_OBJ)) {
+ $criteria->add(CaseTrackerObjectPeer::CTO_TYPE_OBJ, $this->cto_type_obj);
+ }
+
+ if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_UID_OBJ)) {
+ $criteria->add(CaseTrackerObjectPeer::CTO_UID_OBJ, $this->cto_uid_obj);
+ }
+
+ if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_CONDITION)) {
+ $criteria->add(CaseTrackerObjectPeer::CTO_CONDITION, $this->cto_condition);
+ }
+
+ if ($this->isColumnModified(CaseTrackerObjectPeer::CTO_POSITION)) {
+ $criteria->add(CaseTrackerObjectPeer::CTO_POSITION, $this->cto_position);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(CaseTrackerObjectPeer::DATABASE_NAME);
+
+ $criteria->add(CaseTrackerObjectPeer::CTO_UID, $this->cto_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getCtoUid();
+ }
+
+ /**
+ * Generic method to set the primary key (cto_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setCtoUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of CaseTrackerObject (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setCtoTypeObj($this->cto_type_obj);
+
+ $copyObj->setCtoUidObj($this->cto_uid_obj);
+
+ $copyObj->setCtoCondition($this->cto_condition);
+
+ $copyObj->setCtoPosition($this->cto_position);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setCtoUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return CaseTrackerObject Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return CaseTrackerObjectPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new CaseTrackerObjectPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseCaseTrackerObjectPeer.php b/workflow/engine/classes/model/om/BaseCaseTrackerObjectPeer.php
index 228fb9600..cf489c93a 100755
--- a/workflow/engine/classes/model/om/BaseCaseTrackerObjectPeer.php
+++ b/workflow/engine/classes/model/om/BaseCaseTrackerObjectPeer.php
@@ -12,582 +12,584 @@ include_once 'classes/model/CaseTrackerObject.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCaseTrackerObjectPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'CASE_TRACKER_OBJECT';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.CaseTrackerObject';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 6;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the CTO_UID field */
- const CTO_UID = 'CASE_TRACKER_OBJECT.CTO_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'CASE_TRACKER_OBJECT.PRO_UID';
-
- /** the column name for the CTO_TYPE_OBJ field */
- const CTO_TYPE_OBJ = 'CASE_TRACKER_OBJECT.CTO_TYPE_OBJ';
-
- /** the column name for the CTO_UID_OBJ field */
- const CTO_UID_OBJ = 'CASE_TRACKER_OBJECT.CTO_UID_OBJ';
-
- /** the column name for the CTO_CONDITION field */
- const CTO_CONDITION = 'CASE_TRACKER_OBJECT.CTO_CONDITION';
-
- /** the column name for the CTO_POSITION field */
- const CTO_POSITION = 'CASE_TRACKER_OBJECT.CTO_POSITION';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('CtoUid', 'ProUid', 'CtoTypeObj', 'CtoUidObj', 'CtoCondition', 'CtoPosition', ),
- BasePeer::TYPE_COLNAME => array (CaseTrackerObjectPeer::CTO_UID, CaseTrackerObjectPeer::PRO_UID, CaseTrackerObjectPeer::CTO_TYPE_OBJ, CaseTrackerObjectPeer::CTO_UID_OBJ, CaseTrackerObjectPeer::CTO_CONDITION, CaseTrackerObjectPeer::CTO_POSITION, ),
- BasePeer::TYPE_FIELDNAME => array ('CTO_UID', 'PRO_UID', 'CTO_TYPE_OBJ', 'CTO_UID_OBJ', 'CTO_CONDITION', 'CTO_POSITION', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('CtoUid' => 0, 'ProUid' => 1, 'CtoTypeObj' => 2, 'CtoUidObj' => 3, 'CtoCondition' => 4, 'CtoPosition' => 5, ),
- BasePeer::TYPE_COLNAME => array (CaseTrackerObjectPeer::CTO_UID => 0, CaseTrackerObjectPeer::PRO_UID => 1, CaseTrackerObjectPeer::CTO_TYPE_OBJ => 2, CaseTrackerObjectPeer::CTO_UID_OBJ => 3, CaseTrackerObjectPeer::CTO_CONDITION => 4, CaseTrackerObjectPeer::CTO_POSITION => 5, ),
- BasePeer::TYPE_FIELDNAME => array ('CTO_UID' => 0, 'PRO_UID' => 1, 'CTO_TYPE_OBJ' => 2, 'CTO_UID_OBJ' => 3, 'CTO_CONDITION' => 4, 'CTO_POSITION' => 5, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/CaseTrackerObjectMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.CaseTrackerObjectMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = CaseTrackerObjectPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CaseTrackerObjectPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CaseTrackerObjectPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_UID);
-
- $criteria->addSelectColumn(CaseTrackerObjectPeer::PRO_UID);
-
- $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_TYPE_OBJ);
-
- $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_UID_OBJ);
-
- $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_CONDITION);
-
- $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_POSITION);
-
- }
-
- const COUNT = 'COUNT(CASE_TRACKER_OBJECT.CTO_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CASE_TRACKER_OBJECT.CTO_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(CaseTrackerObjectPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(CaseTrackerObjectPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = CaseTrackerObjectPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return CaseTrackerObject
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CaseTrackerObjectPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return CaseTrackerObjectPeer::populateObjects(CaseTrackerObjectPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- CaseTrackerObjectPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CaseTrackerObjectPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return CaseTrackerObjectPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a CaseTrackerObject or Criteria object.
- *
- * @param mixed $values Criteria or CaseTrackerObject object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CaseTrackerObject object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a CaseTrackerObject or Criteria object.
- *
- * @param mixed $values Criteria or CaseTrackerObject object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CaseTrackerObjectPeer::CTO_UID);
- $selectCriteria->add(CaseTrackerObjectPeer::CTO_UID, $criteria->remove(CaseTrackerObjectPeer::CTO_UID), $comparison);
-
- } else { // $values is CaseTrackerObject object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CASE_TRACKER_OBJECT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(CaseTrackerObjectPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a CaseTrackerObject or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CaseTrackerObject object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof CaseTrackerObject) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(CaseTrackerObjectPeer::CTO_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CaseTrackerObject object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CaseTrackerObject $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(CaseTrackerObject $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CaseTrackerObjectPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CaseTrackerObjectPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(CaseTrackerObjectPeer::CTO_TYPE_OBJ))
- $columns[CaseTrackerObjectPeer::CTO_TYPE_OBJ] = $obj->getCtoTypeObj();
-
- }
-
- return BasePeer::doValidate(CaseTrackerObjectPeer::DATABASE_NAME, CaseTrackerObjectPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return CaseTrackerObject
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(CaseTrackerObjectPeer::DATABASE_NAME);
-
- $criteria->add(CaseTrackerObjectPeer::CTO_UID, $pk);
-
-
- $v = CaseTrackerObjectPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(CaseTrackerObjectPeer::CTO_UID, $pks, Criteria::IN);
- $objs = CaseTrackerObjectPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseCaseTrackerObjectPeer
+abstract class BaseCaseTrackerObjectPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'CASE_TRACKER_OBJECT';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.CaseTrackerObject';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 6;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the CTO_UID field */
+ const CTO_UID = 'CASE_TRACKER_OBJECT.CTO_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'CASE_TRACKER_OBJECT.PRO_UID';
+
+ /** the column name for the CTO_TYPE_OBJ field */
+ const CTO_TYPE_OBJ = 'CASE_TRACKER_OBJECT.CTO_TYPE_OBJ';
+
+ /** the column name for the CTO_UID_OBJ field */
+ const CTO_UID_OBJ = 'CASE_TRACKER_OBJECT.CTO_UID_OBJ';
+
+ /** the column name for the CTO_CONDITION field */
+ const CTO_CONDITION = 'CASE_TRACKER_OBJECT.CTO_CONDITION';
+
+ /** the column name for the CTO_POSITION field */
+ const CTO_POSITION = 'CASE_TRACKER_OBJECT.CTO_POSITION';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('CtoUid', 'ProUid', 'CtoTypeObj', 'CtoUidObj', 'CtoCondition', 'CtoPosition', ),
+ BasePeer::TYPE_COLNAME => array (CaseTrackerObjectPeer::CTO_UID, CaseTrackerObjectPeer::PRO_UID, CaseTrackerObjectPeer::CTO_TYPE_OBJ, CaseTrackerObjectPeer::CTO_UID_OBJ, CaseTrackerObjectPeer::CTO_CONDITION, CaseTrackerObjectPeer::CTO_POSITION, ),
+ BasePeer::TYPE_FIELDNAME => array ('CTO_UID', 'PRO_UID', 'CTO_TYPE_OBJ', 'CTO_UID_OBJ', 'CTO_CONDITION', 'CTO_POSITION', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('CtoUid' => 0, 'ProUid' => 1, 'CtoTypeObj' => 2, 'CtoUidObj' => 3, 'CtoCondition' => 4, 'CtoPosition' => 5, ),
+ BasePeer::TYPE_COLNAME => array (CaseTrackerObjectPeer::CTO_UID => 0, CaseTrackerObjectPeer::PRO_UID => 1, CaseTrackerObjectPeer::CTO_TYPE_OBJ => 2, CaseTrackerObjectPeer::CTO_UID_OBJ => 3, CaseTrackerObjectPeer::CTO_CONDITION => 4, CaseTrackerObjectPeer::CTO_POSITION => 5, ),
+ BasePeer::TYPE_FIELDNAME => array ('CTO_UID' => 0, 'PRO_UID' => 1, 'CTO_TYPE_OBJ' => 2, 'CTO_UID_OBJ' => 3, 'CTO_CONDITION' => 4, 'CTO_POSITION' => 5, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/CaseTrackerObjectMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.CaseTrackerObjectMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = CaseTrackerObjectPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. CaseTrackerObjectPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(CaseTrackerObjectPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_UID);
+
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::PRO_UID);
+
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_TYPE_OBJ);
+
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_UID_OBJ);
+
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_CONDITION);
+
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::CTO_POSITION);
+
+ }
+
+ const COUNT = 'COUNT(CASE_TRACKER_OBJECT.CTO_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CASE_TRACKER_OBJECT.CTO_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(CaseTrackerObjectPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = CaseTrackerObjectPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return CaseTrackerObject
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = CaseTrackerObjectPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return CaseTrackerObjectPeer::populateObjects(CaseTrackerObjectPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ CaseTrackerObjectPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = CaseTrackerObjectPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return CaseTrackerObjectPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a CaseTrackerObject or Criteria object.
+ *
+ * @param mixed $values Criteria or CaseTrackerObject object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from CaseTrackerObject object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a CaseTrackerObject or Criteria object.
+ *
+ * @param mixed $values Criteria or CaseTrackerObject object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(CaseTrackerObjectPeer::CTO_UID);
+ $selectCriteria->add(CaseTrackerObjectPeer::CTO_UID, $criteria->remove(CaseTrackerObjectPeer::CTO_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CASE_TRACKER_OBJECT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(CaseTrackerObjectPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a CaseTrackerObject or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CaseTrackerObject object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof CaseTrackerObject) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(CaseTrackerObjectPeer::CTO_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given CaseTrackerObject object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param CaseTrackerObject $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(CaseTrackerObject $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(CaseTrackerObjectPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(CaseTrackerObjectPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(CaseTrackerObjectPeer::CTO_TYPE_OBJ))
+ $columns[CaseTrackerObjectPeer::CTO_TYPE_OBJ] = $obj->getCtoTypeObj();
+
+ }
+
+ return BasePeer::doValidate(CaseTrackerObjectPeer::DATABASE_NAME, CaseTrackerObjectPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return CaseTrackerObject
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(CaseTrackerObjectPeer::DATABASE_NAME);
+
+ $criteria->add(CaseTrackerObjectPeer::CTO_UID, $pk);
+
+
+ $v = CaseTrackerObjectPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(CaseTrackerObjectPeer::CTO_UID, $pks, Criteria::IN);
+ $objs = CaseTrackerObjectPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseCaseTrackerObjectPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseCaseTrackerObjectPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/CaseTrackerObjectMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.CaseTrackerObjectMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/CaseTrackerObjectMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.CaseTrackerObjectMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseCaseTrackerPeer.php b/workflow/engine/classes/model/om/BaseCaseTrackerPeer.php
index 5636311d3..45ae1b2af 100755
--- a/workflow/engine/classes/model/om/BaseCaseTrackerPeer.php
+++ b/workflow/engine/classes/model/om/BaseCaseTrackerPeer.php
@@ -12,581 +12,583 @@ include_once 'classes/model/CaseTracker.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseCaseTrackerPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'CASE_TRACKER';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.CaseTracker';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'CASE_TRACKER.PRO_UID';
-
- /** the column name for the CT_MAP_TYPE field */
- const CT_MAP_TYPE = 'CASE_TRACKER.CT_MAP_TYPE';
-
- /** the column name for the CT_DERIVATION_HISTORY field */
- const CT_DERIVATION_HISTORY = 'CASE_TRACKER.CT_DERIVATION_HISTORY';
-
- /** the column name for the CT_MESSAGE_HISTORY field */
- const CT_MESSAGE_HISTORY = 'CASE_TRACKER.CT_MESSAGE_HISTORY';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('ProUid', 'CtMapType', 'CtDerivationHistory', 'CtMessageHistory', ),
- BasePeer::TYPE_COLNAME => array (CaseTrackerPeer::PRO_UID, CaseTrackerPeer::CT_MAP_TYPE, CaseTrackerPeer::CT_DERIVATION_HISTORY, CaseTrackerPeer::CT_MESSAGE_HISTORY, ),
- BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'CT_MAP_TYPE', 'CT_DERIVATION_HISTORY', 'CT_MESSAGE_HISTORY', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'CtMapType' => 1, 'CtDerivationHistory' => 2, 'CtMessageHistory' => 3, ),
- BasePeer::TYPE_COLNAME => array (CaseTrackerPeer::PRO_UID => 0, CaseTrackerPeer::CT_MAP_TYPE => 1, CaseTrackerPeer::CT_DERIVATION_HISTORY => 2, CaseTrackerPeer::CT_MESSAGE_HISTORY => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'CT_MAP_TYPE' => 1, 'CT_DERIVATION_HISTORY' => 2, 'CT_MESSAGE_HISTORY' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/CaseTrackerMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.CaseTrackerMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = CaseTrackerPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CaseTrackerPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CaseTrackerPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(CaseTrackerPeer::PRO_UID);
-
- $criteria->addSelectColumn(CaseTrackerPeer::CT_MAP_TYPE);
-
- $criteria->addSelectColumn(CaseTrackerPeer::CT_DERIVATION_HISTORY);
-
- $criteria->addSelectColumn(CaseTrackerPeer::CT_MESSAGE_HISTORY);
-
- }
-
- const COUNT = 'COUNT(CASE_TRACKER.PRO_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CASE_TRACKER.PRO_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(CaseTrackerPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(CaseTrackerPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = CaseTrackerPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return CaseTracker
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CaseTrackerPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return CaseTrackerPeer::populateObjects(CaseTrackerPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- CaseTrackerPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CaseTrackerPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return CaseTrackerPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a CaseTracker or Criteria object.
- *
- * @param mixed $values Criteria or CaseTracker object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CaseTracker object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a CaseTracker or Criteria object.
- *
- * @param mixed $values Criteria or CaseTracker object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CaseTrackerPeer::PRO_UID);
- $selectCriteria->add(CaseTrackerPeer::PRO_UID, $criteria->remove(CaseTrackerPeer::PRO_UID), $comparison);
-
- } else { // $values is CaseTracker object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CASE_TRACKER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(CaseTrackerPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a CaseTracker or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CaseTracker object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof CaseTracker) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(CaseTrackerPeer::PRO_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CaseTracker object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CaseTracker $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(CaseTracker $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CaseTrackerPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CaseTrackerPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::PRO_UID))
- $columns[CaseTrackerPeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::CT_MAP_TYPE))
- $columns[CaseTrackerPeer::CT_MAP_TYPE] = $obj->getCtMapType();
-
- if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::CT_DERIVATION_HISTORY))
- $columns[CaseTrackerPeer::CT_DERIVATION_HISTORY] = $obj->getCtDerivationHistory();
-
- if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::CT_MESSAGE_HISTORY))
- $columns[CaseTrackerPeer::CT_MESSAGE_HISTORY] = $obj->getCtMessageHistory();
-
- }
-
- return BasePeer::doValidate(CaseTrackerPeer::DATABASE_NAME, CaseTrackerPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return CaseTracker
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(CaseTrackerPeer::DATABASE_NAME);
-
- $criteria->add(CaseTrackerPeer::PRO_UID, $pk);
-
-
- $v = CaseTrackerPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(CaseTrackerPeer::PRO_UID, $pks, Criteria::IN);
- $objs = CaseTrackerPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseCaseTrackerPeer
+abstract class BaseCaseTrackerPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'CASE_TRACKER';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.CaseTracker';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'CASE_TRACKER.PRO_UID';
+
+ /** the column name for the CT_MAP_TYPE field */
+ const CT_MAP_TYPE = 'CASE_TRACKER.CT_MAP_TYPE';
+
+ /** the column name for the CT_DERIVATION_HISTORY field */
+ const CT_DERIVATION_HISTORY = 'CASE_TRACKER.CT_DERIVATION_HISTORY';
+
+ /** the column name for the CT_MESSAGE_HISTORY field */
+ const CT_MESSAGE_HISTORY = 'CASE_TRACKER.CT_MESSAGE_HISTORY';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('ProUid', 'CtMapType', 'CtDerivationHistory', 'CtMessageHistory', ),
+ BasePeer::TYPE_COLNAME => array (CaseTrackerPeer::PRO_UID, CaseTrackerPeer::CT_MAP_TYPE, CaseTrackerPeer::CT_DERIVATION_HISTORY, CaseTrackerPeer::CT_MESSAGE_HISTORY, ),
+ BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'CT_MAP_TYPE', 'CT_DERIVATION_HISTORY', 'CT_MESSAGE_HISTORY', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'CtMapType' => 1, 'CtDerivationHistory' => 2, 'CtMessageHistory' => 3, ),
+ BasePeer::TYPE_COLNAME => array (CaseTrackerPeer::PRO_UID => 0, CaseTrackerPeer::CT_MAP_TYPE => 1, CaseTrackerPeer::CT_DERIVATION_HISTORY => 2, CaseTrackerPeer::CT_MESSAGE_HISTORY => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'CT_MAP_TYPE' => 1, 'CT_DERIVATION_HISTORY' => 2, 'CT_MESSAGE_HISTORY' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/CaseTrackerMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.CaseTrackerMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = CaseTrackerPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. CaseTrackerPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(CaseTrackerPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(CaseTrackerPeer::PRO_UID);
+
+ $criteria->addSelectColumn(CaseTrackerPeer::CT_MAP_TYPE);
+
+ $criteria->addSelectColumn(CaseTrackerPeer::CT_DERIVATION_HISTORY);
+
+ $criteria->addSelectColumn(CaseTrackerPeer::CT_MESSAGE_HISTORY);
+
+ }
+
+ const COUNT = 'COUNT(CASE_TRACKER.PRO_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CASE_TRACKER.PRO_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(CaseTrackerPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(CaseTrackerPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = CaseTrackerPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return CaseTracker
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = CaseTrackerPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return CaseTrackerPeer::populateObjects(CaseTrackerPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ CaseTrackerPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = CaseTrackerPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return CaseTrackerPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a CaseTracker or Criteria object.
+ *
+ * @param mixed $values Criteria or CaseTracker object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from CaseTracker object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a CaseTracker or Criteria object.
+ *
+ * @param mixed $values Criteria or CaseTracker object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(CaseTrackerPeer::PRO_UID);
+ $selectCriteria->add(CaseTrackerPeer::PRO_UID, $criteria->remove(CaseTrackerPeer::PRO_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CASE_TRACKER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(CaseTrackerPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a CaseTracker or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or CaseTracker object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof CaseTracker) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(CaseTrackerPeer::PRO_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given CaseTracker object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param CaseTracker $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(CaseTracker $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(CaseTrackerPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(CaseTrackerPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::PRO_UID))
+ $columns[CaseTrackerPeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::CT_MAP_TYPE))
+ $columns[CaseTrackerPeer::CT_MAP_TYPE] = $obj->getCtMapType();
+
+ if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::CT_DERIVATION_HISTORY))
+ $columns[CaseTrackerPeer::CT_DERIVATION_HISTORY] = $obj->getCtDerivationHistory();
+
+ if ($obj->isNew() || $obj->isColumnModified(CaseTrackerPeer::CT_MESSAGE_HISTORY))
+ $columns[CaseTrackerPeer::CT_MESSAGE_HISTORY] = $obj->getCtMessageHistory();
+
+ }
+
+ return BasePeer::doValidate(CaseTrackerPeer::DATABASE_NAME, CaseTrackerPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return CaseTracker
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(CaseTrackerPeer::DATABASE_NAME);
+
+ $criteria->add(CaseTrackerPeer::PRO_UID, $pk);
+
+
+ $v = CaseTrackerPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(CaseTrackerPeer::PRO_UID, $pks, Criteria::IN);
+ $objs = CaseTrackerPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseCaseTrackerPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseCaseTrackerPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/CaseTrackerMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.CaseTrackerMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/CaseTrackerMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.CaseTrackerMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseConfiguration.php b/workflow/engine/classes/model/om/BaseConfiguration.php
index 68bf2c57b..7c5e79a84 100755
--- a/workflow/engine/classes/model/om/BaseConfiguration.php
+++ b/workflow/engine/classes/model/om/BaseConfiguration.php
@@ -16,781 +16,812 @@ include_once 'classes/model/ConfigurationPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseConfiguration extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ConfigurationPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the cfg_uid field.
- * @var string
- */
- protected $cfg_uid = '';
-
-
- /**
- * The value for the obj_uid field.
- * @var string
- */
- protected $obj_uid = '';
-
-
- /**
- * The value for the cfg_value field.
- * @var string
- */
- protected $cfg_value;
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [cfg_uid] column value.
- *
- * @return string
- */
- public function getCfgUid()
- {
-
- return $this->cfg_uid;
- }
-
- /**
- * Get the [obj_uid] column value.
- *
- * @return string
- */
- public function getObjUid()
- {
-
- return $this->obj_uid;
- }
-
- /**
- * Get the [cfg_value] column value.
- *
- * @return string
- */
- public function getCfgValue()
- {
-
- return $this->cfg_value;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Set the value of [cfg_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCfgUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->cfg_uid !== $v || $v === '') {
- $this->cfg_uid = $v;
- $this->modifiedColumns[] = ConfigurationPeer::CFG_UID;
- }
-
- } // setCfgUid()
-
- /**
- * Set the value of [obj_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setObjUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->obj_uid !== $v || $v === '') {
- $this->obj_uid = $v;
- $this->modifiedColumns[] = ConfigurationPeer::OBJ_UID;
- }
-
- } // setObjUid()
-
- /**
- * Set the value of [cfg_value] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCfgValue($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->cfg_value !== $v) {
- $this->cfg_value = $v;
- $this->modifiedColumns[] = ConfigurationPeer::CFG_VALUE;
- }
-
- } // setCfgValue()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ConfigurationPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = ConfigurationPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = ConfigurationPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->cfg_uid = $rs->getString($startcol + 0);
-
- $this->obj_uid = $rs->getString($startcol + 1);
-
- $this->cfg_value = $rs->getString($startcol + 2);
-
- $this->pro_uid = $rs->getString($startcol + 3);
-
- $this->usr_uid = $rs->getString($startcol + 4);
-
- $this->app_uid = $rs->getString($startcol + 5);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 6; // 6 = ConfigurationPeer::NUM_COLUMNS - ConfigurationPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Configuration object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ConfigurationPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ConfigurationPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ConfigurationPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ConfigurationPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ConfigurationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getCfgUid();
- break;
- case 1:
- return $this->getObjUid();
- break;
- case 2:
- return $this->getCfgValue();
- break;
- case 3:
- return $this->getProUid();
- break;
- case 4:
- return $this->getUsrUid();
- break;
- case 5:
- return $this->getAppUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ConfigurationPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getCfgUid(),
- $keys[1] => $this->getObjUid(),
- $keys[2] => $this->getCfgValue(),
- $keys[3] => $this->getProUid(),
- $keys[4] => $this->getUsrUid(),
- $keys[5] => $this->getAppUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ConfigurationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setCfgUid($value);
- break;
- case 1:
- $this->setObjUid($value);
- break;
- case 2:
- $this->setCfgValue($value);
- break;
- case 3:
- $this->setProUid($value);
- break;
- case 4:
- $this->setUsrUid($value);
- break;
- case 5:
- $this->setAppUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ConfigurationPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setCfgUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setObjUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCfgValue($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setProUid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setUsrUid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setAppUid($arr[$keys[5]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ConfigurationPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ConfigurationPeer::CFG_UID)) $criteria->add(ConfigurationPeer::CFG_UID, $this->cfg_uid);
- if ($this->isColumnModified(ConfigurationPeer::OBJ_UID)) $criteria->add(ConfigurationPeer::OBJ_UID, $this->obj_uid);
- if ($this->isColumnModified(ConfigurationPeer::CFG_VALUE)) $criteria->add(ConfigurationPeer::CFG_VALUE, $this->cfg_value);
- if ($this->isColumnModified(ConfigurationPeer::PRO_UID)) $criteria->add(ConfigurationPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(ConfigurationPeer::USR_UID)) $criteria->add(ConfigurationPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(ConfigurationPeer::APP_UID)) $criteria->add(ConfigurationPeer::APP_UID, $this->app_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ConfigurationPeer::DATABASE_NAME);
-
- $criteria->add(ConfigurationPeer::CFG_UID, $this->cfg_uid);
- $criteria->add(ConfigurationPeer::OBJ_UID, $this->obj_uid);
- $criteria->add(ConfigurationPeer::PRO_UID, $this->pro_uid);
- $criteria->add(ConfigurationPeer::USR_UID, $this->usr_uid);
- $criteria->add(ConfigurationPeer::APP_UID, $this->app_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getCfgUid();
-
- $pks[1] = $this->getObjUid();
-
- $pks[2] = $this->getProUid();
-
- $pks[3] = $this->getUsrUid();
-
- $pks[4] = $this->getAppUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setCfgUid($keys[0]);
-
- $this->setObjUid($keys[1]);
-
- $this->setProUid($keys[2]);
-
- $this->setUsrUid($keys[3]);
-
- $this->setAppUid($keys[4]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Configuration (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setCfgValue($this->cfg_value);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setCfgUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setObjUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setProUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Configuration Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ConfigurationPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ConfigurationPeer();
- }
- return self::$peer;
- }
+abstract class BaseConfiguration extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ConfigurationPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the cfg_uid field.
+ * @var string
+ */
+ protected $cfg_uid = '';
+
+ /**
+ * The value for the obj_uid field.
+ * @var string
+ */
+ protected $obj_uid = '';
+
+ /**
+ * The value for the cfg_value field.
+ * @var string
+ */
+ protected $cfg_value;
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [cfg_uid] column value.
+ *
+ * @return string
+ */
+ public function getCfgUid()
+ {
+
+ return $this->cfg_uid;
+ }
+
+ /**
+ * Get the [obj_uid] column value.
+ *
+ * @return string
+ */
+ public function getObjUid()
+ {
+
+ return $this->obj_uid;
+ }
+
+ /**
+ * Get the [cfg_value] column value.
+ *
+ * @return string
+ */
+ public function getCfgValue()
+ {
+
+ return $this->cfg_value;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Set the value of [cfg_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCfgUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->cfg_uid !== $v || $v === '') {
+ $this->cfg_uid = $v;
+ $this->modifiedColumns[] = ConfigurationPeer::CFG_UID;
+ }
+
+ } // setCfgUid()
+
+ /**
+ * Set the value of [obj_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setObjUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->obj_uid !== $v || $v === '') {
+ $this->obj_uid = $v;
+ $this->modifiedColumns[] = ConfigurationPeer::OBJ_UID;
+ }
+
+ } // setObjUid()
+
+ /**
+ * Set the value of [cfg_value] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCfgValue($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->cfg_value !== $v) {
+ $this->cfg_value = $v;
+ $this->modifiedColumns[] = ConfigurationPeer::CFG_VALUE;
+ }
+
+ } // setCfgValue()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ConfigurationPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = ConfigurationPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = ConfigurationPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->cfg_uid = $rs->getString($startcol + 0);
+
+ $this->obj_uid = $rs->getString($startcol + 1);
+
+ $this->cfg_value = $rs->getString($startcol + 2);
+
+ $this->pro_uid = $rs->getString($startcol + 3);
+
+ $this->usr_uid = $rs->getString($startcol + 4);
+
+ $this->app_uid = $rs->getString($startcol + 5);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 6; // 6 = ConfigurationPeer::NUM_COLUMNS - ConfigurationPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Configuration object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ConfigurationPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ConfigurationPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ConfigurationPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ConfigurationPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ConfigurationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getCfgUid();
+ break;
+ case 1:
+ return $this->getObjUid();
+ break;
+ case 2:
+ return $this->getCfgValue();
+ break;
+ case 3:
+ return $this->getProUid();
+ break;
+ case 4:
+ return $this->getUsrUid();
+ break;
+ case 5:
+ return $this->getAppUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ConfigurationPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getCfgUid(),
+ $keys[1] => $this->getObjUid(),
+ $keys[2] => $this->getCfgValue(),
+ $keys[3] => $this->getProUid(),
+ $keys[4] => $this->getUsrUid(),
+ $keys[5] => $this->getAppUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ConfigurationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setCfgUid($value);
+ break;
+ case 1:
+ $this->setObjUid($value);
+ break;
+ case 2:
+ $this->setCfgValue($value);
+ break;
+ case 3:
+ $this->setProUid($value);
+ break;
+ case 4:
+ $this->setUsrUid($value);
+ break;
+ case 5:
+ $this->setAppUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ConfigurationPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setCfgUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setObjUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setCfgValue($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setProUid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setUsrUid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setAppUid($arr[$keys[5]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ConfigurationPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ConfigurationPeer::CFG_UID)) {
+ $criteria->add(ConfigurationPeer::CFG_UID, $this->cfg_uid);
+ }
+
+ if ($this->isColumnModified(ConfigurationPeer::OBJ_UID)) {
+ $criteria->add(ConfigurationPeer::OBJ_UID, $this->obj_uid);
+ }
+
+ if ($this->isColumnModified(ConfigurationPeer::CFG_VALUE)) {
+ $criteria->add(ConfigurationPeer::CFG_VALUE, $this->cfg_value);
+ }
+
+ if ($this->isColumnModified(ConfigurationPeer::PRO_UID)) {
+ $criteria->add(ConfigurationPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(ConfigurationPeer::USR_UID)) {
+ $criteria->add(ConfigurationPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(ConfigurationPeer::APP_UID)) {
+ $criteria->add(ConfigurationPeer::APP_UID, $this->app_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ConfigurationPeer::DATABASE_NAME);
+
+ $criteria->add(ConfigurationPeer::CFG_UID, $this->cfg_uid);
+ $criteria->add(ConfigurationPeer::OBJ_UID, $this->obj_uid);
+ $criteria->add(ConfigurationPeer::PRO_UID, $this->pro_uid);
+ $criteria->add(ConfigurationPeer::USR_UID, $this->usr_uid);
+ $criteria->add(ConfigurationPeer::APP_UID, $this->app_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getCfgUid();
+
+ $pks[1] = $this->getObjUid();
+
+ $pks[2] = $this->getProUid();
+
+ $pks[3] = $this->getUsrUid();
+
+ $pks[4] = $this->getAppUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setCfgUid($keys[0]);
+
+ $this->setObjUid($keys[1]);
+
+ $this->setProUid($keys[2]);
+
+ $this->setUsrUid($keys[3]);
+
+ $this->setAppUid($keys[4]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Configuration (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setCfgValue($this->cfg_value);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setCfgUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setObjUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setProUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Configuration Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ConfigurationPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ConfigurationPeer();
+ }
+ return self::$peer;
+ }
+}
-} // BaseConfiguration
diff --git a/workflow/engine/classes/model/om/BaseConfigurationPeer.php b/workflow/engine/classes/model/om/BaseConfigurationPeer.php
index 7351ba1db..d13dbb896 100755
--- a/workflow/engine/classes/model/om/BaseConfigurationPeer.php
+++ b/workflow/engine/classes/model/om/BaseConfigurationPeer.php
@@ -12,591 +12,592 @@ include_once 'classes/model/Configuration.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseConfigurationPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'CONFIGURATION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Configuration';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 6;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the CFG_UID field */
- const CFG_UID = 'CONFIGURATION.CFG_UID';
-
- /** the column name for the OBJ_UID field */
- const OBJ_UID = 'CONFIGURATION.OBJ_UID';
-
- /** the column name for the CFG_VALUE field */
- const CFG_VALUE = 'CONFIGURATION.CFG_VALUE';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'CONFIGURATION.PRO_UID';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'CONFIGURATION.USR_UID';
-
- /** the column name for the APP_UID field */
- const APP_UID = 'CONFIGURATION.APP_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('CfgUid', 'ObjUid', 'CfgValue', 'ProUid', 'UsrUid', 'AppUid', ),
- BasePeer::TYPE_COLNAME => array (ConfigurationPeer::CFG_UID, ConfigurationPeer::OBJ_UID, ConfigurationPeer::CFG_VALUE, ConfigurationPeer::PRO_UID, ConfigurationPeer::USR_UID, ConfigurationPeer::APP_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('CFG_UID', 'OBJ_UID', 'CFG_VALUE', 'PRO_UID', 'USR_UID', 'APP_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('CfgUid' => 0, 'ObjUid' => 1, 'CfgValue' => 2, 'ProUid' => 3, 'UsrUid' => 4, 'AppUid' => 5, ),
- BasePeer::TYPE_COLNAME => array (ConfigurationPeer::CFG_UID => 0, ConfigurationPeer::OBJ_UID => 1, ConfigurationPeer::CFG_VALUE => 2, ConfigurationPeer::PRO_UID => 3, ConfigurationPeer::USR_UID => 4, ConfigurationPeer::APP_UID => 5, ),
- BasePeer::TYPE_FIELDNAME => array ('CFG_UID' => 0, 'OBJ_UID' => 1, 'CFG_VALUE' => 2, 'PRO_UID' => 3, 'USR_UID' => 4, 'APP_UID' => 5, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ConfigurationMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ConfigurationMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ConfigurationPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ConfigurationPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ConfigurationPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ConfigurationPeer::CFG_UID);
-
- $criteria->addSelectColumn(ConfigurationPeer::OBJ_UID);
-
- $criteria->addSelectColumn(ConfigurationPeer::CFG_VALUE);
-
- $criteria->addSelectColumn(ConfigurationPeer::PRO_UID);
-
- $criteria->addSelectColumn(ConfigurationPeer::USR_UID);
-
- $criteria->addSelectColumn(ConfigurationPeer::APP_UID);
-
- }
-
- const COUNT = 'COUNT(CONFIGURATION.CFG_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CONFIGURATION.CFG_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ConfigurationPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ConfigurationPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ConfigurationPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Configuration
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ConfigurationPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ConfigurationPeer::populateObjects(ConfigurationPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ConfigurationPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ConfigurationPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ConfigurationPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Configuration or Criteria object.
- *
- * @param mixed $values Criteria or Configuration object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Configuration object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Configuration or Criteria object.
- *
- * @param mixed $values Criteria or Configuration object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ConfigurationPeer::CFG_UID);
- $selectCriteria->add(ConfigurationPeer::CFG_UID, $criteria->remove(ConfigurationPeer::CFG_UID), $comparison);
-
- $comparison = $criteria->getComparison(ConfigurationPeer::OBJ_UID);
- $selectCriteria->add(ConfigurationPeer::OBJ_UID, $criteria->remove(ConfigurationPeer::OBJ_UID), $comparison);
-
- $comparison = $criteria->getComparison(ConfigurationPeer::PRO_UID);
- $selectCriteria->add(ConfigurationPeer::PRO_UID, $criteria->remove(ConfigurationPeer::PRO_UID), $comparison);
-
- $comparison = $criteria->getComparison(ConfigurationPeer::USR_UID);
- $selectCriteria->add(ConfigurationPeer::USR_UID, $criteria->remove(ConfigurationPeer::USR_UID), $comparison);
-
- $comparison = $criteria->getComparison(ConfigurationPeer::APP_UID);
- $selectCriteria->add(ConfigurationPeer::APP_UID, $criteria->remove(ConfigurationPeer::APP_UID), $comparison);
-
- } else { // $values is Configuration object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CONFIGURATION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ConfigurationPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Configuration or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Configuration object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Configuration) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- $vals[3][] = $value[3];
- $vals[4][] = $value[4];
- }
-
- $criteria->add(ConfigurationPeer::CFG_UID, $vals[0], Criteria::IN);
- $criteria->add(ConfigurationPeer::OBJ_UID, $vals[1], Criteria::IN);
- $criteria->add(ConfigurationPeer::PRO_UID, $vals[2], Criteria::IN);
- $criteria->add(ConfigurationPeer::USR_UID, $vals[3], Criteria::IN);
- $criteria->add(ConfigurationPeer::APP_UID, $vals[4], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Configuration object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Configuration $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Configuration $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ConfigurationPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ConfigurationPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(ConfigurationPeer::DATABASE_NAME, ConfigurationPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $cfg_uid
- @param string $obj_uid
- @param string $pro_uid
- @param string $usr_uid
- @param string $app_uid
-
- * @param Connection $con
- * @return Configuration
- */
- public static function retrieveByPK( $cfg_uid, $obj_uid, $pro_uid, $usr_uid, $app_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(ConfigurationPeer::CFG_UID, $cfg_uid);
- $criteria->add(ConfigurationPeer::OBJ_UID, $obj_uid);
- $criteria->add(ConfigurationPeer::PRO_UID, $pro_uid);
- $criteria->add(ConfigurationPeer::USR_UID, $usr_uid);
- $criteria->add(ConfigurationPeer::APP_UID, $app_uid);
- $v = ConfigurationPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseConfigurationPeer
+abstract class BaseConfigurationPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'CONFIGURATION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Configuration';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 6;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the CFG_UID field */
+ const CFG_UID = 'CONFIGURATION.CFG_UID';
+
+ /** the column name for the OBJ_UID field */
+ const OBJ_UID = 'CONFIGURATION.OBJ_UID';
+
+ /** the column name for the CFG_VALUE field */
+ const CFG_VALUE = 'CONFIGURATION.CFG_VALUE';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'CONFIGURATION.PRO_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'CONFIGURATION.USR_UID';
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'CONFIGURATION.APP_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('CfgUid', 'ObjUid', 'CfgValue', 'ProUid', 'UsrUid', 'AppUid', ),
+ BasePeer::TYPE_COLNAME => array (ConfigurationPeer::CFG_UID, ConfigurationPeer::OBJ_UID, ConfigurationPeer::CFG_VALUE, ConfigurationPeer::PRO_UID, ConfigurationPeer::USR_UID, ConfigurationPeer::APP_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('CFG_UID', 'OBJ_UID', 'CFG_VALUE', 'PRO_UID', 'USR_UID', 'APP_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('CfgUid' => 0, 'ObjUid' => 1, 'CfgValue' => 2, 'ProUid' => 3, 'UsrUid' => 4, 'AppUid' => 5, ),
+ BasePeer::TYPE_COLNAME => array (ConfigurationPeer::CFG_UID => 0, ConfigurationPeer::OBJ_UID => 1, ConfigurationPeer::CFG_VALUE => 2, ConfigurationPeer::PRO_UID => 3, ConfigurationPeer::USR_UID => 4, ConfigurationPeer::APP_UID => 5, ),
+ BasePeer::TYPE_FIELDNAME => array ('CFG_UID' => 0, 'OBJ_UID' => 1, 'CFG_VALUE' => 2, 'PRO_UID' => 3, 'USR_UID' => 4, 'APP_UID' => 5, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ConfigurationMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ConfigurationMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ConfigurationPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ConfigurationPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ConfigurationPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ConfigurationPeer::CFG_UID);
+
+ $criteria->addSelectColumn(ConfigurationPeer::OBJ_UID);
+
+ $criteria->addSelectColumn(ConfigurationPeer::CFG_VALUE);
+
+ $criteria->addSelectColumn(ConfigurationPeer::PRO_UID);
+
+ $criteria->addSelectColumn(ConfigurationPeer::USR_UID);
+
+ $criteria->addSelectColumn(ConfigurationPeer::APP_UID);
+
+ }
+
+ const COUNT = 'COUNT(CONFIGURATION.CFG_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CONFIGURATION.CFG_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ConfigurationPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ConfigurationPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ConfigurationPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Configuration
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ConfigurationPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ConfigurationPeer::populateObjects(ConfigurationPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ConfigurationPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ConfigurationPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ConfigurationPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Configuration or Criteria object.
+ *
+ * @param mixed $values Criteria or Configuration object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Configuration object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Configuration or Criteria object.
+ *
+ * @param mixed $values Criteria or Configuration object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ConfigurationPeer::CFG_UID);
+ $selectCriteria->add(ConfigurationPeer::CFG_UID, $criteria->remove(ConfigurationPeer::CFG_UID), $comparison);
+
+ $comparison = $criteria->getComparison(ConfigurationPeer::OBJ_UID);
+ $selectCriteria->add(ConfigurationPeer::OBJ_UID, $criteria->remove(ConfigurationPeer::OBJ_UID), $comparison);
+
+ $comparison = $criteria->getComparison(ConfigurationPeer::PRO_UID);
+ $selectCriteria->add(ConfigurationPeer::PRO_UID, $criteria->remove(ConfigurationPeer::PRO_UID), $comparison);
+
+ $comparison = $criteria->getComparison(ConfigurationPeer::USR_UID);
+ $selectCriteria->add(ConfigurationPeer::USR_UID, $criteria->remove(ConfigurationPeer::USR_UID), $comparison);
+
+ $comparison = $criteria->getComparison(ConfigurationPeer::APP_UID);
+ $selectCriteria->add(ConfigurationPeer::APP_UID, $criteria->remove(ConfigurationPeer::APP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CONFIGURATION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ConfigurationPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Configuration or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Configuration object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Configuration) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ $vals[3][] = $value[3];
+ $vals[4][] = $value[4];
+ }
+
+ $criteria->add(ConfigurationPeer::CFG_UID, $vals[0], Criteria::IN);
+ $criteria->add(ConfigurationPeer::OBJ_UID, $vals[1], Criteria::IN);
+ $criteria->add(ConfigurationPeer::PRO_UID, $vals[2], Criteria::IN);
+ $criteria->add(ConfigurationPeer::USR_UID, $vals[3], Criteria::IN);
+ $criteria->add(ConfigurationPeer::APP_UID, $vals[4], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Configuration object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Configuration $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Configuration $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ConfigurationPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ConfigurationPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(ConfigurationPeer::DATABASE_NAME, ConfigurationPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $cfg_uid
+ * @param string $obj_uid
+ * @param string $pro_uid
+ * @param string $usr_uid
+ * @param string $app_uid
+ * @param Connection $con
+ * @return Configuration
+ */
+ public static function retrieveByPK($cfg_uid, $obj_uid, $pro_uid, $usr_uid, $app_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(ConfigurationPeer::CFG_UID, $cfg_uid);
+ $criteria->add(ConfigurationPeer::OBJ_UID, $obj_uid);
+ $criteria->add(ConfigurationPeer::PRO_UID, $pro_uid);
+ $criteria->add(ConfigurationPeer::USR_UID, $usr_uid);
+ $criteria->add(ConfigurationPeer::APP_UID, $app_uid);
+ $v = ConfigurationPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseConfigurationPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseConfigurationPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ConfigurationMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ConfigurationMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ConfigurationMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ConfigurationMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseContent.php b/workflow/engine/classes/model/om/BaseContent.php
index e2ac30f31..972d9c7c6 100755
--- a/workflow/engine/classes/model/om/BaseContent.php
+++ b/workflow/engine/classes/model/om/BaseContent.php
@@ -16,723 +16,749 @@ include_once 'classes/model/ContentPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseContent extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ContentPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the con_category field.
- * @var string
- */
- protected $con_category = '';
-
-
- /**
- * The value for the con_parent field.
- * @var string
- */
- protected $con_parent = '';
-
-
- /**
- * The value for the con_id field.
- * @var string
- */
- protected $con_id = '';
-
-
- /**
- * The value for the con_lang field.
- * @var string
- */
- protected $con_lang = '';
-
-
- /**
- * The value for the con_value field.
- * @var string
- */
- protected $con_value;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [con_category] column value.
- *
- * @return string
- */
- public function getConCategory()
- {
-
- return $this->con_category;
- }
-
- /**
- * Get the [con_parent] column value.
- *
- * @return string
- */
- public function getConParent()
- {
-
- return $this->con_parent;
- }
-
- /**
- * Get the [con_id] column value.
- *
- * @return string
- */
- public function getConId()
- {
-
- return $this->con_id;
- }
-
- /**
- * Get the [con_lang] column value.
- *
- * @return string
- */
- public function getConLang()
- {
-
- return $this->con_lang;
- }
-
- /**
- * Get the [con_value] column value.
- *
- * @return string
- */
- public function getConValue()
- {
-
- return $this->con_value;
- }
-
- /**
- * Set the value of [con_category] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setConCategory($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->con_category !== $v || $v === '') {
- $this->con_category = $v;
- $this->modifiedColumns[] = ContentPeer::CON_CATEGORY;
- }
-
- } // setConCategory()
-
- /**
- * Set the value of [con_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setConParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->con_parent !== $v || $v === '') {
- $this->con_parent = $v;
- $this->modifiedColumns[] = ContentPeer::CON_PARENT;
- }
-
- } // setConParent()
-
- /**
- * Set the value of [con_id] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setConId($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->con_id !== $v || $v === '') {
- $this->con_id = $v;
- $this->modifiedColumns[] = ContentPeer::CON_ID;
- }
-
- } // setConId()
-
- /**
- * Set the value of [con_lang] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setConLang($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->con_lang !== $v || $v === '') {
- $this->con_lang = $v;
- $this->modifiedColumns[] = ContentPeer::CON_LANG;
- }
-
- } // setConLang()
-
- /**
- * Set the value of [con_value] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setConValue($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->con_value !== $v) {
- $this->con_value = $v;
- $this->modifiedColumns[] = ContentPeer::CON_VALUE;
- }
-
- } // setConValue()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->con_category = $rs->getString($startcol + 0);
-
- $this->con_parent = $rs->getString($startcol + 1);
-
- $this->con_id = $rs->getString($startcol + 2);
-
- $this->con_lang = $rs->getString($startcol + 3);
-
- $this->con_value = $rs->getString($startcol + 4);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = ContentPeer::NUM_COLUMNS - ContentPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Content object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ContentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ContentPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ContentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ContentPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ContentPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ContentPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ContentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getConCategory();
- break;
- case 1:
- return $this->getConParent();
- break;
- case 2:
- return $this->getConId();
- break;
- case 3:
- return $this->getConLang();
- break;
- case 4:
- return $this->getConValue();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ContentPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getConCategory(),
- $keys[1] => $this->getConParent(),
- $keys[2] => $this->getConId(),
- $keys[3] => $this->getConLang(),
- $keys[4] => $this->getConValue(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ContentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setConCategory($value);
- break;
- case 1:
- $this->setConParent($value);
- break;
- case 2:
- $this->setConId($value);
- break;
- case 3:
- $this->setConLang($value);
- break;
- case 4:
- $this->setConValue($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ContentPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setConCategory($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setConParent($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setConId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setConLang($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setConValue($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ContentPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ContentPeer::CON_CATEGORY)) $criteria->add(ContentPeer::CON_CATEGORY, $this->con_category);
- if ($this->isColumnModified(ContentPeer::CON_PARENT)) $criteria->add(ContentPeer::CON_PARENT, $this->con_parent);
- if ($this->isColumnModified(ContentPeer::CON_ID)) $criteria->add(ContentPeer::CON_ID, $this->con_id);
- if ($this->isColumnModified(ContentPeer::CON_LANG)) $criteria->add(ContentPeer::CON_LANG, $this->con_lang);
- if ($this->isColumnModified(ContentPeer::CON_VALUE)) $criteria->add(ContentPeer::CON_VALUE, $this->con_value);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ContentPeer::DATABASE_NAME);
-
- $criteria->add(ContentPeer::CON_CATEGORY, $this->con_category);
- $criteria->add(ContentPeer::CON_PARENT, $this->con_parent);
- $criteria->add(ContentPeer::CON_ID, $this->con_id);
- $criteria->add(ContentPeer::CON_LANG, $this->con_lang);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getConCategory();
-
- $pks[1] = $this->getConParent();
-
- $pks[2] = $this->getConId();
-
- $pks[3] = $this->getConLang();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setConCategory($keys[0]);
-
- $this->setConParent($keys[1]);
-
- $this->setConId($keys[2]);
-
- $this->setConLang($keys[3]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Content (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setConValue($this->con_value);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setConCategory(''); // this is a pkey column, so set to default value
-
- $copyObj->setConParent(''); // this is a pkey column, so set to default value
-
- $copyObj->setConId(''); // this is a pkey column, so set to default value
-
- $copyObj->setConLang(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Content Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ContentPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ContentPeer();
- }
- return self::$peer;
- }
-
-} // BaseContent
+abstract class BaseContent extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ContentPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the con_category field.
+ * @var string
+ */
+ protected $con_category = '';
+
+ /**
+ * The value for the con_parent field.
+ * @var string
+ */
+ protected $con_parent = '';
+
+ /**
+ * The value for the con_id field.
+ * @var string
+ */
+ protected $con_id = '';
+
+ /**
+ * The value for the con_lang field.
+ * @var string
+ */
+ protected $con_lang = '';
+
+ /**
+ * The value for the con_value field.
+ * @var string
+ */
+ protected $con_value;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [con_category] column value.
+ *
+ * @return string
+ */
+ public function getConCategory()
+ {
+
+ return $this->con_category;
+ }
+
+ /**
+ * Get the [con_parent] column value.
+ *
+ * @return string
+ */
+ public function getConParent()
+ {
+
+ return $this->con_parent;
+ }
+
+ /**
+ * Get the [con_id] column value.
+ *
+ * @return string
+ */
+ public function getConId()
+ {
+
+ return $this->con_id;
+ }
+
+ /**
+ * Get the [con_lang] column value.
+ *
+ * @return string
+ */
+ public function getConLang()
+ {
+
+ return $this->con_lang;
+ }
+
+ /**
+ * Get the [con_value] column value.
+ *
+ * @return string
+ */
+ public function getConValue()
+ {
+
+ return $this->con_value;
+ }
+
+ /**
+ * Set the value of [con_category] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setConCategory($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->con_category !== $v || $v === '') {
+ $this->con_category = $v;
+ $this->modifiedColumns[] = ContentPeer::CON_CATEGORY;
+ }
+
+ } // setConCategory()
+
+ /**
+ * Set the value of [con_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setConParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->con_parent !== $v || $v === '') {
+ $this->con_parent = $v;
+ $this->modifiedColumns[] = ContentPeer::CON_PARENT;
+ }
+
+ } // setConParent()
+
+ /**
+ * Set the value of [con_id] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setConId($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->con_id !== $v || $v === '') {
+ $this->con_id = $v;
+ $this->modifiedColumns[] = ContentPeer::CON_ID;
+ }
+
+ } // setConId()
+
+ /**
+ * Set the value of [con_lang] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setConLang($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->con_lang !== $v || $v === '') {
+ $this->con_lang = $v;
+ $this->modifiedColumns[] = ContentPeer::CON_LANG;
+ }
+
+ } // setConLang()
+
+ /**
+ * Set the value of [con_value] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setConValue($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->con_value !== $v) {
+ $this->con_value = $v;
+ $this->modifiedColumns[] = ContentPeer::CON_VALUE;
+ }
+
+ } // setConValue()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->con_category = $rs->getString($startcol + 0);
+
+ $this->con_parent = $rs->getString($startcol + 1);
+
+ $this->con_id = $rs->getString($startcol + 2);
+
+ $this->con_lang = $rs->getString($startcol + 3);
+
+ $this->con_value = $rs->getString($startcol + 4);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = ContentPeer::NUM_COLUMNS - ContentPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Content object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ContentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ContentPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ContentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ContentPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ContentPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ContentPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ContentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getConCategory();
+ break;
+ case 1:
+ return $this->getConParent();
+ break;
+ case 2:
+ return $this->getConId();
+ break;
+ case 3:
+ return $this->getConLang();
+ break;
+ case 4:
+ return $this->getConValue();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ContentPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getConCategory(),
+ $keys[1] => $this->getConParent(),
+ $keys[2] => $this->getConId(),
+ $keys[3] => $this->getConLang(),
+ $keys[4] => $this->getConValue(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ContentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setConCategory($value);
+ break;
+ case 1:
+ $this->setConParent($value);
+ break;
+ case 2:
+ $this->setConId($value);
+ break;
+ case 3:
+ $this->setConLang($value);
+ break;
+ case 4:
+ $this->setConValue($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ContentPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setConCategory($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setConParent($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setConId($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setConLang($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setConValue($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ContentPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ContentPeer::CON_CATEGORY)) {
+ $criteria->add(ContentPeer::CON_CATEGORY, $this->con_category);
+ }
+
+ if ($this->isColumnModified(ContentPeer::CON_PARENT)) {
+ $criteria->add(ContentPeer::CON_PARENT, $this->con_parent);
+ }
+
+ if ($this->isColumnModified(ContentPeer::CON_ID)) {
+ $criteria->add(ContentPeer::CON_ID, $this->con_id);
+ }
+
+ if ($this->isColumnModified(ContentPeer::CON_LANG)) {
+ $criteria->add(ContentPeer::CON_LANG, $this->con_lang);
+ }
+
+ if ($this->isColumnModified(ContentPeer::CON_VALUE)) {
+ $criteria->add(ContentPeer::CON_VALUE, $this->con_value);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ContentPeer::DATABASE_NAME);
+
+ $criteria->add(ContentPeer::CON_CATEGORY, $this->con_category);
+ $criteria->add(ContentPeer::CON_PARENT, $this->con_parent);
+ $criteria->add(ContentPeer::CON_ID, $this->con_id);
+ $criteria->add(ContentPeer::CON_LANG, $this->con_lang);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getConCategory();
+
+ $pks[1] = $this->getConParent();
+
+ $pks[2] = $this->getConId();
+
+ $pks[3] = $this->getConLang();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setConCategory($keys[0]);
+
+ $this->setConParent($keys[1]);
+
+ $this->setConId($keys[2]);
+
+ $this->setConLang($keys[3]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Content (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setConValue($this->con_value);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setConCategory(''); // this is a pkey column, so set to default value
+
+ $copyObj->setConParent(''); // this is a pkey column, so set to default value
+
+ $copyObj->setConId(''); // this is a pkey column, so set to default value
+
+ $copyObj->setConLang(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Content Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ContentPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ContentPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseContentPeer.php b/workflow/engine/classes/model/om/BaseContentPeer.php
index c20071d49..4b54fdd28 100755
--- a/workflow/engine/classes/model/om/BaseContentPeer.php
+++ b/workflow/engine/classes/model/om/BaseContentPeer.php
@@ -12,582 +12,583 @@ include_once 'classes/model/Content.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseContentPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'CONTENT';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Content';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the CON_CATEGORY field */
- const CON_CATEGORY = 'CONTENT.CON_CATEGORY';
-
- /** the column name for the CON_PARENT field */
- const CON_PARENT = 'CONTENT.CON_PARENT';
-
- /** the column name for the CON_ID field */
- const CON_ID = 'CONTENT.CON_ID';
-
- /** the column name for the CON_LANG field */
- const CON_LANG = 'CONTENT.CON_LANG';
-
- /** the column name for the CON_VALUE field */
- const CON_VALUE = 'CONTENT.CON_VALUE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('ConCategory', 'ConParent', 'ConId', 'ConLang', 'ConValue', ),
- BasePeer::TYPE_COLNAME => array (ContentPeer::CON_CATEGORY, ContentPeer::CON_PARENT, ContentPeer::CON_ID, ContentPeer::CON_LANG, ContentPeer::CON_VALUE, ),
- BasePeer::TYPE_FIELDNAME => array ('CON_CATEGORY', 'CON_PARENT', 'CON_ID', 'CON_LANG', 'CON_VALUE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('ConCategory' => 0, 'ConParent' => 1, 'ConId' => 2, 'ConLang' => 3, 'ConValue' => 4, ),
- BasePeer::TYPE_COLNAME => array (ContentPeer::CON_CATEGORY => 0, ContentPeer::CON_PARENT => 1, ContentPeer::CON_ID => 2, ContentPeer::CON_LANG => 3, ContentPeer::CON_VALUE => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('CON_CATEGORY' => 0, 'CON_PARENT' => 1, 'CON_ID' => 2, 'CON_LANG' => 3, 'CON_VALUE' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ContentMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ContentMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ContentPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ContentPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ContentPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ContentPeer::CON_CATEGORY);
-
- $criteria->addSelectColumn(ContentPeer::CON_PARENT);
-
- $criteria->addSelectColumn(ContentPeer::CON_ID);
-
- $criteria->addSelectColumn(ContentPeer::CON_LANG);
-
- $criteria->addSelectColumn(ContentPeer::CON_VALUE);
-
- }
-
- const COUNT = 'COUNT(CONTENT.CON_CATEGORY)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT CONTENT.CON_CATEGORY)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ContentPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ContentPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ContentPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Content
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ContentPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ContentPeer::populateObjects(ContentPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ContentPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ContentPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ContentPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Content or Criteria object.
- *
- * @param mixed $values Criteria or Content object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Content object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Content or Criteria object.
- *
- * @param mixed $values Criteria or Content object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ContentPeer::CON_CATEGORY);
- $selectCriteria->add(ContentPeer::CON_CATEGORY, $criteria->remove(ContentPeer::CON_CATEGORY), $comparison);
-
- $comparison = $criteria->getComparison(ContentPeer::CON_PARENT);
- $selectCriteria->add(ContentPeer::CON_PARENT, $criteria->remove(ContentPeer::CON_PARENT), $comparison);
-
- $comparison = $criteria->getComparison(ContentPeer::CON_ID);
- $selectCriteria->add(ContentPeer::CON_ID, $criteria->remove(ContentPeer::CON_ID), $comparison);
-
- $comparison = $criteria->getComparison(ContentPeer::CON_LANG);
- $selectCriteria->add(ContentPeer::CON_LANG, $criteria->remove(ContentPeer::CON_LANG), $comparison);
-
- } else { // $values is Content object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the CONTENT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ContentPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Content or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Content object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ContentPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Content) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- $vals[3][] = $value[3];
- }
-
- $criteria->add(ContentPeer::CON_CATEGORY, $vals[0], Criteria::IN);
- $criteria->add(ContentPeer::CON_PARENT, $vals[1], Criteria::IN);
- $criteria->add(ContentPeer::CON_ID, $vals[2], Criteria::IN);
- $criteria->add(ContentPeer::CON_LANG, $vals[3], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Content object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Content $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Content $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ContentPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ContentPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(ContentPeer::CON_LANG))
- $columns[ContentPeer::CON_LANG] = $obj->getConLang();
-
- }
-
- return BasePeer::doValidate(ContentPeer::DATABASE_NAME, ContentPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $con_category
- @param string $con_parent
- @param string $con_id
- @param string $con_lang
-
- * @param Connection $con
- * @return Content
- */
- public static function retrieveByPK( $con_category, $con_parent, $con_id, $con_lang, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(ContentPeer::CON_CATEGORY, $con_category);
- $criteria->add(ContentPeer::CON_PARENT, $con_parent);
- $criteria->add(ContentPeer::CON_ID, $con_id);
- $criteria->add(ContentPeer::CON_LANG, $con_lang);
- $v = ContentPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseContentPeer
+abstract class BaseContentPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'CONTENT';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Content';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the CON_CATEGORY field */
+ const CON_CATEGORY = 'CONTENT.CON_CATEGORY';
+
+ /** the column name for the CON_PARENT field */
+ const CON_PARENT = 'CONTENT.CON_PARENT';
+
+ /** the column name for the CON_ID field */
+ const CON_ID = 'CONTENT.CON_ID';
+
+ /** the column name for the CON_LANG field */
+ const CON_LANG = 'CONTENT.CON_LANG';
+
+ /** the column name for the CON_VALUE field */
+ const CON_VALUE = 'CONTENT.CON_VALUE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('ConCategory', 'ConParent', 'ConId', 'ConLang', 'ConValue', ),
+ BasePeer::TYPE_COLNAME => array (ContentPeer::CON_CATEGORY, ContentPeer::CON_PARENT, ContentPeer::CON_ID, ContentPeer::CON_LANG, ContentPeer::CON_VALUE, ),
+ BasePeer::TYPE_FIELDNAME => array ('CON_CATEGORY', 'CON_PARENT', 'CON_ID', 'CON_LANG', 'CON_VALUE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('ConCategory' => 0, 'ConParent' => 1, 'ConId' => 2, 'ConLang' => 3, 'ConValue' => 4, ),
+ BasePeer::TYPE_COLNAME => array (ContentPeer::CON_CATEGORY => 0, ContentPeer::CON_PARENT => 1, ContentPeer::CON_ID => 2, ContentPeer::CON_LANG => 3, ContentPeer::CON_VALUE => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('CON_CATEGORY' => 0, 'CON_PARENT' => 1, 'CON_ID' => 2, 'CON_LANG' => 3, 'CON_VALUE' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ContentMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ContentMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ContentPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ContentPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ContentPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ContentPeer::CON_CATEGORY);
+
+ $criteria->addSelectColumn(ContentPeer::CON_PARENT);
+
+ $criteria->addSelectColumn(ContentPeer::CON_ID);
+
+ $criteria->addSelectColumn(ContentPeer::CON_LANG);
+
+ $criteria->addSelectColumn(ContentPeer::CON_VALUE);
+
+ }
+
+ const COUNT = 'COUNT(CONTENT.CON_CATEGORY)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT CONTENT.CON_CATEGORY)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ContentPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ContentPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ContentPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Content
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ContentPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ContentPeer::populateObjects(ContentPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ContentPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ContentPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ContentPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Content or Criteria object.
+ *
+ * @param mixed $values Criteria or Content object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Content object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Content or Criteria object.
+ *
+ * @param mixed $values Criteria or Content object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ContentPeer::CON_CATEGORY);
+ $selectCriteria->add(ContentPeer::CON_CATEGORY, $criteria->remove(ContentPeer::CON_CATEGORY), $comparison);
+
+ $comparison = $criteria->getComparison(ContentPeer::CON_PARENT);
+ $selectCriteria->add(ContentPeer::CON_PARENT, $criteria->remove(ContentPeer::CON_PARENT), $comparison);
+
+ $comparison = $criteria->getComparison(ContentPeer::CON_ID);
+ $selectCriteria->add(ContentPeer::CON_ID, $criteria->remove(ContentPeer::CON_ID), $comparison);
+
+ $comparison = $criteria->getComparison(ContentPeer::CON_LANG);
+ $selectCriteria->add(ContentPeer::CON_LANG, $criteria->remove(ContentPeer::CON_LANG), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the CONTENT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ContentPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Content or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Content object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ContentPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Content) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ $vals[3][] = $value[3];
+ }
+
+ $criteria->add(ContentPeer::CON_CATEGORY, $vals[0], Criteria::IN);
+ $criteria->add(ContentPeer::CON_PARENT, $vals[1], Criteria::IN);
+ $criteria->add(ContentPeer::CON_ID, $vals[2], Criteria::IN);
+ $criteria->add(ContentPeer::CON_LANG, $vals[3], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Content object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Content $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Content $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ContentPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ContentPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(ContentPeer::CON_LANG))
+ $columns[ContentPeer::CON_LANG] = $obj->getConLang();
+
+ }
+
+ return BasePeer::doValidate(ContentPeer::DATABASE_NAME, ContentPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $con_category
+ * @param string $con_parent
+ * @param string $con_id
+ * @param string $con_lang
+ * @param Connection $con
+ * @return Content
+ */
+ public static function retrieveByPK($con_category, $con_parent, $con_id, $con_lang, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(ContentPeer::CON_CATEGORY, $con_category);
+ $criteria->add(ContentPeer::CON_PARENT, $con_parent);
+ $criteria->add(ContentPeer::CON_ID, $con_id);
+ $criteria->add(ContentPeer::CON_LANG, $con_lang);
+ $v = ContentPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseContentPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseContentPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ContentMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ContentMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ContentMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ContentMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseDashlet.php b/workflow/engine/classes/model/om/BaseDashlet.php
index f760f8de3..4672b9dc8 100644
--- a/workflow/engine/classes/model/om/BaseDashlet.php
+++ b/workflow/engine/classes/model/om/BaseDashlet.php
@@ -16,904 +16,949 @@ include_once 'classes/model/DashletPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDashlet extends BaseObject implements Persistent {
-
+abstract class BaseDashlet extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var DashletPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the das_uid field.
+ * @var string
+ */
+ protected $das_uid = '';
+
+ /**
+ * The value for the das_class field.
+ * @var string
+ */
+ protected $das_class = '';
+
+ /**
+ * The value for the das_title field.
+ * @var string
+ */
+ protected $das_title = '';
+
+ /**
+ * The value for the das_description field.
+ * @var string
+ */
+ protected $das_description;
+
+ /**
+ * The value for the das_version field.
+ * @var string
+ */
+ protected $das_version = '1.0';
+
+ /**
+ * The value for the das_create_date field.
+ * @var int
+ */
+ protected $das_create_date;
+
+ /**
+ * The value for the das_update_date field.
+ * @var int
+ */
+ protected $das_update_date;
+
+ /**
+ * The value for the das_status field.
+ * @var int
+ */
+ protected $das_status = 1;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [das_uid] column value.
+ *
+ * @return string
+ */
+ public function getDasUid()
+ {
+
+ return $this->das_uid;
+ }
+
+ /**
+ * Get the [das_class] column value.
+ *
+ * @return string
+ */
+ public function getDasClass()
+ {
+
+ return $this->das_class;
+ }
+
+ /**
+ * Get the [das_title] column value.
+ *
+ * @return string
+ */
+ public function getDasTitle()
+ {
+
+ return $this->das_title;
+ }
+
+ /**
+ * Get the [das_description] column value.
+ *
+ * @return string
+ */
+ public function getDasDescription()
+ {
+
+ return $this->das_description;
+ }
+
+ /**
+ * Get the [das_version] column value.
+ *
+ * @return string
+ */
+ public function getDasVersion()
+ {
+
+ return $this->das_version;
+ }
+
+ /**
+ * Get the [optionally formatted] [das_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDasCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->das_create_date === null || $this->das_create_date === '') {
+ return null;
+ } elseif (!is_int($this->das_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->das_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [das_create_date] as date/time value: " .
+ var_export($this->das_create_date, true));
+ }
+ } else {
+ $ts = $this->das_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [das_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDasUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->das_update_date === null || $this->das_update_date === '') {
+ return null;
+ } elseif (!is_int($this->das_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->das_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [das_update_date] as date/time value: " .
+ var_export($this->das_update_date, true));
+ }
+ } else {
+ $ts = $this->das_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [das_status] column value.
+ *
+ * @return int
+ */
+ public function getDasStatus()
+ {
+
+ return $this->das_status;
+ }
+
+ /**
+ * Set the value of [das_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_uid !== $v || $v === '') {
+ $this->das_uid = $v;
+ $this->modifiedColumns[] = DashletPeer::DAS_UID;
+ }
+
+ } // setDasUid()
+
+ /**
+ * Set the value of [das_class] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasClass($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_class !== $v || $v === '') {
+ $this->das_class = $v;
+ $this->modifiedColumns[] = DashletPeer::DAS_CLASS;
+ }
+
+ } // setDasClass()
+
+ /**
+ * Set the value of [das_title] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasTitle($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_title !== $v || $v === '') {
+ $this->das_title = $v;
+ $this->modifiedColumns[] = DashletPeer::DAS_TITLE;
+ }
+
+ } // setDasTitle()
+
+ /**
+ * Set the value of [das_description] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasDescription($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_description !== $v) {
+ $this->das_description = $v;
+ $this->modifiedColumns[] = DashletPeer::DAS_DESCRIPTION;
+ }
+
+ } // setDasDescription()
+
+ /**
+ * Set the value of [das_version] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasVersion($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_version !== $v || $v === '1.0') {
+ $this->das_version = $v;
+ $this->modifiedColumns[] = DashletPeer::DAS_VERSION;
+ }
+
+ } // setDasVersion()
+
+ /**
+ * Set the value of [das_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDasCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [das_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->das_create_date !== $ts) {
+ $this->das_create_date = $ts;
+ $this->modifiedColumns[] = DashletPeer::DAS_CREATE_DATE;
+ }
+
+ } // setDasCreateDate()
+
+ /**
+ * Set the value of [das_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDasUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [das_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->das_update_date !== $ts) {
+ $this->das_update_date = $ts;
+ $this->modifiedColumns[] = DashletPeer::DAS_UPDATE_DATE;
+ }
+
+ } // setDasUpdateDate()
+
+ /**
+ * Set the value of [das_status] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDasStatus($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->das_status !== $v || $v === 1) {
+ $this->das_status = $v;
+ $this->modifiedColumns[] = DashletPeer::DAS_STATUS;
+ }
+
+ } // setDasStatus()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->das_uid = $rs->getString($startcol + 0);
+
+ $this->das_class = $rs->getString($startcol + 1);
+
+ $this->das_title = $rs->getString($startcol + 2);
+
+ $this->das_description = $rs->getString($startcol + 3);
+
+ $this->das_version = $rs->getString($startcol + 4);
+
+ $this->das_create_date = $rs->getTimestamp($startcol + 5, null);
+
+ $this->das_update_date = $rs->getTimestamp($startcol + 6, null);
+
+ $this->das_status = $rs->getInt($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = DashletPeer::NUM_COLUMNS - DashletPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Dashlet object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DashletPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ DashletPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DashletPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = DashletPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += DashletPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = DashletPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DashletPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getDasUid();
+ break;
+ case 1:
+ return $this->getDasClass();
+ break;
+ case 2:
+ return $this->getDasTitle();
+ break;
+ case 3:
+ return $this->getDasDescription();
+ break;
+ case 4:
+ return $this->getDasVersion();
+ break;
+ case 5:
+ return $this->getDasCreateDate();
+ break;
+ case 6:
+ return $this->getDasUpdateDate();
+ break;
+ case 7:
+ return $this->getDasStatus();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DashletPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getDasUid(),
+ $keys[1] => $this->getDasClass(),
+ $keys[2] => $this->getDasTitle(),
+ $keys[3] => $this->getDasDescription(),
+ $keys[4] => $this->getDasVersion(),
+ $keys[5] => $this->getDasCreateDate(),
+ $keys[6] => $this->getDasUpdateDate(),
+ $keys[7] => $this->getDasStatus(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DashletPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setDasUid($value);
+ break;
+ case 1:
+ $this->setDasClass($value);
+ break;
+ case 2:
+ $this->setDasTitle($value);
+ break;
+ case 3:
+ $this->setDasDescription($value);
+ break;
+ case 4:
+ $this->setDasVersion($value);
+ break;
+ case 5:
+ $this->setDasCreateDate($value);
+ break;
+ case 6:
+ $this->setDasUpdateDate($value);
+ break;
+ case 7:
+ $this->setDasStatus($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DashletPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setDasUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDasClass($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setDasTitle($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDasDescription($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setDasVersion($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setDasCreateDate($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setDasUpdateDate($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setDasStatus($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(DashletPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(DashletPeer::DAS_UID)) {
+ $criteria->add(DashletPeer::DAS_UID, $this->das_uid);
+ }
+
+ if ($this->isColumnModified(DashletPeer::DAS_CLASS)) {
+ $criteria->add(DashletPeer::DAS_CLASS, $this->das_class);
+ }
+
+ if ($this->isColumnModified(DashletPeer::DAS_TITLE)) {
+ $criteria->add(DashletPeer::DAS_TITLE, $this->das_title);
+ }
+
+ if ($this->isColumnModified(DashletPeer::DAS_DESCRIPTION)) {
+ $criteria->add(DashletPeer::DAS_DESCRIPTION, $this->das_description);
+ }
+
+ if ($this->isColumnModified(DashletPeer::DAS_VERSION)) {
+ $criteria->add(DashletPeer::DAS_VERSION, $this->das_version);
+ }
+
+ if ($this->isColumnModified(DashletPeer::DAS_CREATE_DATE)) {
+ $criteria->add(DashletPeer::DAS_CREATE_DATE, $this->das_create_date);
+ }
+
+ if ($this->isColumnModified(DashletPeer::DAS_UPDATE_DATE)) {
+ $criteria->add(DashletPeer::DAS_UPDATE_DATE, $this->das_update_date);
+ }
+
+ if ($this->isColumnModified(DashletPeer::DAS_STATUS)) {
+ $criteria->add(DashletPeer::DAS_STATUS, $this->das_status);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(DashletPeer::DATABASE_NAME);
+
+ $criteria->add(DashletPeer::DAS_UID, $this->das_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getDasUid();
+ }
+
+ /**
+ * Generic method to set the primary key (das_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setDasUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Dashlet (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setDasClass($this->das_class);
+
+ $copyObj->setDasTitle($this->das_title);
+
+ $copyObj->setDasDescription($this->das_description);
+
+ $copyObj->setDasVersion($this->das_version);
+
+ $copyObj->setDasCreateDate($this->das_create_date);
+
+ $copyObj->setDasUpdateDate($this->das_update_date);
+
+ $copyObj->setDasStatus($this->das_status);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setDasUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Dashlet Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return DashletPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new DashletPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var DashletPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the das_uid field.
- * @var string
- */
- protected $das_uid = '';
-
-
- /**
- * The value for the das_class field.
- * @var string
- */
- protected $das_class = '';
-
-
- /**
- * The value for the das_title field.
- * @var string
- */
- protected $das_title = '';
-
-
- /**
- * The value for the das_description field.
- * @var string
- */
- protected $das_description;
-
-
- /**
- * The value for the das_version field.
- * @var string
- */
- protected $das_version = '1.0';
-
-
- /**
- * The value for the das_create_date field.
- * @var int
- */
- protected $das_create_date;
-
-
- /**
- * The value for the das_update_date field.
- * @var int
- */
- protected $das_update_date;
-
-
- /**
- * The value for the das_status field.
- * @var int
- */
- protected $das_status = 1;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [das_uid] column value.
- *
- * @return string
- */
- public function getDasUid()
- {
-
- return $this->das_uid;
- }
-
- /**
- * Get the [das_class] column value.
- *
- * @return string
- */
- public function getDasClass()
- {
-
- return $this->das_class;
- }
-
- /**
- * Get the [das_title] column value.
- *
- * @return string
- */
- public function getDasTitle()
- {
-
- return $this->das_title;
- }
-
- /**
- * Get the [das_description] column value.
- *
- * @return string
- */
- public function getDasDescription()
- {
-
- return $this->das_description;
- }
-
- /**
- * Get the [das_version] column value.
- *
- * @return string
- */
- public function getDasVersion()
- {
-
- return $this->das_version;
- }
-
- /**
- * Get the [optionally formatted] [das_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDasCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->das_create_date === null || $this->das_create_date === '') {
- return null;
- } elseif (!is_int($this->das_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->das_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [das_create_date] as date/time value: " . var_export($this->das_create_date, true));
- }
- } else {
- $ts = $this->das_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [das_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDasUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->das_update_date === null || $this->das_update_date === '') {
- return null;
- } elseif (!is_int($this->das_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->das_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [das_update_date] as date/time value: " . var_export($this->das_update_date, true));
- }
- } else {
- $ts = $this->das_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [das_status] column value.
- *
- * @return int
- */
- public function getDasStatus()
- {
-
- return $this->das_status;
- }
-
- /**
- * Set the value of [das_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_uid !== $v || $v === '') {
- $this->das_uid = $v;
- $this->modifiedColumns[] = DashletPeer::DAS_UID;
- }
-
- } // setDasUid()
-
- /**
- * Set the value of [das_class] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasClass($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_class !== $v || $v === '') {
- $this->das_class = $v;
- $this->modifiedColumns[] = DashletPeer::DAS_CLASS;
- }
-
- } // setDasClass()
-
- /**
- * Set the value of [das_title] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasTitle($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_title !== $v || $v === '') {
- $this->das_title = $v;
- $this->modifiedColumns[] = DashletPeer::DAS_TITLE;
- }
-
- } // setDasTitle()
-
- /**
- * Set the value of [das_description] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasDescription($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_description !== $v) {
- $this->das_description = $v;
- $this->modifiedColumns[] = DashletPeer::DAS_DESCRIPTION;
- }
-
- } // setDasDescription()
-
- /**
- * Set the value of [das_version] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasVersion($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_version !== $v || $v === '1.0') {
- $this->das_version = $v;
- $this->modifiedColumns[] = DashletPeer::DAS_VERSION;
- }
-
- } // setDasVersion()
-
- /**
- * Set the value of [das_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDasCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [das_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->das_create_date !== $ts) {
- $this->das_create_date = $ts;
- $this->modifiedColumns[] = DashletPeer::DAS_CREATE_DATE;
- }
-
- } // setDasCreateDate()
-
- /**
- * Set the value of [das_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDasUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [das_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->das_update_date !== $ts) {
- $this->das_update_date = $ts;
- $this->modifiedColumns[] = DashletPeer::DAS_UPDATE_DATE;
- }
-
- } // setDasUpdateDate()
-
- /**
- * Set the value of [das_status] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDasStatus($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->das_status !== $v || $v === 1) {
- $this->das_status = $v;
- $this->modifiedColumns[] = DashletPeer::DAS_STATUS;
- }
-
- } // setDasStatus()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->das_uid = $rs->getString($startcol + 0);
-
- $this->das_class = $rs->getString($startcol + 1);
-
- $this->das_title = $rs->getString($startcol + 2);
-
- $this->das_description = $rs->getString($startcol + 3);
-
- $this->das_version = $rs->getString($startcol + 4);
-
- $this->das_create_date = $rs->getTimestamp($startcol + 5, null);
-
- $this->das_update_date = $rs->getTimestamp($startcol + 6, null);
-
- $this->das_status = $rs->getInt($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = DashletPeer::NUM_COLUMNS - DashletPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Dashlet object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DashletPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- DashletPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DashletPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = DashletPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += DashletPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = DashletPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DashletPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getDasUid();
- break;
- case 1:
- return $this->getDasClass();
- break;
- case 2:
- return $this->getDasTitle();
- break;
- case 3:
- return $this->getDasDescription();
- break;
- case 4:
- return $this->getDasVersion();
- break;
- case 5:
- return $this->getDasCreateDate();
- break;
- case 6:
- return $this->getDasUpdateDate();
- break;
- case 7:
- return $this->getDasStatus();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DashletPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getDasUid(),
- $keys[1] => $this->getDasClass(),
- $keys[2] => $this->getDasTitle(),
- $keys[3] => $this->getDasDescription(),
- $keys[4] => $this->getDasVersion(),
- $keys[5] => $this->getDasCreateDate(),
- $keys[6] => $this->getDasUpdateDate(),
- $keys[7] => $this->getDasStatus(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DashletPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setDasUid($value);
- break;
- case 1:
- $this->setDasClass($value);
- break;
- case 2:
- $this->setDasTitle($value);
- break;
- case 3:
- $this->setDasDescription($value);
- break;
- case 4:
- $this->setDasVersion($value);
- break;
- case 5:
- $this->setDasCreateDate($value);
- break;
- case 6:
- $this->setDasUpdateDate($value);
- break;
- case 7:
- $this->setDasStatus($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DashletPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setDasUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDasClass($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setDasTitle($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDasDescription($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDasVersion($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setDasCreateDate($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setDasUpdateDate($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setDasStatus($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(DashletPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(DashletPeer::DAS_UID)) $criteria->add(DashletPeer::DAS_UID, $this->das_uid);
- if ($this->isColumnModified(DashletPeer::DAS_CLASS)) $criteria->add(DashletPeer::DAS_CLASS, $this->das_class);
- if ($this->isColumnModified(DashletPeer::DAS_TITLE)) $criteria->add(DashletPeer::DAS_TITLE, $this->das_title);
- if ($this->isColumnModified(DashletPeer::DAS_DESCRIPTION)) $criteria->add(DashletPeer::DAS_DESCRIPTION, $this->das_description);
- if ($this->isColumnModified(DashletPeer::DAS_VERSION)) $criteria->add(DashletPeer::DAS_VERSION, $this->das_version);
- if ($this->isColumnModified(DashletPeer::DAS_CREATE_DATE)) $criteria->add(DashletPeer::DAS_CREATE_DATE, $this->das_create_date);
- if ($this->isColumnModified(DashletPeer::DAS_UPDATE_DATE)) $criteria->add(DashletPeer::DAS_UPDATE_DATE, $this->das_update_date);
- if ($this->isColumnModified(DashletPeer::DAS_STATUS)) $criteria->add(DashletPeer::DAS_STATUS, $this->das_status);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(DashletPeer::DATABASE_NAME);
-
- $criteria->add(DashletPeer::DAS_UID, $this->das_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getDasUid();
- }
-
- /**
- * Generic method to set the primary key (das_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setDasUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Dashlet (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setDasClass($this->das_class);
-
- $copyObj->setDasTitle($this->das_title);
-
- $copyObj->setDasDescription($this->das_description);
-
- $copyObj->setDasVersion($this->das_version);
-
- $copyObj->setDasCreateDate($this->das_create_date);
-
- $copyObj->setDasUpdateDate($this->das_update_date);
-
- $copyObj->setDasStatus($this->das_status);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setDasUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Dashlet Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return DashletPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new DashletPeer();
- }
- return self::$peer;
- }
-
-} // BaseDashlet
diff --git a/workflow/engine/classes/model/om/BaseDashletInstance.php b/workflow/engine/classes/model/om/BaseDashletInstance.php
index bb9c0fb7d..708f3df89 100644
--- a/workflow/engine/classes/model/om/BaseDashletInstance.php
+++ b/workflow/engine/classes/model/om/BaseDashletInstance.php
@@ -16,904 +16,949 @@ include_once 'classes/model/DashletInstancePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDashletInstance extends BaseObject implements Persistent {
-
+abstract class BaseDashletInstance extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var DashletInstancePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the das_ins_uid field.
+ * @var string
+ */
+ protected $das_ins_uid = '';
+
+ /**
+ * The value for the das_uid field.
+ * @var string
+ */
+ protected $das_uid = '';
+
+ /**
+ * The value for the das_ins_owner_type field.
+ * @var string
+ */
+ protected $das_ins_owner_type = '';
+
+ /**
+ * The value for the das_ins_owner_uid field.
+ * @var string
+ */
+ protected $das_ins_owner_uid = '';
+
+ /**
+ * The value for the das_ins_additional_properties field.
+ * @var string
+ */
+ protected $das_ins_additional_properties;
+
+ /**
+ * The value for the das_ins_create_date field.
+ * @var int
+ */
+ protected $das_ins_create_date;
+
+ /**
+ * The value for the das_ins_update_date field.
+ * @var int
+ */
+ protected $das_ins_update_date;
+
+ /**
+ * The value for the das_ins_status field.
+ * @var int
+ */
+ protected $das_ins_status = 1;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [das_ins_uid] column value.
+ *
+ * @return string
+ */
+ public function getDasInsUid()
+ {
+
+ return $this->das_ins_uid;
+ }
+
+ /**
+ * Get the [das_uid] column value.
+ *
+ * @return string
+ */
+ public function getDasUid()
+ {
+
+ return $this->das_uid;
+ }
+
+ /**
+ * Get the [das_ins_owner_type] column value.
+ *
+ * @return string
+ */
+ public function getDasInsOwnerType()
+ {
+
+ return $this->das_ins_owner_type;
+ }
+
+ /**
+ * Get the [das_ins_owner_uid] column value.
+ *
+ * @return string
+ */
+ public function getDasInsOwnerUid()
+ {
+
+ return $this->das_ins_owner_uid;
+ }
+
+ /**
+ * Get the [das_ins_additional_properties] column value.
+ *
+ * @return string
+ */
+ public function getDasInsAdditionalProperties()
+ {
+
+ return $this->das_ins_additional_properties;
+ }
+
+ /**
+ * Get the [optionally formatted] [das_ins_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDasInsCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->das_ins_create_date === null || $this->das_ins_create_date === '') {
+ return null;
+ } elseif (!is_int($this->das_ins_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->das_ins_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [das_ins_create_date] as date/time value: " .
+ var_export($this->das_ins_create_date, true));
+ }
+ } else {
+ $ts = $this->das_ins_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [das_ins_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getDasInsUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->das_ins_update_date === null || $this->das_ins_update_date === '') {
+ return null;
+ } elseif (!is_int($this->das_ins_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->das_ins_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [das_ins_update_date] as date/time value: " .
+ var_export($this->das_ins_update_date, true));
+ }
+ } else {
+ $ts = $this->das_ins_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [das_ins_status] column value.
+ *
+ * @return int
+ */
+ public function getDasInsStatus()
+ {
+
+ return $this->das_ins_status;
+ }
+
+ /**
+ * Set the value of [das_ins_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasInsUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_ins_uid !== $v || $v === '') {
+ $this->das_ins_uid = $v;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_UID;
+ }
+
+ } // setDasInsUid()
+
+ /**
+ * Set the value of [das_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_uid !== $v || $v === '') {
+ $this->das_uid = $v;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_UID;
+ }
+
+ } // setDasUid()
+
+ /**
+ * Set the value of [das_ins_owner_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasInsOwnerType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_ins_owner_type !== $v || $v === '') {
+ $this->das_ins_owner_type = $v;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_OWNER_TYPE;
+ }
+
+ } // setDasInsOwnerType()
+
+ /**
+ * Set the value of [das_ins_owner_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasInsOwnerUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_ins_owner_uid !== $v || $v === '') {
+ $this->das_ins_owner_uid = $v;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_OWNER_UID;
+ }
+
+ } // setDasInsOwnerUid()
+
+ /**
+ * Set the value of [das_ins_additional_properties] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDasInsAdditionalProperties($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->das_ins_additional_properties !== $v) {
+ $this->das_ins_additional_properties = $v;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES;
+ }
+
+ } // setDasInsAdditionalProperties()
+
+ /**
+ * Set the value of [das_ins_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDasInsCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [das_ins_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->das_ins_create_date !== $ts) {
+ $this->das_ins_create_date = $ts;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_CREATE_DATE;
+ }
+
+ } // setDasInsCreateDate()
+
+ /**
+ * Set the value of [das_ins_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDasInsUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [das_ins_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->das_ins_update_date !== $ts) {
+ $this->das_ins_update_date = $ts;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_UPDATE_DATE;
+ }
+
+ } // setDasInsUpdateDate()
+
+ /**
+ * Set the value of [das_ins_status] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDasInsStatus($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->das_ins_status !== $v || $v === 1) {
+ $this->das_ins_status = $v;
+ $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_STATUS;
+ }
+
+ } // setDasInsStatus()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->das_ins_uid = $rs->getString($startcol + 0);
+
+ $this->das_uid = $rs->getString($startcol + 1);
+
+ $this->das_ins_owner_type = $rs->getString($startcol + 2);
+
+ $this->das_ins_owner_uid = $rs->getString($startcol + 3);
+
+ $this->das_ins_additional_properties = $rs->getString($startcol + 4);
+
+ $this->das_ins_create_date = $rs->getTimestamp($startcol + 5, null);
+
+ $this->das_ins_update_date = $rs->getTimestamp($startcol + 6, null);
+
+ $this->das_ins_status = $rs->getInt($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = DashletInstancePeer::NUM_COLUMNS - DashletInstancePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating DashletInstance object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ DashletInstancePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = DashletInstancePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += DashletInstancePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = DashletInstancePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DashletInstancePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getDasInsUid();
+ break;
+ case 1:
+ return $this->getDasUid();
+ break;
+ case 2:
+ return $this->getDasInsOwnerType();
+ break;
+ case 3:
+ return $this->getDasInsOwnerUid();
+ break;
+ case 4:
+ return $this->getDasInsAdditionalProperties();
+ break;
+ case 5:
+ return $this->getDasInsCreateDate();
+ break;
+ case 6:
+ return $this->getDasInsUpdateDate();
+ break;
+ case 7:
+ return $this->getDasInsStatus();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DashletInstancePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getDasInsUid(),
+ $keys[1] => $this->getDasUid(),
+ $keys[2] => $this->getDasInsOwnerType(),
+ $keys[3] => $this->getDasInsOwnerUid(),
+ $keys[4] => $this->getDasInsAdditionalProperties(),
+ $keys[5] => $this->getDasInsCreateDate(),
+ $keys[6] => $this->getDasInsUpdateDate(),
+ $keys[7] => $this->getDasInsStatus(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DashletInstancePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setDasInsUid($value);
+ break;
+ case 1:
+ $this->setDasUid($value);
+ break;
+ case 2:
+ $this->setDasInsOwnerType($value);
+ break;
+ case 3:
+ $this->setDasInsOwnerUid($value);
+ break;
+ case 4:
+ $this->setDasInsAdditionalProperties($value);
+ break;
+ case 5:
+ $this->setDasInsCreateDate($value);
+ break;
+ case 6:
+ $this->setDasInsUpdateDate($value);
+ break;
+ case 7:
+ $this->setDasInsStatus($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DashletInstancePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setDasInsUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDasUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setDasInsOwnerType($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDasInsOwnerUid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setDasInsAdditionalProperties($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setDasInsCreateDate($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setDasInsUpdateDate($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setDasInsStatus($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(DashletInstancePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_INS_UID)) {
+ $criteria->add(DashletInstancePeer::DAS_INS_UID, $this->das_ins_uid);
+ }
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_UID)) {
+ $criteria->add(DashletInstancePeer::DAS_UID, $this->das_uid);
+ }
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_INS_OWNER_TYPE)) {
+ $criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, $this->das_ins_owner_type);
+ }
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_INS_OWNER_UID)) {
+ $criteria->add(DashletInstancePeer::DAS_INS_OWNER_UID, $this->das_ins_owner_uid);
+ }
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES)) {
+ $criteria->add(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, $this->das_ins_additional_properties);
+ }
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_INS_CREATE_DATE)) {
+ $criteria->add(DashletInstancePeer::DAS_INS_CREATE_DATE, $this->das_ins_create_date);
+ }
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_INS_UPDATE_DATE)) {
+ $criteria->add(DashletInstancePeer::DAS_INS_UPDATE_DATE, $this->das_ins_update_date);
+ }
+
+ if ($this->isColumnModified(DashletInstancePeer::DAS_INS_STATUS)) {
+ $criteria->add(DashletInstancePeer::DAS_INS_STATUS, $this->das_ins_status);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(DashletInstancePeer::DATABASE_NAME);
+
+ $criteria->add(DashletInstancePeer::DAS_INS_UID, $this->das_ins_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getDasInsUid();
+ }
+
+ /**
+ * Generic method to set the primary key (das_ins_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setDasInsUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of DashletInstance (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setDasUid($this->das_uid);
+
+ $copyObj->setDasInsOwnerType($this->das_ins_owner_type);
+
+ $copyObj->setDasInsOwnerUid($this->das_ins_owner_uid);
+
+ $copyObj->setDasInsAdditionalProperties($this->das_ins_additional_properties);
+
+ $copyObj->setDasInsCreateDate($this->das_ins_create_date);
+
+ $copyObj->setDasInsUpdateDate($this->das_ins_update_date);
+
+ $copyObj->setDasInsStatus($this->das_ins_status);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setDasInsUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return DashletInstance Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return DashletInstancePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new DashletInstancePeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var DashletInstancePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the das_ins_uid field.
- * @var string
- */
- protected $das_ins_uid = '';
-
-
- /**
- * The value for the das_uid field.
- * @var string
- */
- protected $das_uid = '';
-
-
- /**
- * The value for the das_ins_owner_type field.
- * @var string
- */
- protected $das_ins_owner_type = '';
-
-
- /**
- * The value for the das_ins_owner_uid field.
- * @var string
- */
- protected $das_ins_owner_uid = '';
-
-
- /**
- * The value for the das_ins_additional_properties field.
- * @var string
- */
- protected $das_ins_additional_properties;
-
-
- /**
- * The value for the das_ins_create_date field.
- * @var int
- */
- protected $das_ins_create_date;
-
-
- /**
- * The value for the das_ins_update_date field.
- * @var int
- */
- protected $das_ins_update_date;
-
-
- /**
- * The value for the das_ins_status field.
- * @var int
- */
- protected $das_ins_status = 1;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [das_ins_uid] column value.
- *
- * @return string
- */
- public function getDasInsUid()
- {
-
- return $this->das_ins_uid;
- }
-
- /**
- * Get the [das_uid] column value.
- *
- * @return string
- */
- public function getDasUid()
- {
-
- return $this->das_uid;
- }
-
- /**
- * Get the [das_ins_owner_type] column value.
- *
- * @return string
- */
- public function getDasInsOwnerType()
- {
-
- return $this->das_ins_owner_type;
- }
-
- /**
- * Get the [das_ins_owner_uid] column value.
- *
- * @return string
- */
- public function getDasInsOwnerUid()
- {
-
- return $this->das_ins_owner_uid;
- }
-
- /**
- * Get the [das_ins_additional_properties] column value.
- *
- * @return string
- */
- public function getDasInsAdditionalProperties()
- {
-
- return $this->das_ins_additional_properties;
- }
-
- /**
- * Get the [optionally formatted] [das_ins_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDasInsCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->das_ins_create_date === null || $this->das_ins_create_date === '') {
- return null;
- } elseif (!is_int($this->das_ins_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->das_ins_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [das_ins_create_date] as date/time value: " . var_export($this->das_ins_create_date, true));
- }
- } else {
- $ts = $this->das_ins_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [das_ins_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getDasInsUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->das_ins_update_date === null || $this->das_ins_update_date === '') {
- return null;
- } elseif (!is_int($this->das_ins_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->das_ins_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [das_ins_update_date] as date/time value: " . var_export($this->das_ins_update_date, true));
- }
- } else {
- $ts = $this->das_ins_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [das_ins_status] column value.
- *
- * @return int
- */
- public function getDasInsStatus()
- {
-
- return $this->das_ins_status;
- }
-
- /**
- * Set the value of [das_ins_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasInsUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_ins_uid !== $v || $v === '') {
- $this->das_ins_uid = $v;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_UID;
- }
-
- } // setDasInsUid()
-
- /**
- * Set the value of [das_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_uid !== $v || $v === '') {
- $this->das_uid = $v;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_UID;
- }
-
- } // setDasUid()
-
- /**
- * Set the value of [das_ins_owner_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasInsOwnerType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_ins_owner_type !== $v || $v === '') {
- $this->das_ins_owner_type = $v;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_OWNER_TYPE;
- }
-
- } // setDasInsOwnerType()
-
- /**
- * Set the value of [das_ins_owner_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasInsOwnerUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_ins_owner_uid !== $v || $v === '') {
- $this->das_ins_owner_uid = $v;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_OWNER_UID;
- }
-
- } // setDasInsOwnerUid()
-
- /**
- * Set the value of [das_ins_additional_properties] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDasInsAdditionalProperties($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->das_ins_additional_properties !== $v) {
- $this->das_ins_additional_properties = $v;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES;
- }
-
- } // setDasInsAdditionalProperties()
-
- /**
- * Set the value of [das_ins_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDasInsCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [das_ins_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->das_ins_create_date !== $ts) {
- $this->das_ins_create_date = $ts;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_CREATE_DATE;
- }
-
- } // setDasInsCreateDate()
-
- /**
- * Set the value of [das_ins_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDasInsUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [das_ins_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->das_ins_update_date !== $ts) {
- $this->das_ins_update_date = $ts;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_UPDATE_DATE;
- }
-
- } // setDasInsUpdateDate()
-
- /**
- * Set the value of [das_ins_status] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDasInsStatus($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->das_ins_status !== $v || $v === 1) {
- $this->das_ins_status = $v;
- $this->modifiedColumns[] = DashletInstancePeer::DAS_INS_STATUS;
- }
-
- } // setDasInsStatus()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->das_ins_uid = $rs->getString($startcol + 0);
-
- $this->das_uid = $rs->getString($startcol + 1);
-
- $this->das_ins_owner_type = $rs->getString($startcol + 2);
-
- $this->das_ins_owner_uid = $rs->getString($startcol + 3);
-
- $this->das_ins_additional_properties = $rs->getString($startcol + 4);
-
- $this->das_ins_create_date = $rs->getTimestamp($startcol + 5, null);
-
- $this->das_ins_update_date = $rs->getTimestamp($startcol + 6, null);
-
- $this->das_ins_status = $rs->getInt($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = DashletInstancePeer::NUM_COLUMNS - DashletInstancePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating DashletInstance object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- DashletInstancePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = DashletInstancePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += DashletInstancePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = DashletInstancePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DashletInstancePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getDasInsUid();
- break;
- case 1:
- return $this->getDasUid();
- break;
- case 2:
- return $this->getDasInsOwnerType();
- break;
- case 3:
- return $this->getDasInsOwnerUid();
- break;
- case 4:
- return $this->getDasInsAdditionalProperties();
- break;
- case 5:
- return $this->getDasInsCreateDate();
- break;
- case 6:
- return $this->getDasInsUpdateDate();
- break;
- case 7:
- return $this->getDasInsStatus();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DashletInstancePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getDasInsUid(),
- $keys[1] => $this->getDasUid(),
- $keys[2] => $this->getDasInsOwnerType(),
- $keys[3] => $this->getDasInsOwnerUid(),
- $keys[4] => $this->getDasInsAdditionalProperties(),
- $keys[5] => $this->getDasInsCreateDate(),
- $keys[6] => $this->getDasInsUpdateDate(),
- $keys[7] => $this->getDasInsStatus(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DashletInstancePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setDasInsUid($value);
- break;
- case 1:
- $this->setDasUid($value);
- break;
- case 2:
- $this->setDasInsOwnerType($value);
- break;
- case 3:
- $this->setDasInsOwnerUid($value);
- break;
- case 4:
- $this->setDasInsAdditionalProperties($value);
- break;
- case 5:
- $this->setDasInsCreateDate($value);
- break;
- case 6:
- $this->setDasInsUpdateDate($value);
- break;
- case 7:
- $this->setDasInsStatus($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DashletInstancePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setDasInsUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDasUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setDasInsOwnerType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDasInsOwnerUid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDasInsAdditionalProperties($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setDasInsCreateDate($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setDasInsUpdateDate($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setDasInsStatus($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(DashletInstancePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(DashletInstancePeer::DAS_INS_UID)) $criteria->add(DashletInstancePeer::DAS_INS_UID, $this->das_ins_uid);
- if ($this->isColumnModified(DashletInstancePeer::DAS_UID)) $criteria->add(DashletInstancePeer::DAS_UID, $this->das_uid);
- if ($this->isColumnModified(DashletInstancePeer::DAS_INS_OWNER_TYPE)) $criteria->add(DashletInstancePeer::DAS_INS_OWNER_TYPE, $this->das_ins_owner_type);
- if ($this->isColumnModified(DashletInstancePeer::DAS_INS_OWNER_UID)) $criteria->add(DashletInstancePeer::DAS_INS_OWNER_UID, $this->das_ins_owner_uid);
- if ($this->isColumnModified(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES)) $criteria->add(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, $this->das_ins_additional_properties);
- if ($this->isColumnModified(DashletInstancePeer::DAS_INS_CREATE_DATE)) $criteria->add(DashletInstancePeer::DAS_INS_CREATE_DATE, $this->das_ins_create_date);
- if ($this->isColumnModified(DashletInstancePeer::DAS_INS_UPDATE_DATE)) $criteria->add(DashletInstancePeer::DAS_INS_UPDATE_DATE, $this->das_ins_update_date);
- if ($this->isColumnModified(DashletInstancePeer::DAS_INS_STATUS)) $criteria->add(DashletInstancePeer::DAS_INS_STATUS, $this->das_ins_status);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(DashletInstancePeer::DATABASE_NAME);
-
- $criteria->add(DashletInstancePeer::DAS_INS_UID, $this->das_ins_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getDasInsUid();
- }
-
- /**
- * Generic method to set the primary key (das_ins_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setDasInsUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of DashletInstance (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setDasUid($this->das_uid);
-
- $copyObj->setDasInsOwnerType($this->das_ins_owner_type);
-
- $copyObj->setDasInsOwnerUid($this->das_ins_owner_uid);
-
- $copyObj->setDasInsAdditionalProperties($this->das_ins_additional_properties);
-
- $copyObj->setDasInsCreateDate($this->das_ins_create_date);
-
- $copyObj->setDasInsUpdateDate($this->das_ins_update_date);
-
- $copyObj->setDasInsStatus($this->das_ins_status);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setDasInsUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return DashletInstance Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return DashletInstancePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new DashletInstancePeer();
- }
- return self::$peer;
- }
-
-} // BaseDashletInstance
diff --git a/workflow/engine/classes/model/om/BaseDashletInstancePeer.php b/workflow/engine/classes/model/om/BaseDashletInstancePeer.php
index cce638e50..7481de92c 100644
--- a/workflow/engine/classes/model/om/BaseDashletInstancePeer.php
+++ b/workflow/engine/classes/model/om/BaseDashletInstancePeer.php
@@ -12,589 +12,591 @@ include_once 'classes/model/DashletInstance.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDashletInstancePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'DASHLET_INSTANCE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.DashletInstance';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the DAS_INS_UID field */
- const DAS_INS_UID = 'DASHLET_INSTANCE.DAS_INS_UID';
-
- /** the column name for the DAS_UID field */
- const DAS_UID = 'DASHLET_INSTANCE.DAS_UID';
-
- /** the column name for the DAS_INS_OWNER_TYPE field */
- const DAS_INS_OWNER_TYPE = 'DASHLET_INSTANCE.DAS_INS_OWNER_TYPE';
-
- /** the column name for the DAS_INS_OWNER_UID field */
- const DAS_INS_OWNER_UID = 'DASHLET_INSTANCE.DAS_INS_OWNER_UID';
-
- /** the column name for the DAS_INS_ADDITIONAL_PROPERTIES field */
- const DAS_INS_ADDITIONAL_PROPERTIES = 'DASHLET_INSTANCE.DAS_INS_ADDITIONAL_PROPERTIES';
-
- /** the column name for the DAS_INS_CREATE_DATE field */
- const DAS_INS_CREATE_DATE = 'DASHLET_INSTANCE.DAS_INS_CREATE_DATE';
-
- /** the column name for the DAS_INS_UPDATE_DATE field */
- const DAS_INS_UPDATE_DATE = 'DASHLET_INSTANCE.DAS_INS_UPDATE_DATE';
-
- /** the column name for the DAS_INS_STATUS field */
- const DAS_INS_STATUS = 'DASHLET_INSTANCE.DAS_INS_STATUS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('DasInsUid', 'DasUid', 'DasInsOwnerType', 'DasInsOwnerUid', 'DasInsAdditionalProperties', 'DasInsCreateDate', 'DasInsUpdateDate', 'DasInsStatus', ),
- BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID, DashletInstancePeer::DAS_UID, DashletInstancePeer::DAS_INS_OWNER_TYPE, DashletInstancePeer::DAS_INS_OWNER_UID, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, DashletInstancePeer::DAS_INS_CREATE_DATE, DashletInstancePeer::DAS_INS_UPDATE_DATE, DashletInstancePeer::DAS_INS_STATUS, ),
- BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID', 'DAS_UID', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID', 'DAS_INS_ADDITIONAL_PROPERTIES', 'DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_STATUS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('DasInsUid' => 0, 'DasUid' => 1, 'DasInsOwnerType' => 2, 'DasInsOwnerUid' => 3, 'DasInsAdditionalProperties' => 4, 'DasInsCreateDate' => 5, 'DasInsUpdateDate' => 6, 'DasInsStatus' => 7, ),
- BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID => 0, DashletInstancePeer::DAS_UID => 1, DashletInstancePeer::DAS_INS_OWNER_TYPE => 2, DashletInstancePeer::DAS_INS_OWNER_UID => 3, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES => 4, DashletInstancePeer::DAS_INS_CREATE_DATE => 5, DashletInstancePeer::DAS_INS_UPDATE_DATE => 6, DashletInstancePeer::DAS_INS_STATUS => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID' => 0, 'DAS_UID' => 1, 'DAS_INS_OWNER_TYPE' => 2, 'DAS_INS_OWNER_UID' => 3, 'DAS_INS_ADDITIONAL_PROPERTIES' => 4, 'DAS_INS_CREATE_DATE' => 5, 'DAS_INS_UPDATE_DATE' => 6, 'DAS_INS_STATUS' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/DashletInstanceMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.DashletInstanceMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = DashletInstancePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. DashletInstancePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(DashletInstancePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UID);
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_UID);
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_TYPE);
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_UID);
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES);
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CREATE_DATE);
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UPDATE_DATE);
-
- $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_STATUS);
-
- }
-
- const COUNT = 'COUNT(DASHLET_INSTANCE.DAS_INS_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT DASHLET_INSTANCE.DAS_INS_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(DashletInstancePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(DashletInstancePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = DashletInstancePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return DashletInstance
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = DashletInstancePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return DashletInstancePeer::populateObjects(DashletInstancePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- DashletInstancePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = DashletInstancePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return DashletInstancePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a DashletInstance or Criteria object.
- *
- * @param mixed $values Criteria or DashletInstance object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from DashletInstance object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a DashletInstance or Criteria object.
- *
- * @param mixed $values Criteria or DashletInstance object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(DashletInstancePeer::DAS_INS_UID);
- $selectCriteria->add(DashletInstancePeer::DAS_INS_UID, $criteria->remove(DashletInstancePeer::DAS_INS_UID), $comparison);
-
- } else { // $values is DashletInstance object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the DASHLET_INSTANCE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(DashletInstancePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a DashletInstance or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or DashletInstance object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof DashletInstance) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(DashletInstancePeer::DAS_INS_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given DashletInstance object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param DashletInstance $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(DashletInstance $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(DashletInstancePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(DashletInstancePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(DashletInstancePeer::DATABASE_NAME, DashletInstancePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return DashletInstance
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(DashletInstancePeer::DATABASE_NAME);
-
- $criteria->add(DashletInstancePeer::DAS_INS_UID, $pk);
-
-
- $v = DashletInstancePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(DashletInstancePeer::DAS_INS_UID, $pks, Criteria::IN);
- $objs = DashletInstancePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseDashletInstancePeer
+abstract class BaseDashletInstancePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'DASHLET_INSTANCE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.DashletInstance';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the DAS_INS_UID field */
+ const DAS_INS_UID = 'DASHLET_INSTANCE.DAS_INS_UID';
+
+ /** the column name for the DAS_UID field */
+ const DAS_UID = 'DASHLET_INSTANCE.DAS_UID';
+
+ /** the column name for the DAS_INS_OWNER_TYPE field */
+ const DAS_INS_OWNER_TYPE = 'DASHLET_INSTANCE.DAS_INS_OWNER_TYPE';
+
+ /** the column name for the DAS_INS_OWNER_UID field */
+ const DAS_INS_OWNER_UID = 'DASHLET_INSTANCE.DAS_INS_OWNER_UID';
+
+ /** the column name for the DAS_INS_ADDITIONAL_PROPERTIES field */
+ const DAS_INS_ADDITIONAL_PROPERTIES = 'DASHLET_INSTANCE.DAS_INS_ADDITIONAL_PROPERTIES';
+
+ /** the column name for the DAS_INS_CREATE_DATE field */
+ const DAS_INS_CREATE_DATE = 'DASHLET_INSTANCE.DAS_INS_CREATE_DATE';
+
+ /** the column name for the DAS_INS_UPDATE_DATE field */
+ const DAS_INS_UPDATE_DATE = 'DASHLET_INSTANCE.DAS_INS_UPDATE_DATE';
+
+ /** the column name for the DAS_INS_STATUS field */
+ const DAS_INS_STATUS = 'DASHLET_INSTANCE.DAS_INS_STATUS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('DasInsUid', 'DasUid', 'DasInsOwnerType', 'DasInsOwnerUid', 'DasInsAdditionalProperties', 'DasInsCreateDate', 'DasInsUpdateDate', 'DasInsStatus', ),
+ BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID, DashletInstancePeer::DAS_UID, DashletInstancePeer::DAS_INS_OWNER_TYPE, DashletInstancePeer::DAS_INS_OWNER_UID, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, DashletInstancePeer::DAS_INS_CREATE_DATE, DashletInstancePeer::DAS_INS_UPDATE_DATE, DashletInstancePeer::DAS_INS_STATUS, ),
+ BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID', 'DAS_UID', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID', 'DAS_INS_ADDITIONAL_PROPERTIES', 'DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_STATUS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('DasInsUid' => 0, 'DasUid' => 1, 'DasInsOwnerType' => 2, 'DasInsOwnerUid' => 3, 'DasInsAdditionalProperties' => 4, 'DasInsCreateDate' => 5, 'DasInsUpdateDate' => 6, 'DasInsStatus' => 7, ),
+ BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID => 0, DashletInstancePeer::DAS_UID => 1, DashletInstancePeer::DAS_INS_OWNER_TYPE => 2, DashletInstancePeer::DAS_INS_OWNER_UID => 3, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES => 4, DashletInstancePeer::DAS_INS_CREATE_DATE => 5, DashletInstancePeer::DAS_INS_UPDATE_DATE => 6, DashletInstancePeer::DAS_INS_STATUS => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID' => 0, 'DAS_UID' => 1, 'DAS_INS_OWNER_TYPE' => 2, 'DAS_INS_OWNER_UID' => 3, 'DAS_INS_ADDITIONAL_PROPERTIES' => 4, 'DAS_INS_CREATE_DATE' => 5, 'DAS_INS_UPDATE_DATE' => 6, 'DAS_INS_STATUS' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/DashletInstanceMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.DashletInstanceMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = DashletInstancePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. DashletInstancePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(DashletInstancePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UID);
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_UID);
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_TYPE);
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_UID);
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES);
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CREATE_DATE);
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UPDATE_DATE);
+
+ $criteria->addSelectColumn(DashletInstancePeer::DAS_INS_STATUS);
+
+ }
+
+ const COUNT = 'COUNT(DASHLET_INSTANCE.DAS_INS_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT DASHLET_INSTANCE.DAS_INS_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(DashletInstancePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(DashletInstancePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = DashletInstancePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return DashletInstance
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = DashletInstancePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return DashletInstancePeer::populateObjects(DashletInstancePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ DashletInstancePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = DashletInstancePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return DashletInstancePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a DashletInstance or Criteria object.
+ *
+ * @param mixed $values Criteria or DashletInstance object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from DashletInstance object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a DashletInstance or Criteria object.
+ *
+ * @param mixed $values Criteria or DashletInstance object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(DashletInstancePeer::DAS_INS_UID);
+ $selectCriteria->add(DashletInstancePeer::DAS_INS_UID, $criteria->remove(DashletInstancePeer::DAS_INS_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the DASHLET_INSTANCE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(DashletInstancePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a DashletInstance or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or DashletInstance object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof DashletInstance) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(DashletInstancePeer::DAS_INS_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given DashletInstance object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param DashletInstance $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(DashletInstance $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(DashletInstancePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(DashletInstancePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(DashletInstancePeer::DATABASE_NAME, DashletInstancePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return DashletInstance
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(DashletInstancePeer::DATABASE_NAME);
+
+ $criteria->add(DashletInstancePeer::DAS_INS_UID, $pk);
+
+
+ $v = DashletInstancePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(DashletInstancePeer::DAS_INS_UID, $pks, Criteria::IN);
+ $objs = DashletInstancePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseDashletInstancePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseDashletInstancePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/DashletInstanceMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.DashletInstanceMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/DashletInstanceMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.DashletInstanceMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseDashletPeer.php b/workflow/engine/classes/model/om/BaseDashletPeer.php
index a4ab785c4..9c78807e7 100644
--- a/workflow/engine/classes/model/om/BaseDashletPeer.php
+++ b/workflow/engine/classes/model/om/BaseDashletPeer.php
@@ -12,589 +12,591 @@ include_once 'classes/model/Dashlet.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDashletPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'DASHLET';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Dashlet';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the DAS_UID field */
- const DAS_UID = 'DASHLET.DAS_UID';
-
- /** the column name for the DAS_CLASS field */
- const DAS_CLASS = 'DASHLET.DAS_CLASS';
-
- /** the column name for the DAS_TITLE field */
- const DAS_TITLE = 'DASHLET.DAS_TITLE';
-
- /** the column name for the DAS_DESCRIPTION field */
- const DAS_DESCRIPTION = 'DASHLET.DAS_DESCRIPTION';
-
- /** the column name for the DAS_VERSION field */
- const DAS_VERSION = 'DASHLET.DAS_VERSION';
-
- /** the column name for the DAS_CREATE_DATE field */
- const DAS_CREATE_DATE = 'DASHLET.DAS_CREATE_DATE';
-
- /** the column name for the DAS_UPDATE_DATE field */
- const DAS_UPDATE_DATE = 'DASHLET.DAS_UPDATE_DATE';
-
- /** the column name for the DAS_STATUS field */
- const DAS_STATUS = 'DASHLET.DAS_STATUS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('DasUid', 'DasClass', 'DasTitle', 'DasDescription', 'DasVersion', 'DasCreateDate', 'DasUpdateDate', 'DasStatus', ),
- BasePeer::TYPE_COLNAME => array (DashletPeer::DAS_UID, DashletPeer::DAS_CLASS, DashletPeer::DAS_TITLE, DashletPeer::DAS_DESCRIPTION, DashletPeer::DAS_VERSION, DashletPeer::DAS_CREATE_DATE, DashletPeer::DAS_UPDATE_DATE, DashletPeer::DAS_STATUS, ),
- BasePeer::TYPE_FIELDNAME => array ('DAS_UID', 'DAS_CLASS', 'DAS_TITLE', 'DAS_DESCRIPTION', 'DAS_VERSION', 'DAS_CREATE_DATE', 'DAS_UPDATE_DATE', 'DAS_STATUS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('DasUid' => 0, 'DasClass' => 1, 'DasTitle' => 2, 'DasDescription' => 3, 'DasVersion' => 4, 'DasCreateDate' => 5, 'DasUpdateDate' => 6, 'DasStatus' => 7, ),
- BasePeer::TYPE_COLNAME => array (DashletPeer::DAS_UID => 0, DashletPeer::DAS_CLASS => 1, DashletPeer::DAS_TITLE => 2, DashletPeer::DAS_DESCRIPTION => 3, DashletPeer::DAS_VERSION => 4, DashletPeer::DAS_CREATE_DATE => 5, DashletPeer::DAS_UPDATE_DATE => 6, DashletPeer::DAS_STATUS => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('DAS_UID' => 0, 'DAS_CLASS' => 1, 'DAS_TITLE' => 2, 'DAS_DESCRIPTION' => 3, 'DAS_VERSION' => 4, 'DAS_CREATE_DATE' => 5, 'DAS_UPDATE_DATE' => 6, 'DAS_STATUS' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/DashletMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.DashletMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = DashletPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. DashletPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(DashletPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(DashletPeer::DAS_UID);
-
- $criteria->addSelectColumn(DashletPeer::DAS_CLASS);
-
- $criteria->addSelectColumn(DashletPeer::DAS_TITLE);
-
- $criteria->addSelectColumn(DashletPeer::DAS_DESCRIPTION);
-
- $criteria->addSelectColumn(DashletPeer::DAS_VERSION);
-
- $criteria->addSelectColumn(DashletPeer::DAS_CREATE_DATE);
-
- $criteria->addSelectColumn(DashletPeer::DAS_UPDATE_DATE);
-
- $criteria->addSelectColumn(DashletPeer::DAS_STATUS);
-
- }
-
- const COUNT = 'COUNT(DASHLET.DAS_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT DASHLET.DAS_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(DashletPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(DashletPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = DashletPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Dashlet
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = DashletPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return DashletPeer::populateObjects(DashletPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- DashletPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = DashletPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return DashletPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Dashlet or Criteria object.
- *
- * @param mixed $values Criteria or Dashlet object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Dashlet object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Dashlet or Criteria object.
- *
- * @param mixed $values Criteria or Dashlet object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(DashletPeer::DAS_UID);
- $selectCriteria->add(DashletPeer::DAS_UID, $criteria->remove(DashletPeer::DAS_UID), $comparison);
-
- } else { // $values is Dashlet object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the DASHLET table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(DashletPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Dashlet or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Dashlet object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(DashletPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Dashlet) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(DashletPeer::DAS_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Dashlet object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Dashlet $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Dashlet $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(DashletPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(DashletPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(DashletPeer::DATABASE_NAME, DashletPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Dashlet
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(DashletPeer::DATABASE_NAME);
-
- $criteria->add(DashletPeer::DAS_UID, $pk);
-
-
- $v = DashletPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(DashletPeer::DAS_UID, $pks, Criteria::IN);
- $objs = DashletPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseDashletPeer
+abstract class BaseDashletPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'DASHLET';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Dashlet';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the DAS_UID field */
+ const DAS_UID = 'DASHLET.DAS_UID';
+
+ /** the column name for the DAS_CLASS field */
+ const DAS_CLASS = 'DASHLET.DAS_CLASS';
+
+ /** the column name for the DAS_TITLE field */
+ const DAS_TITLE = 'DASHLET.DAS_TITLE';
+
+ /** the column name for the DAS_DESCRIPTION field */
+ const DAS_DESCRIPTION = 'DASHLET.DAS_DESCRIPTION';
+
+ /** the column name for the DAS_VERSION field */
+ const DAS_VERSION = 'DASHLET.DAS_VERSION';
+
+ /** the column name for the DAS_CREATE_DATE field */
+ const DAS_CREATE_DATE = 'DASHLET.DAS_CREATE_DATE';
+
+ /** the column name for the DAS_UPDATE_DATE field */
+ const DAS_UPDATE_DATE = 'DASHLET.DAS_UPDATE_DATE';
+
+ /** the column name for the DAS_STATUS field */
+ const DAS_STATUS = 'DASHLET.DAS_STATUS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('DasUid', 'DasClass', 'DasTitle', 'DasDescription', 'DasVersion', 'DasCreateDate', 'DasUpdateDate', 'DasStatus', ),
+ BasePeer::TYPE_COLNAME => array (DashletPeer::DAS_UID, DashletPeer::DAS_CLASS, DashletPeer::DAS_TITLE, DashletPeer::DAS_DESCRIPTION, DashletPeer::DAS_VERSION, DashletPeer::DAS_CREATE_DATE, DashletPeer::DAS_UPDATE_DATE, DashletPeer::DAS_STATUS, ),
+ BasePeer::TYPE_FIELDNAME => array ('DAS_UID', 'DAS_CLASS', 'DAS_TITLE', 'DAS_DESCRIPTION', 'DAS_VERSION', 'DAS_CREATE_DATE', 'DAS_UPDATE_DATE', 'DAS_STATUS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('DasUid' => 0, 'DasClass' => 1, 'DasTitle' => 2, 'DasDescription' => 3, 'DasVersion' => 4, 'DasCreateDate' => 5, 'DasUpdateDate' => 6, 'DasStatus' => 7, ),
+ BasePeer::TYPE_COLNAME => array (DashletPeer::DAS_UID => 0, DashletPeer::DAS_CLASS => 1, DashletPeer::DAS_TITLE => 2, DashletPeer::DAS_DESCRIPTION => 3, DashletPeer::DAS_VERSION => 4, DashletPeer::DAS_CREATE_DATE => 5, DashletPeer::DAS_UPDATE_DATE => 6, DashletPeer::DAS_STATUS => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('DAS_UID' => 0, 'DAS_CLASS' => 1, 'DAS_TITLE' => 2, 'DAS_DESCRIPTION' => 3, 'DAS_VERSION' => 4, 'DAS_CREATE_DATE' => 5, 'DAS_UPDATE_DATE' => 6, 'DAS_STATUS' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/DashletMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.DashletMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = DashletPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. DashletPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(DashletPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(DashletPeer::DAS_UID);
+
+ $criteria->addSelectColumn(DashletPeer::DAS_CLASS);
+
+ $criteria->addSelectColumn(DashletPeer::DAS_TITLE);
+
+ $criteria->addSelectColumn(DashletPeer::DAS_DESCRIPTION);
+
+ $criteria->addSelectColumn(DashletPeer::DAS_VERSION);
+
+ $criteria->addSelectColumn(DashletPeer::DAS_CREATE_DATE);
+
+ $criteria->addSelectColumn(DashletPeer::DAS_UPDATE_DATE);
+
+ $criteria->addSelectColumn(DashletPeer::DAS_STATUS);
+
+ }
+
+ const COUNT = 'COUNT(DASHLET.DAS_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT DASHLET.DAS_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(DashletPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(DashletPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = DashletPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Dashlet
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = DashletPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return DashletPeer::populateObjects(DashletPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ DashletPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = DashletPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return DashletPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Dashlet or Criteria object.
+ *
+ * @param mixed $values Criteria or Dashlet object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Dashlet object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Dashlet or Criteria object.
+ *
+ * @param mixed $values Criteria or Dashlet object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(DashletPeer::DAS_UID);
+ $selectCriteria->add(DashletPeer::DAS_UID, $criteria->remove(DashletPeer::DAS_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the DASHLET table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(DashletPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Dashlet or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Dashlet object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(DashletPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Dashlet) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(DashletPeer::DAS_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Dashlet object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Dashlet $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Dashlet $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(DashletPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(DashletPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(DashletPeer::DATABASE_NAME, DashletPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Dashlet
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(DashletPeer::DATABASE_NAME);
+
+ $criteria->add(DashletPeer::DAS_UID, $pk);
+
+
+ $v = DashletPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(DashletPeer::DAS_UID, $pks, Criteria::IN);
+ $objs = DashletPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseDashletPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseDashletPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/DashletMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.DashletMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/DashletMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.DashletMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseDbSource.php b/workflow/engine/classes/model/om/BaseDbSource.php
index 4b5dd26e2..cefc79492 100755
--- a/workflow/engine/classes/model/om/BaseDbSource.php
+++ b/workflow/engine/classes/model/om/BaseDbSource.php
@@ -16,925 +16,971 @@ include_once 'classes/model/DbSourcePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDbSource extends BaseObject implements Persistent {
+abstract class BaseDbSource extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var DbSourcePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the dbs_uid field.
+ * @var string
+ */
+ protected $dbs_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the dbs_type field.
+ * @var string
+ */
+ protected $dbs_type = '0';
+
+ /**
+ * The value for the dbs_server field.
+ * @var string
+ */
+ protected $dbs_server = '0';
+
+ /**
+ * The value for the dbs_database_name field.
+ * @var string
+ */
+ protected $dbs_database_name = '0';
+
+ /**
+ * The value for the dbs_username field.
+ * @var string
+ */
+ protected $dbs_username = '0';
+
+ /**
+ * The value for the dbs_password field.
+ * @var string
+ */
+ protected $dbs_password = '';
+
+ /**
+ * The value for the dbs_port field.
+ * @var int
+ */
+ protected $dbs_port = 0;
+
+ /**
+ * The value for the dbs_encode field.
+ * @var string
+ */
+ protected $dbs_encode = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [dbs_uid] column value.
+ *
+ * @return string
+ */
+ public function getDbsUid()
+ {
+
+ return $this->dbs_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [dbs_type] column value.
+ *
+ * @return string
+ */
+ public function getDbsType()
+ {
+
+ return $this->dbs_type;
+ }
+
+ /**
+ * Get the [dbs_server] column value.
+ *
+ * @return string
+ */
+ public function getDbsServer()
+ {
+
+ return $this->dbs_server;
+ }
+
+ /**
+ * Get the [dbs_database_name] column value.
+ *
+ * @return string
+ */
+ public function getDbsDatabaseName()
+ {
+
+ return $this->dbs_database_name;
+ }
+
+ /**
+ * Get the [dbs_username] column value.
+ *
+ * @return string
+ */
+ public function getDbsUsername()
+ {
+
+ return $this->dbs_username;
+ }
+
+ /**
+ * Get the [dbs_password] column value.
+ *
+ * @return string
+ */
+ public function getDbsPassword()
+ {
+
+ return $this->dbs_password;
+ }
+
+ /**
+ * Get the [dbs_port] column value.
+ *
+ * @return int
+ */
+ public function getDbsPort()
+ {
+
+ return $this->dbs_port;
+ }
+
+ /**
+ * Get the [dbs_encode] column value.
+ *
+ * @return string
+ */
+ public function getDbsEncode()
+ {
+
+ return $this->dbs_encode;
+ }
+
+ /**
+ * Set the value of [dbs_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_uid !== $v || $v === '') {
+ $this->dbs_uid = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_UID;
+ }
+
+ } // setDbsUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = DbSourcePeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [dbs_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_type !== $v || $v === '0') {
+ $this->dbs_type = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_TYPE;
+ }
+
+ } // setDbsType()
+
+ /**
+ * Set the value of [dbs_server] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsServer($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_server !== $v || $v === '0') {
+ $this->dbs_server = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_SERVER;
+ }
+
+ } // setDbsServer()
+
+ /**
+ * Set the value of [dbs_database_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsDatabaseName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_database_name !== $v || $v === '0') {
+ $this->dbs_database_name = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_DATABASE_NAME;
+ }
+
+ } // setDbsDatabaseName()
+
+ /**
+ * Set the value of [dbs_username] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsUsername($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_username !== $v || $v === '0') {
+ $this->dbs_username = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_USERNAME;
+ }
+
+ } // setDbsUsername()
+
+ /**
+ * Set the value of [dbs_password] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsPassword($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_password !== $v || $v === '') {
+ $this->dbs_password = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_PASSWORD;
+ }
+
+ } // setDbsPassword()
+
+ /**
+ * Set the value of [dbs_port] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDbsPort($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->dbs_port !== $v || $v === 0) {
+ $this->dbs_port = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_PORT;
+ }
+
+ } // setDbsPort()
+
+ /**
+ * Set the value of [dbs_encode] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDbsEncode($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dbs_encode !== $v || $v === '') {
+ $this->dbs_encode = $v;
+ $this->modifiedColumns[] = DbSourcePeer::DBS_ENCODE;
+ }
+
+ } // setDbsEncode()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->dbs_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->dbs_type = $rs->getString($startcol + 2);
+
+ $this->dbs_server = $rs->getString($startcol + 3);
+
+ $this->dbs_database_name = $rs->getString($startcol + 4);
+
+ $this->dbs_username = $rs->getString($startcol + 5);
+
+ $this->dbs_password = $rs->getString($startcol + 6);
+
+ $this->dbs_port = $rs->getInt($startcol + 7);
+
+ $this->dbs_encode = $rs->getString($startcol + 8);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 9; // 9 = DbSourcePeer::NUM_COLUMNS - DbSourcePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating DbSource object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ DbSourcePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = DbSourcePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += DbSourcePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = DbSourcePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DbSourcePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getDbsUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getDbsType();
+ break;
+ case 3:
+ return $this->getDbsServer();
+ break;
+ case 4:
+ return $this->getDbsDatabaseName();
+ break;
+ case 5:
+ return $this->getDbsUsername();
+ break;
+ case 6:
+ return $this->getDbsPassword();
+ break;
+ case 7:
+ return $this->getDbsPort();
+ break;
+ case 8:
+ return $this->getDbsEncode();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DbSourcePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getDbsUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getDbsType(),
+ $keys[3] => $this->getDbsServer(),
+ $keys[4] => $this->getDbsDatabaseName(),
+ $keys[5] => $this->getDbsUsername(),
+ $keys[6] => $this->getDbsPassword(),
+ $keys[7] => $this->getDbsPort(),
+ $keys[8] => $this->getDbsEncode(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DbSourcePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setDbsUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setDbsType($value);
+ break;
+ case 3:
+ $this->setDbsServer($value);
+ break;
+ case 4:
+ $this->setDbsDatabaseName($value);
+ break;
+ case 5:
+ $this->setDbsUsername($value);
+ break;
+ case 6:
+ $this->setDbsPassword($value);
+ break;
+ case 7:
+ $this->setDbsPort($value);
+ break;
+ case 8:
+ $this->setDbsEncode($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DbSourcePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setDbsUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setDbsType($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDbsServer($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setDbsDatabaseName($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setDbsUsername($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setDbsPassword($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setDbsPort($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setDbsEncode($arr[$keys[8]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(DbSourcePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_UID)) {
+ $criteria->add(DbSourcePeer::DBS_UID, $this->dbs_uid);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::PRO_UID)) {
+ $criteria->add(DbSourcePeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_TYPE)) {
+ $criteria->add(DbSourcePeer::DBS_TYPE, $this->dbs_type);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_SERVER)) {
+ $criteria->add(DbSourcePeer::DBS_SERVER, $this->dbs_server);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_DATABASE_NAME)) {
+ $criteria->add(DbSourcePeer::DBS_DATABASE_NAME, $this->dbs_database_name);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_USERNAME)) {
+ $criteria->add(DbSourcePeer::DBS_USERNAME, $this->dbs_username);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_PASSWORD)) {
+ $criteria->add(DbSourcePeer::DBS_PASSWORD, $this->dbs_password);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_PORT)) {
+ $criteria->add(DbSourcePeer::DBS_PORT, $this->dbs_port);
+ }
+
+ if ($this->isColumnModified(DbSourcePeer::DBS_ENCODE)) {
+ $criteria->add(DbSourcePeer::DBS_ENCODE, $this->dbs_encode);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(DbSourcePeer::DATABASE_NAME);
+
+ $criteria->add(DbSourcePeer::DBS_UID, $this->dbs_uid);
+ $criteria->add(DbSourcePeer::PRO_UID, $this->pro_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getDbsUid();
+
+ $pks[1] = $this->getProUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setDbsUid($keys[0]);
+
+ $this->setProUid($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of DbSource (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setDbsType($this->dbs_type);
+
+ $copyObj->setDbsServer($this->dbs_server);
+
+ $copyObj->setDbsDatabaseName($this->dbs_database_name);
+
+ $copyObj->setDbsUsername($this->dbs_username);
+
+ $copyObj->setDbsPassword($this->dbs_password);
+
+ $copyObj->setDbsPort($this->dbs_port);
+
+ $copyObj->setDbsEncode($this->dbs_encode);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setDbsUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setProUid('0'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return DbSource Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return DbSourcePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new DbSourcePeer();
+ }
+ return self::$peer;
+ }
+}
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var DbSourcePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the dbs_uid field.
- * @var string
- */
- protected $dbs_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the dbs_type field.
- * @var string
- */
- protected $dbs_type = '0';
-
-
- /**
- * The value for the dbs_server field.
- * @var string
- */
- protected $dbs_server = '0';
-
-
- /**
- * The value for the dbs_database_name field.
- * @var string
- */
- protected $dbs_database_name = '0';
-
-
- /**
- * The value for the dbs_username field.
- * @var string
- */
- protected $dbs_username = '0';
-
-
- /**
- * The value for the dbs_password field.
- * @var string
- */
- protected $dbs_password = '';
-
-
- /**
- * The value for the dbs_port field.
- * @var int
- */
- protected $dbs_port = 0;
-
-
- /**
- * The value for the dbs_encode field.
- * @var string
- */
- protected $dbs_encode = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [dbs_uid] column value.
- *
- * @return string
- */
- public function getDbsUid()
- {
-
- return $this->dbs_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [dbs_type] column value.
- *
- * @return string
- */
- public function getDbsType()
- {
-
- return $this->dbs_type;
- }
-
- /**
- * Get the [dbs_server] column value.
- *
- * @return string
- */
- public function getDbsServer()
- {
-
- return $this->dbs_server;
- }
-
- /**
- * Get the [dbs_database_name] column value.
- *
- * @return string
- */
- public function getDbsDatabaseName()
- {
-
- return $this->dbs_database_name;
- }
-
- /**
- * Get the [dbs_username] column value.
- *
- * @return string
- */
- public function getDbsUsername()
- {
-
- return $this->dbs_username;
- }
-
- /**
- * Get the [dbs_password] column value.
- *
- * @return string
- */
- public function getDbsPassword()
- {
-
- return $this->dbs_password;
- }
-
- /**
- * Get the [dbs_port] column value.
- *
- * @return int
- */
- public function getDbsPort()
- {
-
- return $this->dbs_port;
- }
-
- /**
- * Get the [dbs_encode] column value.
- *
- * @return string
- */
- public function getDbsEncode()
- {
-
- return $this->dbs_encode;
- }
-
- /**
- * Set the value of [dbs_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_uid !== $v || $v === '') {
- $this->dbs_uid = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_UID;
- }
-
- } // setDbsUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = DbSourcePeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [dbs_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_type !== $v || $v === '0') {
- $this->dbs_type = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_TYPE;
- }
-
- } // setDbsType()
-
- /**
- * Set the value of [dbs_server] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsServer($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_server !== $v || $v === '0') {
- $this->dbs_server = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_SERVER;
- }
-
- } // setDbsServer()
-
- /**
- * Set the value of [dbs_database_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsDatabaseName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_database_name !== $v || $v === '0') {
- $this->dbs_database_name = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_DATABASE_NAME;
- }
-
- } // setDbsDatabaseName()
-
- /**
- * Set the value of [dbs_username] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsUsername($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_username !== $v || $v === '0') {
- $this->dbs_username = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_USERNAME;
- }
-
- } // setDbsUsername()
-
- /**
- * Set the value of [dbs_password] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsPassword($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_password !== $v || $v === '') {
- $this->dbs_password = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_PASSWORD;
- }
-
- } // setDbsPassword()
-
- /**
- * Set the value of [dbs_port] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDbsPort($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->dbs_port !== $v || $v === 0) {
- $this->dbs_port = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_PORT;
- }
-
- } // setDbsPort()
-
- /**
- * Set the value of [dbs_encode] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDbsEncode($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dbs_encode !== $v || $v === '') {
- $this->dbs_encode = $v;
- $this->modifiedColumns[] = DbSourcePeer::DBS_ENCODE;
- }
-
- } // setDbsEncode()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->dbs_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->dbs_type = $rs->getString($startcol + 2);
-
- $this->dbs_server = $rs->getString($startcol + 3);
-
- $this->dbs_database_name = $rs->getString($startcol + 4);
-
- $this->dbs_username = $rs->getString($startcol + 5);
-
- $this->dbs_password = $rs->getString($startcol + 6);
-
- $this->dbs_port = $rs->getInt($startcol + 7);
-
- $this->dbs_encode = $rs->getString($startcol + 8);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 9; // 9 = DbSourcePeer::NUM_COLUMNS - DbSourcePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating DbSource object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- DbSourcePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = DbSourcePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += DbSourcePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = DbSourcePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DbSourcePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getDbsUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getDbsType();
- break;
- case 3:
- return $this->getDbsServer();
- break;
- case 4:
- return $this->getDbsDatabaseName();
- break;
- case 5:
- return $this->getDbsUsername();
- break;
- case 6:
- return $this->getDbsPassword();
- break;
- case 7:
- return $this->getDbsPort();
- break;
- case 8:
- return $this->getDbsEncode();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DbSourcePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getDbsUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getDbsType(),
- $keys[3] => $this->getDbsServer(),
- $keys[4] => $this->getDbsDatabaseName(),
- $keys[5] => $this->getDbsUsername(),
- $keys[6] => $this->getDbsPassword(),
- $keys[7] => $this->getDbsPort(),
- $keys[8] => $this->getDbsEncode(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DbSourcePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setDbsUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setDbsType($value);
- break;
- case 3:
- $this->setDbsServer($value);
- break;
- case 4:
- $this->setDbsDatabaseName($value);
- break;
- case 5:
- $this->setDbsUsername($value);
- break;
- case 6:
- $this->setDbsPassword($value);
- break;
- case 7:
- $this->setDbsPort($value);
- break;
- case 8:
- $this->setDbsEncode($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DbSourcePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setDbsUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setDbsType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDbsServer($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDbsDatabaseName($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setDbsUsername($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setDbsPassword($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setDbsPort($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setDbsEncode($arr[$keys[8]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(DbSourcePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(DbSourcePeer::DBS_UID)) $criteria->add(DbSourcePeer::DBS_UID, $this->dbs_uid);
- if ($this->isColumnModified(DbSourcePeer::PRO_UID)) $criteria->add(DbSourcePeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(DbSourcePeer::DBS_TYPE)) $criteria->add(DbSourcePeer::DBS_TYPE, $this->dbs_type);
- if ($this->isColumnModified(DbSourcePeer::DBS_SERVER)) $criteria->add(DbSourcePeer::DBS_SERVER, $this->dbs_server);
- if ($this->isColumnModified(DbSourcePeer::DBS_DATABASE_NAME)) $criteria->add(DbSourcePeer::DBS_DATABASE_NAME, $this->dbs_database_name);
- if ($this->isColumnModified(DbSourcePeer::DBS_USERNAME)) $criteria->add(DbSourcePeer::DBS_USERNAME, $this->dbs_username);
- if ($this->isColumnModified(DbSourcePeer::DBS_PASSWORD)) $criteria->add(DbSourcePeer::DBS_PASSWORD, $this->dbs_password);
- if ($this->isColumnModified(DbSourcePeer::DBS_PORT)) $criteria->add(DbSourcePeer::DBS_PORT, $this->dbs_port);
- if ($this->isColumnModified(DbSourcePeer::DBS_ENCODE)) $criteria->add(DbSourcePeer::DBS_ENCODE, $this->dbs_encode);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(DbSourcePeer::DATABASE_NAME);
-
- $criteria->add(DbSourcePeer::DBS_UID, $this->dbs_uid);
- $criteria->add(DbSourcePeer::PRO_UID, $this->pro_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getDbsUid();
-
- $pks[1] = $this->getProUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setDbsUid($keys[0]);
-
- $this->setProUid($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of DbSource (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setDbsType($this->dbs_type);
-
- $copyObj->setDbsServer($this->dbs_server);
-
- $copyObj->setDbsDatabaseName($this->dbs_database_name);
-
- $copyObj->setDbsUsername($this->dbs_username);
-
- $copyObj->setDbsPassword($this->dbs_password);
-
- $copyObj->setDbsPort($this->dbs_port);
-
- $copyObj->setDbsEncode($this->dbs_encode);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setDbsUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setProUid('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return DbSource Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return DbSourcePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new DbSourcePeer();
- }
- return self::$peer;
- }
-
-} // BaseDbSource
diff --git a/workflow/engine/classes/model/om/BaseDbSourcePeer.php b/workflow/engine/classes/model/om/BaseDbSourcePeer.php
index c3dcafda1..ff2eaf6a0 100755
--- a/workflow/engine/classes/model/om/BaseDbSourcePeer.php
+++ b/workflow/engine/classes/model/om/BaseDbSourcePeer.php
@@ -12,585 +12,586 @@ include_once 'classes/model/DbSource.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDbSourcePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'DB_SOURCE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.DbSource';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 9;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the DBS_UID field */
- const DBS_UID = 'DB_SOURCE.DBS_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'DB_SOURCE.PRO_UID';
-
- /** the column name for the DBS_TYPE field */
- const DBS_TYPE = 'DB_SOURCE.DBS_TYPE';
-
- /** the column name for the DBS_SERVER field */
- const DBS_SERVER = 'DB_SOURCE.DBS_SERVER';
-
- /** the column name for the DBS_DATABASE_NAME field */
- const DBS_DATABASE_NAME = 'DB_SOURCE.DBS_DATABASE_NAME';
-
- /** the column name for the DBS_USERNAME field */
- const DBS_USERNAME = 'DB_SOURCE.DBS_USERNAME';
-
- /** the column name for the DBS_PASSWORD field */
- const DBS_PASSWORD = 'DB_SOURCE.DBS_PASSWORD';
-
- /** the column name for the DBS_PORT field */
- const DBS_PORT = 'DB_SOURCE.DBS_PORT';
-
- /** the column name for the DBS_ENCODE field */
- const DBS_ENCODE = 'DB_SOURCE.DBS_ENCODE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('DbsUid', 'ProUid', 'DbsType', 'DbsServer', 'DbsDatabaseName', 'DbsUsername', 'DbsPassword', 'DbsPort', 'DbsEncode', ),
- BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID, DbSourcePeer::PRO_UID, DbSourcePeer::DBS_TYPE, DbSourcePeer::DBS_SERVER, DbSourcePeer::DBS_DATABASE_NAME, DbSourcePeer::DBS_USERNAME, DbSourcePeer::DBS_PASSWORD, DbSourcePeer::DBS_PORT, DbSourcePeer::DBS_ENCODE, ),
- BasePeer::TYPE_FIELDNAME => array ('DBS_UID', 'PRO_UID', 'DBS_TYPE', 'DBS_SERVER', 'DBS_DATABASE_NAME', 'DBS_USERNAME', 'DBS_PASSWORD', 'DBS_PORT', 'DBS_ENCODE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('DbsUid' => 0, 'ProUid' => 1, 'DbsType' => 2, 'DbsServer' => 3, 'DbsDatabaseName' => 4, 'DbsUsername' => 5, 'DbsPassword' => 6, 'DbsPort' => 7, 'DbsEncode' => 8, ),
- BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID => 0, DbSourcePeer::PRO_UID => 1, DbSourcePeer::DBS_TYPE => 2, DbSourcePeer::DBS_SERVER => 3, DbSourcePeer::DBS_DATABASE_NAME => 4, DbSourcePeer::DBS_USERNAME => 5, DbSourcePeer::DBS_PASSWORD => 6, DbSourcePeer::DBS_PORT => 7, DbSourcePeer::DBS_ENCODE => 8, ),
- BasePeer::TYPE_FIELDNAME => array ('DBS_UID' => 0, 'PRO_UID' => 1, 'DBS_TYPE' => 2, 'DBS_SERVER' => 3, 'DBS_DATABASE_NAME' => 4, 'DBS_USERNAME' => 5, 'DBS_PASSWORD' => 6, 'DBS_PORT' => 7, 'DBS_ENCODE' => 8, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/DbSourceMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.DbSourceMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = DbSourcePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. DbSourcePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(DbSourcePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_UID);
-
- $criteria->addSelectColumn(DbSourcePeer::PRO_UID);
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_SERVER);
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_DATABASE_NAME);
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_USERNAME);
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_PORT);
-
- $criteria->addSelectColumn(DbSourcePeer::DBS_ENCODE);
-
- }
-
- const COUNT = 'COUNT(DB_SOURCE.DBS_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT DB_SOURCE.DBS_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(DbSourcePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(DbSourcePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = DbSourcePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return DbSource
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = DbSourcePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return DbSourcePeer::populateObjects(DbSourcePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- DbSourcePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = DbSourcePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return DbSourcePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a DbSource or Criteria object.
- *
- * @param mixed $values Criteria or DbSource object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from DbSource object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a DbSource or Criteria object.
- *
- * @param mixed $values Criteria or DbSource object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(DbSourcePeer::DBS_UID);
- $selectCriteria->add(DbSourcePeer::DBS_UID, $criteria->remove(DbSourcePeer::DBS_UID), $comparison);
-
- $comparison = $criteria->getComparison(DbSourcePeer::PRO_UID);
- $selectCriteria->add(DbSourcePeer::PRO_UID, $criteria->remove(DbSourcePeer::PRO_UID), $comparison);
-
- } else { // $values is DbSource object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the DB_SOURCE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(DbSourcePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a DbSource or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or DbSource object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof DbSource) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
-
- $criteria->add(DbSourcePeer::DBS_UID, $vals[0], Criteria::IN);
- $criteria->add(DbSourcePeer::PRO_UID, $vals[1], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given DbSource object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param DbSource $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(DbSource $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(DbSourcePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(DbSourcePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(DbSourcePeer::DATABASE_NAME, DbSourcePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $dbs_uid
- @param string $pro_uid
-
- * @param Connection $con
- * @return DbSource
- */
- public static function retrieveByPK( $dbs_uid, $pro_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(DbSourcePeer::DBS_UID, $dbs_uid);
- $criteria->add(DbSourcePeer::PRO_UID, $pro_uid);
- $v = DbSourcePeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseDbSourcePeer
+abstract class BaseDbSourcePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'DB_SOURCE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.DbSource';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 9;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the DBS_UID field */
+ const DBS_UID = 'DB_SOURCE.DBS_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'DB_SOURCE.PRO_UID';
+
+ /** the column name for the DBS_TYPE field */
+ const DBS_TYPE = 'DB_SOURCE.DBS_TYPE';
+
+ /** the column name for the DBS_SERVER field */
+ const DBS_SERVER = 'DB_SOURCE.DBS_SERVER';
+
+ /** the column name for the DBS_DATABASE_NAME field */
+ const DBS_DATABASE_NAME = 'DB_SOURCE.DBS_DATABASE_NAME';
+
+ /** the column name for the DBS_USERNAME field */
+ const DBS_USERNAME = 'DB_SOURCE.DBS_USERNAME';
+
+ /** the column name for the DBS_PASSWORD field */
+ const DBS_PASSWORD = 'DB_SOURCE.DBS_PASSWORD';
+
+ /** the column name for the DBS_PORT field */
+ const DBS_PORT = 'DB_SOURCE.DBS_PORT';
+
+ /** the column name for the DBS_ENCODE field */
+ const DBS_ENCODE = 'DB_SOURCE.DBS_ENCODE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('DbsUid', 'ProUid', 'DbsType', 'DbsServer', 'DbsDatabaseName', 'DbsUsername', 'DbsPassword', 'DbsPort', 'DbsEncode', ),
+ BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID, DbSourcePeer::PRO_UID, DbSourcePeer::DBS_TYPE, DbSourcePeer::DBS_SERVER, DbSourcePeer::DBS_DATABASE_NAME, DbSourcePeer::DBS_USERNAME, DbSourcePeer::DBS_PASSWORD, DbSourcePeer::DBS_PORT, DbSourcePeer::DBS_ENCODE, ),
+ BasePeer::TYPE_FIELDNAME => array ('DBS_UID', 'PRO_UID', 'DBS_TYPE', 'DBS_SERVER', 'DBS_DATABASE_NAME', 'DBS_USERNAME', 'DBS_PASSWORD', 'DBS_PORT', 'DBS_ENCODE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('DbsUid' => 0, 'ProUid' => 1, 'DbsType' => 2, 'DbsServer' => 3, 'DbsDatabaseName' => 4, 'DbsUsername' => 5, 'DbsPassword' => 6, 'DbsPort' => 7, 'DbsEncode' => 8, ),
+ BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID => 0, DbSourcePeer::PRO_UID => 1, DbSourcePeer::DBS_TYPE => 2, DbSourcePeer::DBS_SERVER => 3, DbSourcePeer::DBS_DATABASE_NAME => 4, DbSourcePeer::DBS_USERNAME => 5, DbSourcePeer::DBS_PASSWORD => 6, DbSourcePeer::DBS_PORT => 7, DbSourcePeer::DBS_ENCODE => 8, ),
+ BasePeer::TYPE_FIELDNAME => array ('DBS_UID' => 0, 'PRO_UID' => 1, 'DBS_TYPE' => 2, 'DBS_SERVER' => 3, 'DBS_DATABASE_NAME' => 4, 'DBS_USERNAME' => 5, 'DBS_PASSWORD' => 6, 'DBS_PORT' => 7, 'DBS_ENCODE' => 8, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/DbSourceMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.DbSourceMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = DbSourcePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. DbSourcePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(DbSourcePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_UID);
+
+ $criteria->addSelectColumn(DbSourcePeer::PRO_UID);
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_SERVER);
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_DATABASE_NAME);
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_USERNAME);
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_PORT);
+
+ $criteria->addSelectColumn(DbSourcePeer::DBS_ENCODE);
+
+ }
+
+ const COUNT = 'COUNT(DB_SOURCE.DBS_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT DB_SOURCE.DBS_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(DbSourcePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(DbSourcePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = DbSourcePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return DbSource
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = DbSourcePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return DbSourcePeer::populateObjects(DbSourcePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ DbSourcePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = DbSourcePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return DbSourcePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a DbSource or Criteria object.
+ *
+ * @param mixed $values Criteria or DbSource object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from DbSource object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a DbSource or Criteria object.
+ *
+ * @param mixed $values Criteria or DbSource object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(DbSourcePeer::DBS_UID);
+ $selectCriteria->add(DbSourcePeer::DBS_UID, $criteria->remove(DbSourcePeer::DBS_UID), $comparison);
+
+ $comparison = $criteria->getComparison(DbSourcePeer::PRO_UID);
+ $selectCriteria->add(DbSourcePeer::PRO_UID, $criteria->remove(DbSourcePeer::PRO_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the DB_SOURCE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(DbSourcePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a DbSource or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or DbSource object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof DbSource) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
+
+ $criteria->add(DbSourcePeer::DBS_UID, $vals[0], Criteria::IN);
+ $criteria->add(DbSourcePeer::PRO_UID, $vals[1], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given DbSource object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param DbSource $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(DbSource $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(DbSourcePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(DbSourcePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(DbSourcePeer::DATABASE_NAME, DbSourcePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $dbs_uid
+ * @param string $pro_uid
+ * @param Connection $con
+ * @return DbSource
+ */
+ public static function retrieveByPK($dbs_uid, $pro_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(DbSourcePeer::DBS_UID, $dbs_uid);
+ $criteria->add(DbSourcePeer::PRO_UID, $pro_uid);
+ $v = DbSourcePeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseDbSourcePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseDbSourcePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/DbSourceMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.DbSourceMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/DbSourceMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.DbSourceMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseDepartment.php b/workflow/engine/classes/model/om/BaseDepartment.php
index eeb31b29b..35e7b4b57 100755
--- a/workflow/engine/classes/model/om/BaseDepartment.php
+++ b/workflow/engine/classes/model/om/BaseDepartment.php
@@ -16,807 +16,843 @@ include_once 'classes/model/DepartmentPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDepartment extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var DepartmentPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the dep_uid field.
- * @var string
- */
- protected $dep_uid = '';
-
-
- /**
- * The value for the dep_parent field.
- * @var string
- */
- protected $dep_parent = '';
-
-
- /**
- * The value for the dep_manager field.
- * @var string
- */
- protected $dep_manager = '';
-
-
- /**
- * The value for the dep_location field.
- * @var int
- */
- protected $dep_location = 0;
-
-
- /**
- * The value for the dep_status field.
- * @var string
- */
- protected $dep_status = 'ACTIVE';
-
-
- /**
- * The value for the dep_ref_code field.
- * @var string
- */
- protected $dep_ref_code = '';
-
-
- /**
- * The value for the dep_ldap_dn field.
- * @var string
- */
- protected $dep_ldap_dn = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [dep_uid] column value.
- *
- * @return string
- */
- public function getDepUid()
- {
-
- return $this->dep_uid;
- }
-
- /**
- * Get the [dep_parent] column value.
- *
- * @return string
- */
- public function getDepParent()
- {
-
- return $this->dep_parent;
- }
-
- /**
- * Get the [dep_manager] column value.
- *
- * @return string
- */
- public function getDepManager()
- {
-
- return $this->dep_manager;
- }
-
- /**
- * Get the [dep_location] column value.
- *
- * @return int
- */
- public function getDepLocation()
- {
-
- return $this->dep_location;
- }
-
- /**
- * Get the [dep_status] column value.
- *
- * @return string
- */
- public function getDepStatus()
- {
-
- return $this->dep_status;
- }
-
- /**
- * Get the [dep_ref_code] column value.
- *
- * @return string
- */
- public function getDepRefCode()
- {
-
- return $this->dep_ref_code;
- }
-
- /**
- * Get the [dep_ldap_dn] column value.
- *
- * @return string
- */
- public function getDepLdapDn()
- {
-
- return $this->dep_ldap_dn;
- }
-
- /**
- * Set the value of [dep_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDepUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dep_uid !== $v || $v === '') {
- $this->dep_uid = $v;
- $this->modifiedColumns[] = DepartmentPeer::DEP_UID;
- }
-
- } // setDepUid()
-
- /**
- * Set the value of [dep_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDepParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dep_parent !== $v || $v === '') {
- $this->dep_parent = $v;
- $this->modifiedColumns[] = DepartmentPeer::DEP_PARENT;
- }
-
- } // setDepParent()
-
- /**
- * Set the value of [dep_manager] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDepManager($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dep_manager !== $v || $v === '') {
- $this->dep_manager = $v;
- $this->modifiedColumns[] = DepartmentPeer::DEP_MANAGER;
- }
-
- } // setDepManager()
-
- /**
- * Set the value of [dep_location] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDepLocation($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->dep_location !== $v || $v === 0) {
- $this->dep_location = $v;
- $this->modifiedColumns[] = DepartmentPeer::DEP_LOCATION;
- }
-
- } // setDepLocation()
-
- /**
- * Set the value of [dep_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDepStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dep_status !== $v || $v === 'ACTIVE') {
- $this->dep_status = $v;
- $this->modifiedColumns[] = DepartmentPeer::DEP_STATUS;
- }
-
- } // setDepStatus()
-
- /**
- * Set the value of [dep_ref_code] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDepRefCode($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dep_ref_code !== $v || $v === '') {
- $this->dep_ref_code = $v;
- $this->modifiedColumns[] = DepartmentPeer::DEP_REF_CODE;
- }
-
- } // setDepRefCode()
-
- /**
- * Set the value of [dep_ldap_dn] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDepLdapDn($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dep_ldap_dn !== $v || $v === '') {
- $this->dep_ldap_dn = $v;
- $this->modifiedColumns[] = DepartmentPeer::DEP_LDAP_DN;
- }
-
- } // setDepLdapDn()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->dep_uid = $rs->getString($startcol + 0);
-
- $this->dep_parent = $rs->getString($startcol + 1);
-
- $this->dep_manager = $rs->getString($startcol + 2);
-
- $this->dep_location = $rs->getInt($startcol + 3);
-
- $this->dep_status = $rs->getString($startcol + 4);
-
- $this->dep_ref_code = $rs->getString($startcol + 5);
-
- $this->dep_ldap_dn = $rs->getString($startcol + 6);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 7; // 7 = DepartmentPeer::NUM_COLUMNS - DepartmentPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Department object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- DepartmentPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = DepartmentPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += DepartmentPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = DepartmentPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DepartmentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getDepUid();
- break;
- case 1:
- return $this->getDepParent();
- break;
- case 2:
- return $this->getDepManager();
- break;
- case 3:
- return $this->getDepLocation();
- break;
- case 4:
- return $this->getDepStatus();
- break;
- case 5:
- return $this->getDepRefCode();
- break;
- case 6:
- return $this->getDepLdapDn();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DepartmentPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getDepUid(),
- $keys[1] => $this->getDepParent(),
- $keys[2] => $this->getDepManager(),
- $keys[3] => $this->getDepLocation(),
- $keys[4] => $this->getDepStatus(),
- $keys[5] => $this->getDepRefCode(),
- $keys[6] => $this->getDepLdapDn(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DepartmentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setDepUid($value);
- break;
- case 1:
- $this->setDepParent($value);
- break;
- case 2:
- $this->setDepManager($value);
- break;
- case 3:
- $this->setDepLocation($value);
- break;
- case 4:
- $this->setDepStatus($value);
- break;
- case 5:
- $this->setDepRefCode($value);
- break;
- case 6:
- $this->setDepLdapDn($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DepartmentPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setDepUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDepParent($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setDepManager($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDepLocation($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setDepStatus($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setDepRefCode($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setDepLdapDn($arr[$keys[6]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(DepartmentPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(DepartmentPeer::DEP_UID)) $criteria->add(DepartmentPeer::DEP_UID, $this->dep_uid);
- if ($this->isColumnModified(DepartmentPeer::DEP_PARENT)) $criteria->add(DepartmentPeer::DEP_PARENT, $this->dep_parent);
- if ($this->isColumnModified(DepartmentPeer::DEP_MANAGER)) $criteria->add(DepartmentPeer::DEP_MANAGER, $this->dep_manager);
- if ($this->isColumnModified(DepartmentPeer::DEP_LOCATION)) $criteria->add(DepartmentPeer::DEP_LOCATION, $this->dep_location);
- if ($this->isColumnModified(DepartmentPeer::DEP_STATUS)) $criteria->add(DepartmentPeer::DEP_STATUS, $this->dep_status);
- if ($this->isColumnModified(DepartmentPeer::DEP_REF_CODE)) $criteria->add(DepartmentPeer::DEP_REF_CODE, $this->dep_ref_code);
- if ($this->isColumnModified(DepartmentPeer::DEP_LDAP_DN)) $criteria->add(DepartmentPeer::DEP_LDAP_DN, $this->dep_ldap_dn);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(DepartmentPeer::DATABASE_NAME);
-
- $criteria->add(DepartmentPeer::DEP_UID, $this->dep_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getDepUid();
- }
-
- /**
- * Generic method to set the primary key (dep_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setDepUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Department (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setDepParent($this->dep_parent);
-
- $copyObj->setDepManager($this->dep_manager);
-
- $copyObj->setDepLocation($this->dep_location);
-
- $copyObj->setDepStatus($this->dep_status);
-
- $copyObj->setDepRefCode($this->dep_ref_code);
-
- $copyObj->setDepLdapDn($this->dep_ldap_dn);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setDepUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Department Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return DepartmentPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new DepartmentPeer();
- }
- return self::$peer;
- }
-
-} // BaseDepartment
+abstract class BaseDepartment extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var DepartmentPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the dep_uid field.
+ * @var string
+ */
+ protected $dep_uid = '';
+
+ /**
+ * The value for the dep_parent field.
+ * @var string
+ */
+ protected $dep_parent = '';
+
+ /**
+ * The value for the dep_manager field.
+ * @var string
+ */
+ protected $dep_manager = '';
+
+ /**
+ * The value for the dep_location field.
+ * @var int
+ */
+ protected $dep_location = 0;
+
+ /**
+ * The value for the dep_status field.
+ * @var string
+ */
+ protected $dep_status = 'ACTIVE';
+
+ /**
+ * The value for the dep_ref_code field.
+ * @var string
+ */
+ protected $dep_ref_code = '';
+
+ /**
+ * The value for the dep_ldap_dn field.
+ * @var string
+ */
+ protected $dep_ldap_dn = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [dep_uid] column value.
+ *
+ * @return string
+ */
+ public function getDepUid()
+ {
+
+ return $this->dep_uid;
+ }
+
+ /**
+ * Get the [dep_parent] column value.
+ *
+ * @return string
+ */
+ public function getDepParent()
+ {
+
+ return $this->dep_parent;
+ }
+
+ /**
+ * Get the [dep_manager] column value.
+ *
+ * @return string
+ */
+ public function getDepManager()
+ {
+
+ return $this->dep_manager;
+ }
+
+ /**
+ * Get the [dep_location] column value.
+ *
+ * @return int
+ */
+ public function getDepLocation()
+ {
+
+ return $this->dep_location;
+ }
+
+ /**
+ * Get the [dep_status] column value.
+ *
+ * @return string
+ */
+ public function getDepStatus()
+ {
+
+ return $this->dep_status;
+ }
+
+ /**
+ * Get the [dep_ref_code] column value.
+ *
+ * @return string
+ */
+ public function getDepRefCode()
+ {
+
+ return $this->dep_ref_code;
+ }
+
+ /**
+ * Get the [dep_ldap_dn] column value.
+ *
+ * @return string
+ */
+ public function getDepLdapDn()
+ {
+
+ return $this->dep_ldap_dn;
+ }
+
+ /**
+ * Set the value of [dep_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDepUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dep_uid !== $v || $v === '') {
+ $this->dep_uid = $v;
+ $this->modifiedColumns[] = DepartmentPeer::DEP_UID;
+ }
+
+ } // setDepUid()
+
+ /**
+ * Set the value of [dep_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDepParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dep_parent !== $v || $v === '') {
+ $this->dep_parent = $v;
+ $this->modifiedColumns[] = DepartmentPeer::DEP_PARENT;
+ }
+
+ } // setDepParent()
+
+ /**
+ * Set the value of [dep_manager] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDepManager($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dep_manager !== $v || $v === '') {
+ $this->dep_manager = $v;
+ $this->modifiedColumns[] = DepartmentPeer::DEP_MANAGER;
+ }
+
+ } // setDepManager()
+
+ /**
+ * Set the value of [dep_location] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDepLocation($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->dep_location !== $v || $v === 0) {
+ $this->dep_location = $v;
+ $this->modifiedColumns[] = DepartmentPeer::DEP_LOCATION;
+ }
+
+ } // setDepLocation()
+
+ /**
+ * Set the value of [dep_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDepStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dep_status !== $v || $v === 'ACTIVE') {
+ $this->dep_status = $v;
+ $this->modifiedColumns[] = DepartmentPeer::DEP_STATUS;
+ }
+
+ } // setDepStatus()
+
+ /**
+ * Set the value of [dep_ref_code] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDepRefCode($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dep_ref_code !== $v || $v === '') {
+ $this->dep_ref_code = $v;
+ $this->modifiedColumns[] = DepartmentPeer::DEP_REF_CODE;
+ }
+
+ } // setDepRefCode()
+
+ /**
+ * Set the value of [dep_ldap_dn] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDepLdapDn($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dep_ldap_dn !== $v || $v === '') {
+ $this->dep_ldap_dn = $v;
+ $this->modifiedColumns[] = DepartmentPeer::DEP_LDAP_DN;
+ }
+
+ } // setDepLdapDn()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->dep_uid = $rs->getString($startcol + 0);
+
+ $this->dep_parent = $rs->getString($startcol + 1);
+
+ $this->dep_manager = $rs->getString($startcol + 2);
+
+ $this->dep_location = $rs->getInt($startcol + 3);
+
+ $this->dep_status = $rs->getString($startcol + 4);
+
+ $this->dep_ref_code = $rs->getString($startcol + 5);
+
+ $this->dep_ldap_dn = $rs->getString($startcol + 6);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 7; // 7 = DepartmentPeer::NUM_COLUMNS - DepartmentPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Department object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ DepartmentPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = DepartmentPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += DepartmentPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = DepartmentPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DepartmentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getDepUid();
+ break;
+ case 1:
+ return $this->getDepParent();
+ break;
+ case 2:
+ return $this->getDepManager();
+ break;
+ case 3:
+ return $this->getDepLocation();
+ break;
+ case 4:
+ return $this->getDepStatus();
+ break;
+ case 5:
+ return $this->getDepRefCode();
+ break;
+ case 6:
+ return $this->getDepLdapDn();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DepartmentPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getDepUid(),
+ $keys[1] => $this->getDepParent(),
+ $keys[2] => $this->getDepManager(),
+ $keys[3] => $this->getDepLocation(),
+ $keys[4] => $this->getDepStatus(),
+ $keys[5] => $this->getDepRefCode(),
+ $keys[6] => $this->getDepLdapDn(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DepartmentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setDepUid($value);
+ break;
+ case 1:
+ $this->setDepParent($value);
+ break;
+ case 2:
+ $this->setDepManager($value);
+ break;
+ case 3:
+ $this->setDepLocation($value);
+ break;
+ case 4:
+ $this->setDepStatus($value);
+ break;
+ case 5:
+ $this->setDepRefCode($value);
+ break;
+ case 6:
+ $this->setDepLdapDn($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DepartmentPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setDepUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setDepParent($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setDepManager($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDepLocation($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setDepStatus($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setDepRefCode($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setDepLdapDn($arr[$keys[6]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(DepartmentPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(DepartmentPeer::DEP_UID)) {
+ $criteria->add(DepartmentPeer::DEP_UID, $this->dep_uid);
+ }
+
+ if ($this->isColumnModified(DepartmentPeer::DEP_PARENT)) {
+ $criteria->add(DepartmentPeer::DEP_PARENT, $this->dep_parent);
+ }
+
+ if ($this->isColumnModified(DepartmentPeer::DEP_MANAGER)) {
+ $criteria->add(DepartmentPeer::DEP_MANAGER, $this->dep_manager);
+ }
+
+ if ($this->isColumnModified(DepartmentPeer::DEP_LOCATION)) {
+ $criteria->add(DepartmentPeer::DEP_LOCATION, $this->dep_location);
+ }
+
+ if ($this->isColumnModified(DepartmentPeer::DEP_STATUS)) {
+ $criteria->add(DepartmentPeer::DEP_STATUS, $this->dep_status);
+ }
+
+ if ($this->isColumnModified(DepartmentPeer::DEP_REF_CODE)) {
+ $criteria->add(DepartmentPeer::DEP_REF_CODE, $this->dep_ref_code);
+ }
+
+ if ($this->isColumnModified(DepartmentPeer::DEP_LDAP_DN)) {
+ $criteria->add(DepartmentPeer::DEP_LDAP_DN, $this->dep_ldap_dn);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(DepartmentPeer::DATABASE_NAME);
+
+ $criteria->add(DepartmentPeer::DEP_UID, $this->dep_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getDepUid();
+ }
+
+ /**
+ * Generic method to set the primary key (dep_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setDepUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Department (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setDepParent($this->dep_parent);
+
+ $copyObj->setDepManager($this->dep_manager);
+
+ $copyObj->setDepLocation($this->dep_location);
+
+ $copyObj->setDepStatus($this->dep_status);
+
+ $copyObj->setDepRefCode($this->dep_ref_code);
+
+ $copyObj->setDepLdapDn($this->dep_ldap_dn);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setDepUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Department Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return DepartmentPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new DepartmentPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseDepartmentPeer.php b/workflow/engine/classes/model/om/BaseDepartmentPeer.php
index 5f123200f..3f37d54d1 100755
--- a/workflow/engine/classes/model/om/BaseDepartmentPeer.php
+++ b/workflow/engine/classes/model/om/BaseDepartmentPeer.php
@@ -12,584 +12,586 @@ include_once 'classes/model/Department.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDepartmentPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'DEPARTMENT';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Department';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 7;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the DEP_UID field */
- const DEP_UID = 'DEPARTMENT.DEP_UID';
-
- /** the column name for the DEP_PARENT field */
- const DEP_PARENT = 'DEPARTMENT.DEP_PARENT';
-
- /** the column name for the DEP_MANAGER field */
- const DEP_MANAGER = 'DEPARTMENT.DEP_MANAGER';
-
- /** the column name for the DEP_LOCATION field */
- const DEP_LOCATION = 'DEPARTMENT.DEP_LOCATION';
-
- /** the column name for the DEP_STATUS field */
- const DEP_STATUS = 'DEPARTMENT.DEP_STATUS';
-
- /** the column name for the DEP_REF_CODE field */
- const DEP_REF_CODE = 'DEPARTMENT.DEP_REF_CODE';
-
- /** the column name for the DEP_LDAP_DN field */
- const DEP_LDAP_DN = 'DEPARTMENT.DEP_LDAP_DN';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('DepUid', 'DepParent', 'DepManager', 'DepLocation', 'DepStatus', 'DepRefCode', 'DepLdapDn', ),
- BasePeer::TYPE_COLNAME => array (DepartmentPeer::DEP_UID, DepartmentPeer::DEP_PARENT, DepartmentPeer::DEP_MANAGER, DepartmentPeer::DEP_LOCATION, DepartmentPeer::DEP_STATUS, DepartmentPeer::DEP_REF_CODE, DepartmentPeer::DEP_LDAP_DN, ),
- BasePeer::TYPE_FIELDNAME => array ('DEP_UID', 'DEP_PARENT', 'DEP_MANAGER', 'DEP_LOCATION', 'DEP_STATUS', 'DEP_REF_CODE', 'DEP_LDAP_DN', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('DepUid' => 0, 'DepParent' => 1, 'DepManager' => 2, 'DepLocation' => 3, 'DepStatus' => 4, 'DepRefCode' => 5, 'DepLdapDn' => 6, ),
- BasePeer::TYPE_COLNAME => array (DepartmentPeer::DEP_UID => 0, DepartmentPeer::DEP_PARENT => 1, DepartmentPeer::DEP_MANAGER => 2, DepartmentPeer::DEP_LOCATION => 3, DepartmentPeer::DEP_STATUS => 4, DepartmentPeer::DEP_REF_CODE => 5, DepartmentPeer::DEP_LDAP_DN => 6, ),
- BasePeer::TYPE_FIELDNAME => array ('DEP_UID' => 0, 'DEP_PARENT' => 1, 'DEP_MANAGER' => 2, 'DEP_LOCATION' => 3, 'DEP_STATUS' => 4, 'DEP_REF_CODE' => 5, 'DEP_LDAP_DN' => 6, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/DepartmentMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.DepartmentMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = DepartmentPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. DepartmentPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(DepartmentPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(DepartmentPeer::DEP_UID);
-
- $criteria->addSelectColumn(DepartmentPeer::DEP_PARENT);
-
- $criteria->addSelectColumn(DepartmentPeer::DEP_MANAGER);
-
- $criteria->addSelectColumn(DepartmentPeer::DEP_LOCATION);
-
- $criteria->addSelectColumn(DepartmentPeer::DEP_STATUS);
-
- $criteria->addSelectColumn(DepartmentPeer::DEP_REF_CODE);
-
- $criteria->addSelectColumn(DepartmentPeer::DEP_LDAP_DN);
-
- }
-
- const COUNT = 'COUNT(DEPARTMENT.DEP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT DEPARTMENT.DEP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(DepartmentPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(DepartmentPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = DepartmentPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Department
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = DepartmentPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return DepartmentPeer::populateObjects(DepartmentPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- DepartmentPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = DepartmentPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return DepartmentPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Department or Criteria object.
- *
- * @param mixed $values Criteria or Department object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Department object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Department or Criteria object.
- *
- * @param mixed $values Criteria or Department object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(DepartmentPeer::DEP_UID);
- $selectCriteria->add(DepartmentPeer::DEP_UID, $criteria->remove(DepartmentPeer::DEP_UID), $comparison);
-
- } else { // $values is Department object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the DEPARTMENT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(DepartmentPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Department or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Department object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Department) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(DepartmentPeer::DEP_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Department object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Department $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Department $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(DepartmentPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(DepartmentPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(DepartmentPeer::DATABASE_NAME, DepartmentPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Department
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(DepartmentPeer::DATABASE_NAME);
-
- $criteria->add(DepartmentPeer::DEP_UID, $pk);
-
-
- $v = DepartmentPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(DepartmentPeer::DEP_UID, $pks, Criteria::IN);
- $objs = DepartmentPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseDepartmentPeer
+abstract class BaseDepartmentPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'DEPARTMENT';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Department';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 7;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the DEP_UID field */
+ const DEP_UID = 'DEPARTMENT.DEP_UID';
+
+ /** the column name for the DEP_PARENT field */
+ const DEP_PARENT = 'DEPARTMENT.DEP_PARENT';
+
+ /** the column name for the DEP_MANAGER field */
+ const DEP_MANAGER = 'DEPARTMENT.DEP_MANAGER';
+
+ /** the column name for the DEP_LOCATION field */
+ const DEP_LOCATION = 'DEPARTMENT.DEP_LOCATION';
+
+ /** the column name for the DEP_STATUS field */
+ const DEP_STATUS = 'DEPARTMENT.DEP_STATUS';
+
+ /** the column name for the DEP_REF_CODE field */
+ const DEP_REF_CODE = 'DEPARTMENT.DEP_REF_CODE';
+
+ /** the column name for the DEP_LDAP_DN field */
+ const DEP_LDAP_DN = 'DEPARTMENT.DEP_LDAP_DN';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('DepUid', 'DepParent', 'DepManager', 'DepLocation', 'DepStatus', 'DepRefCode', 'DepLdapDn', ),
+ BasePeer::TYPE_COLNAME => array (DepartmentPeer::DEP_UID, DepartmentPeer::DEP_PARENT, DepartmentPeer::DEP_MANAGER, DepartmentPeer::DEP_LOCATION, DepartmentPeer::DEP_STATUS, DepartmentPeer::DEP_REF_CODE, DepartmentPeer::DEP_LDAP_DN, ),
+ BasePeer::TYPE_FIELDNAME => array ('DEP_UID', 'DEP_PARENT', 'DEP_MANAGER', 'DEP_LOCATION', 'DEP_STATUS', 'DEP_REF_CODE', 'DEP_LDAP_DN', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('DepUid' => 0, 'DepParent' => 1, 'DepManager' => 2, 'DepLocation' => 3, 'DepStatus' => 4, 'DepRefCode' => 5, 'DepLdapDn' => 6, ),
+ BasePeer::TYPE_COLNAME => array (DepartmentPeer::DEP_UID => 0, DepartmentPeer::DEP_PARENT => 1, DepartmentPeer::DEP_MANAGER => 2, DepartmentPeer::DEP_LOCATION => 3, DepartmentPeer::DEP_STATUS => 4, DepartmentPeer::DEP_REF_CODE => 5, DepartmentPeer::DEP_LDAP_DN => 6, ),
+ BasePeer::TYPE_FIELDNAME => array ('DEP_UID' => 0, 'DEP_PARENT' => 1, 'DEP_MANAGER' => 2, 'DEP_LOCATION' => 3, 'DEP_STATUS' => 4, 'DEP_REF_CODE' => 5, 'DEP_LDAP_DN' => 6, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/DepartmentMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.DepartmentMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = DepartmentPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. DepartmentPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(DepartmentPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(DepartmentPeer::DEP_UID);
+
+ $criteria->addSelectColumn(DepartmentPeer::DEP_PARENT);
+
+ $criteria->addSelectColumn(DepartmentPeer::DEP_MANAGER);
+
+ $criteria->addSelectColumn(DepartmentPeer::DEP_LOCATION);
+
+ $criteria->addSelectColumn(DepartmentPeer::DEP_STATUS);
+
+ $criteria->addSelectColumn(DepartmentPeer::DEP_REF_CODE);
+
+ $criteria->addSelectColumn(DepartmentPeer::DEP_LDAP_DN);
+
+ }
+
+ const COUNT = 'COUNT(DEPARTMENT.DEP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT DEPARTMENT.DEP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(DepartmentPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(DepartmentPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = DepartmentPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Department
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = DepartmentPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return DepartmentPeer::populateObjects(DepartmentPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ DepartmentPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = DepartmentPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return DepartmentPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Department or Criteria object.
+ *
+ * @param mixed $values Criteria or Department object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Department object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Department or Criteria object.
+ *
+ * @param mixed $values Criteria or Department object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(DepartmentPeer::DEP_UID);
+ $selectCriteria->add(DepartmentPeer::DEP_UID, $criteria->remove(DepartmentPeer::DEP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the DEPARTMENT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(DepartmentPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Department or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Department object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Department) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(DepartmentPeer::DEP_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Department object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Department $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Department $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(DepartmentPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(DepartmentPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(DepartmentPeer::DATABASE_NAME, DepartmentPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Department
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(DepartmentPeer::DATABASE_NAME);
+
+ $criteria->add(DepartmentPeer::DEP_UID, $pk);
+
+
+ $v = DepartmentPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(DepartmentPeer::DEP_UID, $pks, Criteria::IN);
+ $objs = DepartmentPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseDepartmentPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseDepartmentPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/DepartmentMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.DepartmentMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/DepartmentMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.DepartmentMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseDimTimeComplete.php b/workflow/engine/classes/model/om/BaseDimTimeComplete.php
index 3d6b0c721..fce1d07c1 100755
--- a/workflow/engine/classes/model/om/BaseDimTimeComplete.php
+++ b/workflow/engine/classes/model/om/BaseDimTimeComplete.php
@@ -16,860 +16,901 @@ include_once 'classes/model/DimTimeCompletePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDimTimeComplete extends BaseObject implements Persistent {
-
+abstract class BaseDimTimeComplete extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var DimTimeCompletePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the time_id field.
+ * @var string
+ */
+ protected $time_id = '';
+
+ /**
+ * The value for the month_id field.
+ * @var int
+ */
+ protected $month_id = 0;
+
+ /**
+ * The value for the qtr_id field.
+ * @var int
+ */
+ protected $qtr_id = 0;
+
+ /**
+ * The value for the year_id field.
+ * @var int
+ */
+ protected $year_id = 0;
+
+ /**
+ * The value for the month_name field.
+ * @var string
+ */
+ protected $month_name = '0';
+
+ /**
+ * The value for the month_desc field.
+ * @var string
+ */
+ protected $month_desc = '';
+
+ /**
+ * The value for the qtr_name field.
+ * @var string
+ */
+ protected $qtr_name = '';
+
+ /**
+ * The value for the qtr_desc field.
+ * @var string
+ */
+ protected $qtr_desc = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [time_id] column value.
+ *
+ * @return string
+ */
+ public function getTimeId()
+ {
+
+ return $this->time_id;
+ }
+
+ /**
+ * Get the [month_id] column value.
+ *
+ * @return int
+ */
+ public function getMonthId()
+ {
+
+ return $this->month_id;
+ }
+
+ /**
+ * Get the [qtr_id] column value.
+ *
+ * @return int
+ */
+ public function getQtrId()
+ {
+
+ return $this->qtr_id;
+ }
+
+ /**
+ * Get the [year_id] column value.
+ *
+ * @return int
+ */
+ public function getYearId()
+ {
+
+ return $this->year_id;
+ }
+
+ /**
+ * Get the [month_name] column value.
+ *
+ * @return string
+ */
+ public function getMonthName()
+ {
+
+ return $this->month_name;
+ }
+
+ /**
+ * Get the [month_desc] column value.
+ *
+ * @return string
+ */
+ public function getMonthDesc()
+ {
+
+ return $this->month_desc;
+ }
+
+ /**
+ * Get the [qtr_name] column value.
+ *
+ * @return string
+ */
+ public function getQtrName()
+ {
+
+ return $this->qtr_name;
+ }
+
+ /**
+ * Get the [qtr_desc] column value.
+ *
+ * @return string
+ */
+ public function getQtrDesc()
+ {
+
+ return $this->qtr_desc;
+ }
+
+ /**
+ * Set the value of [time_id] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTimeId($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->time_id !== $v || $v === '') {
+ $this->time_id = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::TIME_ID;
+ }
+
+ } // setTimeId()
+
+ /**
+ * Set the value of [month_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setMonthId($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->month_id !== $v || $v === 0) {
+ $this->month_id = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::MONTH_ID;
+ }
+
+ } // setMonthId()
+
+ /**
+ * Set the value of [qtr_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setQtrId($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->qtr_id !== $v || $v === 0) {
+ $this->qtr_id = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::QTR_ID;
+ }
+
+ } // setQtrId()
+
+ /**
+ * Set the value of [year_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setYearId($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->year_id !== $v || $v === 0) {
+ $this->year_id = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::YEAR_ID;
+ }
+
+ } // setYearId()
+
+ /**
+ * Set the value of [month_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setMonthName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->month_name !== $v || $v === '0') {
+ $this->month_name = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::MONTH_NAME;
+ }
+
+ } // setMonthName()
+
+ /**
+ * Set the value of [month_desc] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setMonthDesc($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->month_desc !== $v || $v === '') {
+ $this->month_desc = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::MONTH_DESC;
+ }
+
+ } // setMonthDesc()
+
+ /**
+ * Set the value of [qtr_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setQtrName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->qtr_name !== $v || $v === '') {
+ $this->qtr_name = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::QTR_NAME;
+ }
+
+ } // setQtrName()
+
+ /**
+ * Set the value of [qtr_desc] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setQtrDesc($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->qtr_desc !== $v || $v === '') {
+ $this->qtr_desc = $v;
+ $this->modifiedColumns[] = DimTimeCompletePeer::QTR_DESC;
+ }
+
+ } // setQtrDesc()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->time_id = $rs->getString($startcol + 0);
+
+ $this->month_id = $rs->getInt($startcol + 1);
+
+ $this->qtr_id = $rs->getInt($startcol + 2);
+
+ $this->year_id = $rs->getInt($startcol + 3);
+
+ $this->month_name = $rs->getString($startcol + 4);
+
+ $this->month_desc = $rs->getString($startcol + 5);
+
+ $this->qtr_name = $rs->getString($startcol + 6);
+
+ $this->qtr_desc = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = DimTimeCompletePeer::NUM_COLUMNS - DimTimeCompletePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating DimTimeComplete object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DimTimeCompletePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ DimTimeCompletePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DimTimeCompletePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = DimTimeCompletePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += DimTimeCompletePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = DimTimeCompletePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DimTimeCompletePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getTimeId();
+ break;
+ case 1:
+ return $this->getMonthId();
+ break;
+ case 2:
+ return $this->getQtrId();
+ break;
+ case 3:
+ return $this->getYearId();
+ break;
+ case 4:
+ return $this->getMonthName();
+ break;
+ case 5:
+ return $this->getMonthDesc();
+ break;
+ case 6:
+ return $this->getQtrName();
+ break;
+ case 7:
+ return $this->getQtrDesc();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DimTimeCompletePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getTimeId(),
+ $keys[1] => $this->getMonthId(),
+ $keys[2] => $this->getQtrId(),
+ $keys[3] => $this->getYearId(),
+ $keys[4] => $this->getMonthName(),
+ $keys[5] => $this->getMonthDesc(),
+ $keys[6] => $this->getQtrName(),
+ $keys[7] => $this->getQtrDesc(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DimTimeCompletePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setTimeId($value);
+ break;
+ case 1:
+ $this->setMonthId($value);
+ break;
+ case 2:
+ $this->setQtrId($value);
+ break;
+ case 3:
+ $this->setYearId($value);
+ break;
+ case 4:
+ $this->setMonthName($value);
+ break;
+ case 5:
+ $this->setMonthDesc($value);
+ break;
+ case 6:
+ $this->setQtrName($value);
+ break;
+ case 7:
+ $this->setQtrDesc($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DimTimeCompletePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setTimeId($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setMonthId($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setQtrId($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setYearId($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setMonthName($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setMonthDesc($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setQtrName($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setQtrDesc($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(DimTimeCompletePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(DimTimeCompletePeer::TIME_ID)) {
+ $criteria->add(DimTimeCompletePeer::TIME_ID, $this->time_id);
+ }
+
+ if ($this->isColumnModified(DimTimeCompletePeer::MONTH_ID)) {
+ $criteria->add(DimTimeCompletePeer::MONTH_ID, $this->month_id);
+ }
+
+ if ($this->isColumnModified(DimTimeCompletePeer::QTR_ID)) {
+ $criteria->add(DimTimeCompletePeer::QTR_ID, $this->qtr_id);
+ }
+
+ if ($this->isColumnModified(DimTimeCompletePeer::YEAR_ID)) {
+ $criteria->add(DimTimeCompletePeer::YEAR_ID, $this->year_id);
+ }
+
+ if ($this->isColumnModified(DimTimeCompletePeer::MONTH_NAME)) {
+ $criteria->add(DimTimeCompletePeer::MONTH_NAME, $this->month_name);
+ }
+
+ if ($this->isColumnModified(DimTimeCompletePeer::MONTH_DESC)) {
+ $criteria->add(DimTimeCompletePeer::MONTH_DESC, $this->month_desc);
+ }
+
+ if ($this->isColumnModified(DimTimeCompletePeer::QTR_NAME)) {
+ $criteria->add(DimTimeCompletePeer::QTR_NAME, $this->qtr_name);
+ }
+
+ if ($this->isColumnModified(DimTimeCompletePeer::QTR_DESC)) {
+ $criteria->add(DimTimeCompletePeer::QTR_DESC, $this->qtr_desc);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(DimTimeCompletePeer::DATABASE_NAME);
+
+ $criteria->add(DimTimeCompletePeer::TIME_ID, $this->time_id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getTimeId();
+ }
+
+ /**
+ * Generic method to set the primary key (time_id column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setTimeId($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of DimTimeComplete (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setMonthId($this->month_id);
+
+ $copyObj->setQtrId($this->qtr_id);
+
+ $copyObj->setYearId($this->year_id);
+
+ $copyObj->setMonthName($this->month_name);
+
+ $copyObj->setMonthDesc($this->month_desc);
+
+ $copyObj->setQtrName($this->qtr_name);
+
+ $copyObj->setQtrDesc($this->qtr_desc);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setTimeId(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return DimTimeComplete Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return DimTimeCompletePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new DimTimeCompletePeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var DimTimeCompletePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the time_id field.
- * @var string
- */
- protected $time_id = '';
-
-
- /**
- * The value for the month_id field.
- * @var int
- */
- protected $month_id = 0;
-
-
- /**
- * The value for the qtr_id field.
- * @var int
- */
- protected $qtr_id = 0;
-
-
- /**
- * The value for the year_id field.
- * @var int
- */
- protected $year_id = 0;
-
-
- /**
- * The value for the month_name field.
- * @var string
- */
- protected $month_name = '0';
-
-
- /**
- * The value for the month_desc field.
- * @var string
- */
- protected $month_desc = '';
-
-
- /**
- * The value for the qtr_name field.
- * @var string
- */
- protected $qtr_name = '';
-
-
- /**
- * The value for the qtr_desc field.
- * @var string
- */
- protected $qtr_desc = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [time_id] column value.
- *
- * @return string
- */
- public function getTimeId()
- {
-
- return $this->time_id;
- }
-
- /**
- * Get the [month_id] column value.
- *
- * @return int
- */
- public function getMonthId()
- {
-
- return $this->month_id;
- }
-
- /**
- * Get the [qtr_id] column value.
- *
- * @return int
- */
- public function getQtrId()
- {
-
- return $this->qtr_id;
- }
-
- /**
- * Get the [year_id] column value.
- *
- * @return int
- */
- public function getYearId()
- {
-
- return $this->year_id;
- }
-
- /**
- * Get the [month_name] column value.
- *
- * @return string
- */
- public function getMonthName()
- {
-
- return $this->month_name;
- }
-
- /**
- * Get the [month_desc] column value.
- *
- * @return string
- */
- public function getMonthDesc()
- {
-
- return $this->month_desc;
- }
-
- /**
- * Get the [qtr_name] column value.
- *
- * @return string
- */
- public function getQtrName()
- {
-
- return $this->qtr_name;
- }
-
- /**
- * Get the [qtr_desc] column value.
- *
- * @return string
- */
- public function getQtrDesc()
- {
-
- return $this->qtr_desc;
- }
-
- /**
- * Set the value of [time_id] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTimeId($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->time_id !== $v || $v === '') {
- $this->time_id = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::TIME_ID;
- }
-
- } // setTimeId()
-
- /**
- * Set the value of [month_id] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setMonthId($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->month_id !== $v || $v === 0) {
- $this->month_id = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::MONTH_ID;
- }
-
- } // setMonthId()
-
- /**
- * Set the value of [qtr_id] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setQtrId($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->qtr_id !== $v || $v === 0) {
- $this->qtr_id = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::QTR_ID;
- }
-
- } // setQtrId()
-
- /**
- * Set the value of [year_id] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setYearId($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->year_id !== $v || $v === 0) {
- $this->year_id = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::YEAR_ID;
- }
-
- } // setYearId()
-
- /**
- * Set the value of [month_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setMonthName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->month_name !== $v || $v === '0') {
- $this->month_name = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::MONTH_NAME;
- }
-
- } // setMonthName()
-
- /**
- * Set the value of [month_desc] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setMonthDesc($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->month_desc !== $v || $v === '') {
- $this->month_desc = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::MONTH_DESC;
- }
-
- } // setMonthDesc()
-
- /**
- * Set the value of [qtr_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setQtrName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->qtr_name !== $v || $v === '') {
- $this->qtr_name = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::QTR_NAME;
- }
-
- } // setQtrName()
-
- /**
- * Set the value of [qtr_desc] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setQtrDesc($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->qtr_desc !== $v || $v === '') {
- $this->qtr_desc = $v;
- $this->modifiedColumns[] = DimTimeCompletePeer::QTR_DESC;
- }
-
- } // setQtrDesc()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->time_id = $rs->getString($startcol + 0);
-
- $this->month_id = $rs->getInt($startcol + 1);
-
- $this->qtr_id = $rs->getInt($startcol + 2);
-
- $this->year_id = $rs->getInt($startcol + 3);
-
- $this->month_name = $rs->getString($startcol + 4);
-
- $this->month_desc = $rs->getString($startcol + 5);
-
- $this->qtr_name = $rs->getString($startcol + 6);
-
- $this->qtr_desc = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = DimTimeCompletePeer::NUM_COLUMNS - DimTimeCompletePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating DimTimeComplete object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DimTimeCompletePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- DimTimeCompletePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DimTimeCompletePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = DimTimeCompletePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += DimTimeCompletePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = DimTimeCompletePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DimTimeCompletePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getTimeId();
- break;
- case 1:
- return $this->getMonthId();
- break;
- case 2:
- return $this->getQtrId();
- break;
- case 3:
- return $this->getYearId();
- break;
- case 4:
- return $this->getMonthName();
- break;
- case 5:
- return $this->getMonthDesc();
- break;
- case 6:
- return $this->getQtrName();
- break;
- case 7:
- return $this->getQtrDesc();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DimTimeCompletePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getTimeId(),
- $keys[1] => $this->getMonthId(),
- $keys[2] => $this->getQtrId(),
- $keys[3] => $this->getYearId(),
- $keys[4] => $this->getMonthName(),
- $keys[5] => $this->getMonthDesc(),
- $keys[6] => $this->getQtrName(),
- $keys[7] => $this->getQtrDesc(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DimTimeCompletePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setTimeId($value);
- break;
- case 1:
- $this->setMonthId($value);
- break;
- case 2:
- $this->setQtrId($value);
- break;
- case 3:
- $this->setYearId($value);
- break;
- case 4:
- $this->setMonthName($value);
- break;
- case 5:
- $this->setMonthDesc($value);
- break;
- case 6:
- $this->setQtrName($value);
- break;
- case 7:
- $this->setQtrDesc($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DimTimeCompletePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setTimeId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setMonthId($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setQtrId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setYearId($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setMonthName($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setMonthDesc($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setQtrName($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setQtrDesc($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(DimTimeCompletePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(DimTimeCompletePeer::TIME_ID)) $criteria->add(DimTimeCompletePeer::TIME_ID, $this->time_id);
- if ($this->isColumnModified(DimTimeCompletePeer::MONTH_ID)) $criteria->add(DimTimeCompletePeer::MONTH_ID, $this->month_id);
- if ($this->isColumnModified(DimTimeCompletePeer::QTR_ID)) $criteria->add(DimTimeCompletePeer::QTR_ID, $this->qtr_id);
- if ($this->isColumnModified(DimTimeCompletePeer::YEAR_ID)) $criteria->add(DimTimeCompletePeer::YEAR_ID, $this->year_id);
- if ($this->isColumnModified(DimTimeCompletePeer::MONTH_NAME)) $criteria->add(DimTimeCompletePeer::MONTH_NAME, $this->month_name);
- if ($this->isColumnModified(DimTimeCompletePeer::MONTH_DESC)) $criteria->add(DimTimeCompletePeer::MONTH_DESC, $this->month_desc);
- if ($this->isColumnModified(DimTimeCompletePeer::QTR_NAME)) $criteria->add(DimTimeCompletePeer::QTR_NAME, $this->qtr_name);
- if ($this->isColumnModified(DimTimeCompletePeer::QTR_DESC)) $criteria->add(DimTimeCompletePeer::QTR_DESC, $this->qtr_desc);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(DimTimeCompletePeer::DATABASE_NAME);
-
- $criteria->add(DimTimeCompletePeer::TIME_ID, $this->time_id);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getTimeId();
- }
-
- /**
- * Generic method to set the primary key (time_id column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setTimeId($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of DimTimeComplete (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setMonthId($this->month_id);
-
- $copyObj->setQtrId($this->qtr_id);
-
- $copyObj->setYearId($this->year_id);
-
- $copyObj->setMonthName($this->month_name);
-
- $copyObj->setMonthDesc($this->month_desc);
-
- $copyObj->setQtrName($this->qtr_name);
-
- $copyObj->setQtrDesc($this->qtr_desc);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setTimeId(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return DimTimeComplete Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return DimTimeCompletePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new DimTimeCompletePeer();
- }
- return self::$peer;
- }
-
-} // BaseDimTimeComplete
diff --git a/workflow/engine/classes/model/om/BaseDimTimeCompletePeer.php b/workflow/engine/classes/model/om/BaseDimTimeCompletePeer.php
index 854d823a5..f01fac26a 100755
--- a/workflow/engine/classes/model/om/BaseDimTimeCompletePeer.php
+++ b/workflow/engine/classes/model/om/BaseDimTimeCompletePeer.php
@@ -12,589 +12,591 @@ include_once 'classes/model/DimTimeComplete.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDimTimeCompletePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'DIM_TIME_COMPLETE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.DimTimeComplete';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the TIME_ID field */
- const TIME_ID = 'DIM_TIME_COMPLETE.TIME_ID';
-
- /** the column name for the MONTH_ID field */
- const MONTH_ID = 'DIM_TIME_COMPLETE.MONTH_ID';
-
- /** the column name for the QTR_ID field */
- const QTR_ID = 'DIM_TIME_COMPLETE.QTR_ID';
-
- /** the column name for the YEAR_ID field */
- const YEAR_ID = 'DIM_TIME_COMPLETE.YEAR_ID';
-
- /** the column name for the MONTH_NAME field */
- const MONTH_NAME = 'DIM_TIME_COMPLETE.MONTH_NAME';
-
- /** the column name for the MONTH_DESC field */
- const MONTH_DESC = 'DIM_TIME_COMPLETE.MONTH_DESC';
-
- /** the column name for the QTR_NAME field */
- const QTR_NAME = 'DIM_TIME_COMPLETE.QTR_NAME';
-
- /** the column name for the QTR_DESC field */
- const QTR_DESC = 'DIM_TIME_COMPLETE.QTR_DESC';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('TimeId', 'MonthId', 'QtrId', 'YearId', 'MonthName', 'MonthDesc', 'QtrName', 'QtrDesc', ),
- BasePeer::TYPE_COLNAME => array (DimTimeCompletePeer::TIME_ID, DimTimeCompletePeer::MONTH_ID, DimTimeCompletePeer::QTR_ID, DimTimeCompletePeer::YEAR_ID, DimTimeCompletePeer::MONTH_NAME, DimTimeCompletePeer::MONTH_DESC, DimTimeCompletePeer::QTR_NAME, DimTimeCompletePeer::QTR_DESC, ),
- BasePeer::TYPE_FIELDNAME => array ('TIME_ID', 'MONTH_ID', 'QTR_ID', 'YEAR_ID', 'MONTH_NAME', 'MONTH_DESC', 'QTR_NAME', 'QTR_DESC', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('TimeId' => 0, 'MonthId' => 1, 'QtrId' => 2, 'YearId' => 3, 'MonthName' => 4, 'MonthDesc' => 5, 'QtrName' => 6, 'QtrDesc' => 7, ),
- BasePeer::TYPE_COLNAME => array (DimTimeCompletePeer::TIME_ID => 0, DimTimeCompletePeer::MONTH_ID => 1, DimTimeCompletePeer::QTR_ID => 2, DimTimeCompletePeer::YEAR_ID => 3, DimTimeCompletePeer::MONTH_NAME => 4, DimTimeCompletePeer::MONTH_DESC => 5, DimTimeCompletePeer::QTR_NAME => 6, DimTimeCompletePeer::QTR_DESC => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('TIME_ID' => 0, 'MONTH_ID' => 1, 'QTR_ID' => 2, 'YEAR_ID' => 3, 'MONTH_NAME' => 4, 'MONTH_DESC' => 5, 'QTR_NAME' => 6, 'QTR_DESC' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/DimTimeCompleteMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.DimTimeCompleteMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = DimTimeCompletePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. DimTimeCompletePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(DimTimeCompletePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(DimTimeCompletePeer::TIME_ID);
-
- $criteria->addSelectColumn(DimTimeCompletePeer::MONTH_ID);
-
- $criteria->addSelectColumn(DimTimeCompletePeer::QTR_ID);
-
- $criteria->addSelectColumn(DimTimeCompletePeer::YEAR_ID);
-
- $criteria->addSelectColumn(DimTimeCompletePeer::MONTH_NAME);
-
- $criteria->addSelectColumn(DimTimeCompletePeer::MONTH_DESC);
-
- $criteria->addSelectColumn(DimTimeCompletePeer::QTR_NAME);
-
- $criteria->addSelectColumn(DimTimeCompletePeer::QTR_DESC);
-
- }
-
- const COUNT = 'COUNT(DIM_TIME_COMPLETE.TIME_ID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT DIM_TIME_COMPLETE.TIME_ID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(DimTimeCompletePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(DimTimeCompletePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = DimTimeCompletePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return DimTimeComplete
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = DimTimeCompletePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return DimTimeCompletePeer::populateObjects(DimTimeCompletePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- DimTimeCompletePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = DimTimeCompletePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return DimTimeCompletePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a DimTimeComplete or Criteria object.
- *
- * @param mixed $values Criteria or DimTimeComplete object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from DimTimeComplete object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a DimTimeComplete or Criteria object.
- *
- * @param mixed $values Criteria or DimTimeComplete object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(DimTimeCompletePeer::TIME_ID);
- $selectCriteria->add(DimTimeCompletePeer::TIME_ID, $criteria->remove(DimTimeCompletePeer::TIME_ID), $comparison);
-
- } else { // $values is DimTimeComplete object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the DIM_TIME_COMPLETE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(DimTimeCompletePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a DimTimeComplete or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or DimTimeComplete object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(DimTimeCompletePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof DimTimeComplete) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(DimTimeCompletePeer::TIME_ID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given DimTimeComplete object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param DimTimeComplete $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(DimTimeComplete $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(DimTimeCompletePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(DimTimeCompletePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(DimTimeCompletePeer::DATABASE_NAME, DimTimeCompletePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return DimTimeComplete
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(DimTimeCompletePeer::DATABASE_NAME);
-
- $criteria->add(DimTimeCompletePeer::TIME_ID, $pk);
-
-
- $v = DimTimeCompletePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(DimTimeCompletePeer::TIME_ID, $pks, Criteria::IN);
- $objs = DimTimeCompletePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseDimTimeCompletePeer
+abstract class BaseDimTimeCompletePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'DIM_TIME_COMPLETE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.DimTimeComplete';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the TIME_ID field */
+ const TIME_ID = 'DIM_TIME_COMPLETE.TIME_ID';
+
+ /** the column name for the MONTH_ID field */
+ const MONTH_ID = 'DIM_TIME_COMPLETE.MONTH_ID';
+
+ /** the column name for the QTR_ID field */
+ const QTR_ID = 'DIM_TIME_COMPLETE.QTR_ID';
+
+ /** the column name for the YEAR_ID field */
+ const YEAR_ID = 'DIM_TIME_COMPLETE.YEAR_ID';
+
+ /** the column name for the MONTH_NAME field */
+ const MONTH_NAME = 'DIM_TIME_COMPLETE.MONTH_NAME';
+
+ /** the column name for the MONTH_DESC field */
+ const MONTH_DESC = 'DIM_TIME_COMPLETE.MONTH_DESC';
+
+ /** the column name for the QTR_NAME field */
+ const QTR_NAME = 'DIM_TIME_COMPLETE.QTR_NAME';
+
+ /** the column name for the QTR_DESC field */
+ const QTR_DESC = 'DIM_TIME_COMPLETE.QTR_DESC';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('TimeId', 'MonthId', 'QtrId', 'YearId', 'MonthName', 'MonthDesc', 'QtrName', 'QtrDesc', ),
+ BasePeer::TYPE_COLNAME => array (DimTimeCompletePeer::TIME_ID, DimTimeCompletePeer::MONTH_ID, DimTimeCompletePeer::QTR_ID, DimTimeCompletePeer::YEAR_ID, DimTimeCompletePeer::MONTH_NAME, DimTimeCompletePeer::MONTH_DESC, DimTimeCompletePeer::QTR_NAME, DimTimeCompletePeer::QTR_DESC, ),
+ BasePeer::TYPE_FIELDNAME => array ('TIME_ID', 'MONTH_ID', 'QTR_ID', 'YEAR_ID', 'MONTH_NAME', 'MONTH_DESC', 'QTR_NAME', 'QTR_DESC', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('TimeId' => 0, 'MonthId' => 1, 'QtrId' => 2, 'YearId' => 3, 'MonthName' => 4, 'MonthDesc' => 5, 'QtrName' => 6, 'QtrDesc' => 7, ),
+ BasePeer::TYPE_COLNAME => array (DimTimeCompletePeer::TIME_ID => 0, DimTimeCompletePeer::MONTH_ID => 1, DimTimeCompletePeer::QTR_ID => 2, DimTimeCompletePeer::YEAR_ID => 3, DimTimeCompletePeer::MONTH_NAME => 4, DimTimeCompletePeer::MONTH_DESC => 5, DimTimeCompletePeer::QTR_NAME => 6, DimTimeCompletePeer::QTR_DESC => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('TIME_ID' => 0, 'MONTH_ID' => 1, 'QTR_ID' => 2, 'YEAR_ID' => 3, 'MONTH_NAME' => 4, 'MONTH_DESC' => 5, 'QTR_NAME' => 6, 'QTR_DESC' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/DimTimeCompleteMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.DimTimeCompleteMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = DimTimeCompletePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. DimTimeCompletePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(DimTimeCompletePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::TIME_ID);
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::MONTH_ID);
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::QTR_ID);
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::YEAR_ID);
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::MONTH_NAME);
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::MONTH_DESC);
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::QTR_NAME);
+
+ $criteria->addSelectColumn(DimTimeCompletePeer::QTR_DESC);
+
+ }
+
+ const COUNT = 'COUNT(DIM_TIME_COMPLETE.TIME_ID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT DIM_TIME_COMPLETE.TIME_ID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(DimTimeCompletePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(DimTimeCompletePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = DimTimeCompletePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return DimTimeComplete
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = DimTimeCompletePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return DimTimeCompletePeer::populateObjects(DimTimeCompletePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ DimTimeCompletePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = DimTimeCompletePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return DimTimeCompletePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a DimTimeComplete or Criteria object.
+ *
+ * @param mixed $values Criteria or DimTimeComplete object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from DimTimeComplete object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a DimTimeComplete or Criteria object.
+ *
+ * @param mixed $values Criteria or DimTimeComplete object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(DimTimeCompletePeer::TIME_ID);
+ $selectCriteria->add(DimTimeCompletePeer::TIME_ID, $criteria->remove(DimTimeCompletePeer::TIME_ID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the DIM_TIME_COMPLETE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(DimTimeCompletePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a DimTimeComplete or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or DimTimeComplete object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(DimTimeCompletePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof DimTimeComplete) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(DimTimeCompletePeer::TIME_ID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given DimTimeComplete object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param DimTimeComplete $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(DimTimeComplete $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(DimTimeCompletePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(DimTimeCompletePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(DimTimeCompletePeer::DATABASE_NAME, DimTimeCompletePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return DimTimeComplete
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(DimTimeCompletePeer::DATABASE_NAME);
+
+ $criteria->add(DimTimeCompletePeer::TIME_ID, $pk);
+
+
+ $v = DimTimeCompletePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(DimTimeCompletePeer::TIME_ID, $pks, Criteria::IN);
+ $objs = DimTimeCompletePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseDimTimeCompletePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseDimTimeCompletePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/DimTimeCompleteMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.DimTimeCompleteMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/DimTimeCompleteMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.DimTimeCompleteMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseDimTimeDelegate.php b/workflow/engine/classes/model/om/BaseDimTimeDelegate.php
index d57f5dcec..95fb2b0df 100755
--- a/workflow/engine/classes/model/om/BaseDimTimeDelegate.php
+++ b/workflow/engine/classes/model/om/BaseDimTimeDelegate.php
@@ -16,860 +16,901 @@ include_once 'classes/model/DimTimeDelegatePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDimTimeDelegate extends BaseObject implements Persistent {
-
+abstract class BaseDimTimeDelegate extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var DimTimeDelegatePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the time_id field.
+ * @var string
+ */
+ protected $time_id = '';
+
+ /**
+ * The value for the month_id field.
+ * @var int
+ */
+ protected $month_id = 0;
+
+ /**
+ * The value for the qtr_id field.
+ * @var int
+ */
+ protected $qtr_id = 0;
+
+ /**
+ * The value for the year_id field.
+ * @var int
+ */
+ protected $year_id = 0;
+
+ /**
+ * The value for the month_name field.
+ * @var string
+ */
+ protected $month_name = '0';
+
+ /**
+ * The value for the month_desc field.
+ * @var string
+ */
+ protected $month_desc = '';
+
+ /**
+ * The value for the qtr_name field.
+ * @var string
+ */
+ protected $qtr_name = '';
+
+ /**
+ * The value for the qtr_desc field.
+ * @var string
+ */
+ protected $qtr_desc = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [time_id] column value.
+ *
+ * @return string
+ */
+ public function getTimeId()
+ {
+
+ return $this->time_id;
+ }
+
+ /**
+ * Get the [month_id] column value.
+ *
+ * @return int
+ */
+ public function getMonthId()
+ {
+
+ return $this->month_id;
+ }
+
+ /**
+ * Get the [qtr_id] column value.
+ *
+ * @return int
+ */
+ public function getQtrId()
+ {
+
+ return $this->qtr_id;
+ }
+
+ /**
+ * Get the [year_id] column value.
+ *
+ * @return int
+ */
+ public function getYearId()
+ {
+
+ return $this->year_id;
+ }
+
+ /**
+ * Get the [month_name] column value.
+ *
+ * @return string
+ */
+ public function getMonthName()
+ {
+
+ return $this->month_name;
+ }
+
+ /**
+ * Get the [month_desc] column value.
+ *
+ * @return string
+ */
+ public function getMonthDesc()
+ {
+
+ return $this->month_desc;
+ }
+
+ /**
+ * Get the [qtr_name] column value.
+ *
+ * @return string
+ */
+ public function getQtrName()
+ {
+
+ return $this->qtr_name;
+ }
+
+ /**
+ * Get the [qtr_desc] column value.
+ *
+ * @return string
+ */
+ public function getQtrDesc()
+ {
+
+ return $this->qtr_desc;
+ }
+
+ /**
+ * Set the value of [time_id] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTimeId($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->time_id !== $v || $v === '') {
+ $this->time_id = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::TIME_ID;
+ }
+
+ } // setTimeId()
+
+ /**
+ * Set the value of [month_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setMonthId($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->month_id !== $v || $v === 0) {
+ $this->month_id = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::MONTH_ID;
+ }
+
+ } // setMonthId()
+
+ /**
+ * Set the value of [qtr_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setQtrId($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->qtr_id !== $v || $v === 0) {
+ $this->qtr_id = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::QTR_ID;
+ }
+
+ } // setQtrId()
+
+ /**
+ * Set the value of [year_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setYearId($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->year_id !== $v || $v === 0) {
+ $this->year_id = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::YEAR_ID;
+ }
+
+ } // setYearId()
+
+ /**
+ * Set the value of [month_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setMonthName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->month_name !== $v || $v === '0') {
+ $this->month_name = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::MONTH_NAME;
+ }
+
+ } // setMonthName()
+
+ /**
+ * Set the value of [month_desc] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setMonthDesc($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->month_desc !== $v || $v === '') {
+ $this->month_desc = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::MONTH_DESC;
+ }
+
+ } // setMonthDesc()
+
+ /**
+ * Set the value of [qtr_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setQtrName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->qtr_name !== $v || $v === '') {
+ $this->qtr_name = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::QTR_NAME;
+ }
+
+ } // setQtrName()
+
+ /**
+ * Set the value of [qtr_desc] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setQtrDesc($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->qtr_desc !== $v || $v === '') {
+ $this->qtr_desc = $v;
+ $this->modifiedColumns[] = DimTimeDelegatePeer::QTR_DESC;
+ }
+
+ } // setQtrDesc()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->time_id = $rs->getString($startcol + 0);
+
+ $this->month_id = $rs->getInt($startcol + 1);
+
+ $this->qtr_id = $rs->getInt($startcol + 2);
+
+ $this->year_id = $rs->getInt($startcol + 3);
+
+ $this->month_name = $rs->getString($startcol + 4);
+
+ $this->month_desc = $rs->getString($startcol + 5);
+
+ $this->qtr_name = $rs->getString($startcol + 6);
+
+ $this->qtr_desc = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = DimTimeDelegatePeer::NUM_COLUMNS - DimTimeDelegatePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating DimTimeDelegate object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DimTimeDelegatePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ DimTimeDelegatePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DimTimeDelegatePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = DimTimeDelegatePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += DimTimeDelegatePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = DimTimeDelegatePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DimTimeDelegatePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getTimeId();
+ break;
+ case 1:
+ return $this->getMonthId();
+ break;
+ case 2:
+ return $this->getQtrId();
+ break;
+ case 3:
+ return $this->getYearId();
+ break;
+ case 4:
+ return $this->getMonthName();
+ break;
+ case 5:
+ return $this->getMonthDesc();
+ break;
+ case 6:
+ return $this->getQtrName();
+ break;
+ case 7:
+ return $this->getQtrDesc();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DimTimeDelegatePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getTimeId(),
+ $keys[1] => $this->getMonthId(),
+ $keys[2] => $this->getQtrId(),
+ $keys[3] => $this->getYearId(),
+ $keys[4] => $this->getMonthName(),
+ $keys[5] => $this->getMonthDesc(),
+ $keys[6] => $this->getQtrName(),
+ $keys[7] => $this->getQtrDesc(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DimTimeDelegatePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setTimeId($value);
+ break;
+ case 1:
+ $this->setMonthId($value);
+ break;
+ case 2:
+ $this->setQtrId($value);
+ break;
+ case 3:
+ $this->setYearId($value);
+ break;
+ case 4:
+ $this->setMonthName($value);
+ break;
+ case 5:
+ $this->setMonthDesc($value);
+ break;
+ case 6:
+ $this->setQtrName($value);
+ break;
+ case 7:
+ $this->setQtrDesc($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DimTimeDelegatePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setTimeId($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setMonthId($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setQtrId($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setYearId($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setMonthName($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setMonthDesc($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setQtrName($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setQtrDesc($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(DimTimeDelegatePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::TIME_ID)) {
+ $criteria->add(DimTimeDelegatePeer::TIME_ID, $this->time_id);
+ }
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::MONTH_ID)) {
+ $criteria->add(DimTimeDelegatePeer::MONTH_ID, $this->month_id);
+ }
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::QTR_ID)) {
+ $criteria->add(DimTimeDelegatePeer::QTR_ID, $this->qtr_id);
+ }
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::YEAR_ID)) {
+ $criteria->add(DimTimeDelegatePeer::YEAR_ID, $this->year_id);
+ }
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::MONTH_NAME)) {
+ $criteria->add(DimTimeDelegatePeer::MONTH_NAME, $this->month_name);
+ }
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::MONTH_DESC)) {
+ $criteria->add(DimTimeDelegatePeer::MONTH_DESC, $this->month_desc);
+ }
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::QTR_NAME)) {
+ $criteria->add(DimTimeDelegatePeer::QTR_NAME, $this->qtr_name);
+ }
+
+ if ($this->isColumnModified(DimTimeDelegatePeer::QTR_DESC)) {
+ $criteria->add(DimTimeDelegatePeer::QTR_DESC, $this->qtr_desc);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(DimTimeDelegatePeer::DATABASE_NAME);
+
+ $criteria->add(DimTimeDelegatePeer::TIME_ID, $this->time_id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getTimeId();
+ }
+
+ /**
+ * Generic method to set the primary key (time_id column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setTimeId($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of DimTimeDelegate (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setMonthId($this->month_id);
+
+ $copyObj->setQtrId($this->qtr_id);
+
+ $copyObj->setYearId($this->year_id);
+
+ $copyObj->setMonthName($this->month_name);
+
+ $copyObj->setMonthDesc($this->month_desc);
+
+ $copyObj->setQtrName($this->qtr_name);
+
+ $copyObj->setQtrDesc($this->qtr_desc);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setTimeId(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return DimTimeDelegate Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return DimTimeDelegatePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new DimTimeDelegatePeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var DimTimeDelegatePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the time_id field.
- * @var string
- */
- protected $time_id = '';
-
-
- /**
- * The value for the month_id field.
- * @var int
- */
- protected $month_id = 0;
-
-
- /**
- * The value for the qtr_id field.
- * @var int
- */
- protected $qtr_id = 0;
-
-
- /**
- * The value for the year_id field.
- * @var int
- */
- protected $year_id = 0;
-
-
- /**
- * The value for the month_name field.
- * @var string
- */
- protected $month_name = '0';
-
-
- /**
- * The value for the month_desc field.
- * @var string
- */
- protected $month_desc = '';
-
-
- /**
- * The value for the qtr_name field.
- * @var string
- */
- protected $qtr_name = '';
-
-
- /**
- * The value for the qtr_desc field.
- * @var string
- */
- protected $qtr_desc = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [time_id] column value.
- *
- * @return string
- */
- public function getTimeId()
- {
-
- return $this->time_id;
- }
-
- /**
- * Get the [month_id] column value.
- *
- * @return int
- */
- public function getMonthId()
- {
-
- return $this->month_id;
- }
-
- /**
- * Get the [qtr_id] column value.
- *
- * @return int
- */
- public function getQtrId()
- {
-
- return $this->qtr_id;
- }
-
- /**
- * Get the [year_id] column value.
- *
- * @return int
- */
- public function getYearId()
- {
-
- return $this->year_id;
- }
-
- /**
- * Get the [month_name] column value.
- *
- * @return string
- */
- public function getMonthName()
- {
-
- return $this->month_name;
- }
-
- /**
- * Get the [month_desc] column value.
- *
- * @return string
- */
- public function getMonthDesc()
- {
-
- return $this->month_desc;
- }
-
- /**
- * Get the [qtr_name] column value.
- *
- * @return string
- */
- public function getQtrName()
- {
-
- return $this->qtr_name;
- }
-
- /**
- * Get the [qtr_desc] column value.
- *
- * @return string
- */
- public function getQtrDesc()
- {
-
- return $this->qtr_desc;
- }
-
- /**
- * Set the value of [time_id] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTimeId($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->time_id !== $v || $v === '') {
- $this->time_id = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::TIME_ID;
- }
-
- } // setTimeId()
-
- /**
- * Set the value of [month_id] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setMonthId($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->month_id !== $v || $v === 0) {
- $this->month_id = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::MONTH_ID;
- }
-
- } // setMonthId()
-
- /**
- * Set the value of [qtr_id] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setQtrId($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->qtr_id !== $v || $v === 0) {
- $this->qtr_id = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::QTR_ID;
- }
-
- } // setQtrId()
-
- /**
- * Set the value of [year_id] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setYearId($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->year_id !== $v || $v === 0) {
- $this->year_id = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::YEAR_ID;
- }
-
- } // setYearId()
-
- /**
- * Set the value of [month_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setMonthName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->month_name !== $v || $v === '0') {
- $this->month_name = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::MONTH_NAME;
- }
-
- } // setMonthName()
-
- /**
- * Set the value of [month_desc] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setMonthDesc($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->month_desc !== $v || $v === '') {
- $this->month_desc = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::MONTH_DESC;
- }
-
- } // setMonthDesc()
-
- /**
- * Set the value of [qtr_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setQtrName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->qtr_name !== $v || $v === '') {
- $this->qtr_name = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::QTR_NAME;
- }
-
- } // setQtrName()
-
- /**
- * Set the value of [qtr_desc] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setQtrDesc($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->qtr_desc !== $v || $v === '') {
- $this->qtr_desc = $v;
- $this->modifiedColumns[] = DimTimeDelegatePeer::QTR_DESC;
- }
-
- } // setQtrDesc()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->time_id = $rs->getString($startcol + 0);
-
- $this->month_id = $rs->getInt($startcol + 1);
-
- $this->qtr_id = $rs->getInt($startcol + 2);
-
- $this->year_id = $rs->getInt($startcol + 3);
-
- $this->month_name = $rs->getString($startcol + 4);
-
- $this->month_desc = $rs->getString($startcol + 5);
-
- $this->qtr_name = $rs->getString($startcol + 6);
-
- $this->qtr_desc = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = DimTimeDelegatePeer::NUM_COLUMNS - DimTimeDelegatePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating DimTimeDelegate object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DimTimeDelegatePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- DimTimeDelegatePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DimTimeDelegatePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = DimTimeDelegatePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += DimTimeDelegatePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = DimTimeDelegatePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DimTimeDelegatePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getTimeId();
- break;
- case 1:
- return $this->getMonthId();
- break;
- case 2:
- return $this->getQtrId();
- break;
- case 3:
- return $this->getYearId();
- break;
- case 4:
- return $this->getMonthName();
- break;
- case 5:
- return $this->getMonthDesc();
- break;
- case 6:
- return $this->getQtrName();
- break;
- case 7:
- return $this->getQtrDesc();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DimTimeDelegatePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getTimeId(),
- $keys[1] => $this->getMonthId(),
- $keys[2] => $this->getQtrId(),
- $keys[3] => $this->getYearId(),
- $keys[4] => $this->getMonthName(),
- $keys[5] => $this->getMonthDesc(),
- $keys[6] => $this->getQtrName(),
- $keys[7] => $this->getQtrDesc(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DimTimeDelegatePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setTimeId($value);
- break;
- case 1:
- $this->setMonthId($value);
- break;
- case 2:
- $this->setQtrId($value);
- break;
- case 3:
- $this->setYearId($value);
- break;
- case 4:
- $this->setMonthName($value);
- break;
- case 5:
- $this->setMonthDesc($value);
- break;
- case 6:
- $this->setQtrName($value);
- break;
- case 7:
- $this->setQtrDesc($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DimTimeDelegatePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setTimeId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setMonthId($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setQtrId($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setYearId($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setMonthName($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setMonthDesc($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setQtrName($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setQtrDesc($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(DimTimeDelegatePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(DimTimeDelegatePeer::TIME_ID)) $criteria->add(DimTimeDelegatePeer::TIME_ID, $this->time_id);
- if ($this->isColumnModified(DimTimeDelegatePeer::MONTH_ID)) $criteria->add(DimTimeDelegatePeer::MONTH_ID, $this->month_id);
- if ($this->isColumnModified(DimTimeDelegatePeer::QTR_ID)) $criteria->add(DimTimeDelegatePeer::QTR_ID, $this->qtr_id);
- if ($this->isColumnModified(DimTimeDelegatePeer::YEAR_ID)) $criteria->add(DimTimeDelegatePeer::YEAR_ID, $this->year_id);
- if ($this->isColumnModified(DimTimeDelegatePeer::MONTH_NAME)) $criteria->add(DimTimeDelegatePeer::MONTH_NAME, $this->month_name);
- if ($this->isColumnModified(DimTimeDelegatePeer::MONTH_DESC)) $criteria->add(DimTimeDelegatePeer::MONTH_DESC, $this->month_desc);
- if ($this->isColumnModified(DimTimeDelegatePeer::QTR_NAME)) $criteria->add(DimTimeDelegatePeer::QTR_NAME, $this->qtr_name);
- if ($this->isColumnModified(DimTimeDelegatePeer::QTR_DESC)) $criteria->add(DimTimeDelegatePeer::QTR_DESC, $this->qtr_desc);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(DimTimeDelegatePeer::DATABASE_NAME);
-
- $criteria->add(DimTimeDelegatePeer::TIME_ID, $this->time_id);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getTimeId();
- }
-
- /**
- * Generic method to set the primary key (time_id column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setTimeId($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of DimTimeDelegate (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setMonthId($this->month_id);
-
- $copyObj->setQtrId($this->qtr_id);
-
- $copyObj->setYearId($this->year_id);
-
- $copyObj->setMonthName($this->month_name);
-
- $copyObj->setMonthDesc($this->month_desc);
-
- $copyObj->setQtrName($this->qtr_name);
-
- $copyObj->setQtrDesc($this->qtr_desc);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setTimeId(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return DimTimeDelegate Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return DimTimeDelegatePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new DimTimeDelegatePeer();
- }
- return self::$peer;
- }
-
-} // BaseDimTimeDelegate
diff --git a/workflow/engine/classes/model/om/BaseDimTimeDelegatePeer.php b/workflow/engine/classes/model/om/BaseDimTimeDelegatePeer.php
index 63ced11f5..c0b2eaeda 100755
--- a/workflow/engine/classes/model/om/BaseDimTimeDelegatePeer.php
+++ b/workflow/engine/classes/model/om/BaseDimTimeDelegatePeer.php
@@ -12,589 +12,591 @@ include_once 'classes/model/DimTimeDelegate.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDimTimeDelegatePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'DIM_TIME_DELEGATE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.DimTimeDelegate';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the TIME_ID field */
- const TIME_ID = 'DIM_TIME_DELEGATE.TIME_ID';
-
- /** the column name for the MONTH_ID field */
- const MONTH_ID = 'DIM_TIME_DELEGATE.MONTH_ID';
-
- /** the column name for the QTR_ID field */
- const QTR_ID = 'DIM_TIME_DELEGATE.QTR_ID';
-
- /** the column name for the YEAR_ID field */
- const YEAR_ID = 'DIM_TIME_DELEGATE.YEAR_ID';
-
- /** the column name for the MONTH_NAME field */
- const MONTH_NAME = 'DIM_TIME_DELEGATE.MONTH_NAME';
-
- /** the column name for the MONTH_DESC field */
- const MONTH_DESC = 'DIM_TIME_DELEGATE.MONTH_DESC';
-
- /** the column name for the QTR_NAME field */
- const QTR_NAME = 'DIM_TIME_DELEGATE.QTR_NAME';
-
- /** the column name for the QTR_DESC field */
- const QTR_DESC = 'DIM_TIME_DELEGATE.QTR_DESC';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('TimeId', 'MonthId', 'QtrId', 'YearId', 'MonthName', 'MonthDesc', 'QtrName', 'QtrDesc', ),
- BasePeer::TYPE_COLNAME => array (DimTimeDelegatePeer::TIME_ID, DimTimeDelegatePeer::MONTH_ID, DimTimeDelegatePeer::QTR_ID, DimTimeDelegatePeer::YEAR_ID, DimTimeDelegatePeer::MONTH_NAME, DimTimeDelegatePeer::MONTH_DESC, DimTimeDelegatePeer::QTR_NAME, DimTimeDelegatePeer::QTR_DESC, ),
- BasePeer::TYPE_FIELDNAME => array ('TIME_ID', 'MONTH_ID', 'QTR_ID', 'YEAR_ID', 'MONTH_NAME', 'MONTH_DESC', 'QTR_NAME', 'QTR_DESC', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('TimeId' => 0, 'MonthId' => 1, 'QtrId' => 2, 'YearId' => 3, 'MonthName' => 4, 'MonthDesc' => 5, 'QtrName' => 6, 'QtrDesc' => 7, ),
- BasePeer::TYPE_COLNAME => array (DimTimeDelegatePeer::TIME_ID => 0, DimTimeDelegatePeer::MONTH_ID => 1, DimTimeDelegatePeer::QTR_ID => 2, DimTimeDelegatePeer::YEAR_ID => 3, DimTimeDelegatePeer::MONTH_NAME => 4, DimTimeDelegatePeer::MONTH_DESC => 5, DimTimeDelegatePeer::QTR_NAME => 6, DimTimeDelegatePeer::QTR_DESC => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('TIME_ID' => 0, 'MONTH_ID' => 1, 'QTR_ID' => 2, 'YEAR_ID' => 3, 'MONTH_NAME' => 4, 'MONTH_DESC' => 5, 'QTR_NAME' => 6, 'QTR_DESC' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/DimTimeDelegateMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.DimTimeDelegateMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = DimTimeDelegatePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. DimTimeDelegatePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(DimTimeDelegatePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::TIME_ID);
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::MONTH_ID);
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::QTR_ID);
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::YEAR_ID);
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::MONTH_NAME);
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::MONTH_DESC);
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::QTR_NAME);
-
- $criteria->addSelectColumn(DimTimeDelegatePeer::QTR_DESC);
-
- }
-
- const COUNT = 'COUNT(DIM_TIME_DELEGATE.TIME_ID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT DIM_TIME_DELEGATE.TIME_ID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(DimTimeDelegatePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(DimTimeDelegatePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = DimTimeDelegatePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return DimTimeDelegate
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = DimTimeDelegatePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return DimTimeDelegatePeer::populateObjects(DimTimeDelegatePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- DimTimeDelegatePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = DimTimeDelegatePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return DimTimeDelegatePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a DimTimeDelegate or Criteria object.
- *
- * @param mixed $values Criteria or DimTimeDelegate object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from DimTimeDelegate object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a DimTimeDelegate or Criteria object.
- *
- * @param mixed $values Criteria or DimTimeDelegate object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(DimTimeDelegatePeer::TIME_ID);
- $selectCriteria->add(DimTimeDelegatePeer::TIME_ID, $criteria->remove(DimTimeDelegatePeer::TIME_ID), $comparison);
-
- } else { // $values is DimTimeDelegate object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the DIM_TIME_DELEGATE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(DimTimeDelegatePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a DimTimeDelegate or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or DimTimeDelegate object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(DimTimeDelegatePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof DimTimeDelegate) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(DimTimeDelegatePeer::TIME_ID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given DimTimeDelegate object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param DimTimeDelegate $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(DimTimeDelegate $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(DimTimeDelegatePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(DimTimeDelegatePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(DimTimeDelegatePeer::DATABASE_NAME, DimTimeDelegatePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return DimTimeDelegate
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(DimTimeDelegatePeer::DATABASE_NAME);
-
- $criteria->add(DimTimeDelegatePeer::TIME_ID, $pk);
-
-
- $v = DimTimeDelegatePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(DimTimeDelegatePeer::TIME_ID, $pks, Criteria::IN);
- $objs = DimTimeDelegatePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseDimTimeDelegatePeer
+abstract class BaseDimTimeDelegatePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'DIM_TIME_DELEGATE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.DimTimeDelegate';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the TIME_ID field */
+ const TIME_ID = 'DIM_TIME_DELEGATE.TIME_ID';
+
+ /** the column name for the MONTH_ID field */
+ const MONTH_ID = 'DIM_TIME_DELEGATE.MONTH_ID';
+
+ /** the column name for the QTR_ID field */
+ const QTR_ID = 'DIM_TIME_DELEGATE.QTR_ID';
+
+ /** the column name for the YEAR_ID field */
+ const YEAR_ID = 'DIM_TIME_DELEGATE.YEAR_ID';
+
+ /** the column name for the MONTH_NAME field */
+ const MONTH_NAME = 'DIM_TIME_DELEGATE.MONTH_NAME';
+
+ /** the column name for the MONTH_DESC field */
+ const MONTH_DESC = 'DIM_TIME_DELEGATE.MONTH_DESC';
+
+ /** the column name for the QTR_NAME field */
+ const QTR_NAME = 'DIM_TIME_DELEGATE.QTR_NAME';
+
+ /** the column name for the QTR_DESC field */
+ const QTR_DESC = 'DIM_TIME_DELEGATE.QTR_DESC';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('TimeId', 'MonthId', 'QtrId', 'YearId', 'MonthName', 'MonthDesc', 'QtrName', 'QtrDesc', ),
+ BasePeer::TYPE_COLNAME => array (DimTimeDelegatePeer::TIME_ID, DimTimeDelegatePeer::MONTH_ID, DimTimeDelegatePeer::QTR_ID, DimTimeDelegatePeer::YEAR_ID, DimTimeDelegatePeer::MONTH_NAME, DimTimeDelegatePeer::MONTH_DESC, DimTimeDelegatePeer::QTR_NAME, DimTimeDelegatePeer::QTR_DESC, ),
+ BasePeer::TYPE_FIELDNAME => array ('TIME_ID', 'MONTH_ID', 'QTR_ID', 'YEAR_ID', 'MONTH_NAME', 'MONTH_DESC', 'QTR_NAME', 'QTR_DESC', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('TimeId' => 0, 'MonthId' => 1, 'QtrId' => 2, 'YearId' => 3, 'MonthName' => 4, 'MonthDesc' => 5, 'QtrName' => 6, 'QtrDesc' => 7, ),
+ BasePeer::TYPE_COLNAME => array (DimTimeDelegatePeer::TIME_ID => 0, DimTimeDelegatePeer::MONTH_ID => 1, DimTimeDelegatePeer::QTR_ID => 2, DimTimeDelegatePeer::YEAR_ID => 3, DimTimeDelegatePeer::MONTH_NAME => 4, DimTimeDelegatePeer::MONTH_DESC => 5, DimTimeDelegatePeer::QTR_NAME => 6, DimTimeDelegatePeer::QTR_DESC => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('TIME_ID' => 0, 'MONTH_ID' => 1, 'QTR_ID' => 2, 'YEAR_ID' => 3, 'MONTH_NAME' => 4, 'MONTH_DESC' => 5, 'QTR_NAME' => 6, 'QTR_DESC' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/DimTimeDelegateMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.DimTimeDelegateMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = DimTimeDelegatePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. DimTimeDelegatePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(DimTimeDelegatePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::TIME_ID);
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::MONTH_ID);
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::QTR_ID);
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::YEAR_ID);
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::MONTH_NAME);
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::MONTH_DESC);
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::QTR_NAME);
+
+ $criteria->addSelectColumn(DimTimeDelegatePeer::QTR_DESC);
+
+ }
+
+ const COUNT = 'COUNT(DIM_TIME_DELEGATE.TIME_ID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT DIM_TIME_DELEGATE.TIME_ID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(DimTimeDelegatePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(DimTimeDelegatePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = DimTimeDelegatePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return DimTimeDelegate
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = DimTimeDelegatePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return DimTimeDelegatePeer::populateObjects(DimTimeDelegatePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ DimTimeDelegatePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = DimTimeDelegatePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return DimTimeDelegatePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a DimTimeDelegate or Criteria object.
+ *
+ * @param mixed $values Criteria or DimTimeDelegate object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from DimTimeDelegate object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a DimTimeDelegate or Criteria object.
+ *
+ * @param mixed $values Criteria or DimTimeDelegate object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(DimTimeDelegatePeer::TIME_ID);
+ $selectCriteria->add(DimTimeDelegatePeer::TIME_ID, $criteria->remove(DimTimeDelegatePeer::TIME_ID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the DIM_TIME_DELEGATE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(DimTimeDelegatePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a DimTimeDelegate or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or DimTimeDelegate object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(DimTimeDelegatePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof DimTimeDelegate) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(DimTimeDelegatePeer::TIME_ID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given DimTimeDelegate object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param DimTimeDelegate $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(DimTimeDelegate $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(DimTimeDelegatePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(DimTimeDelegatePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(DimTimeDelegatePeer::DATABASE_NAME, DimTimeDelegatePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return DimTimeDelegate
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(DimTimeDelegatePeer::DATABASE_NAME);
+
+ $criteria->add(DimTimeDelegatePeer::TIME_ID, $pk);
+
+
+ $v = DimTimeDelegatePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(DimTimeDelegatePeer::TIME_ID, $pks, Criteria::IN);
+ $objs = DimTimeDelegatePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseDimTimeDelegatePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseDimTimeDelegatePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/DimTimeDelegateMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.DimTimeDelegateMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/DimTimeDelegateMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.DimTimeDelegateMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseDynaform.php b/workflow/engine/classes/model/om/BaseDynaform.php
index 935830956..8a2ae695c 100755
--- a/workflow/engine/classes/model/om/BaseDynaform.php
+++ b/workflow/engine/classes/model/om/BaseDynaform.php
@@ -16,648 +16,669 @@ include_once 'classes/model/DynaformPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDynaform extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var DynaformPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the dyn_uid field.
- * @var string
- */
- protected $dyn_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the dyn_type field.
- * @var string
- */
- protected $dyn_type = 'xmlform';
-
-
- /**
- * The value for the dyn_filename field.
- * @var string
- */
- protected $dyn_filename = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [dyn_uid] column value.
- *
- * @return string
- */
- public function getDynUid()
- {
-
- return $this->dyn_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [dyn_type] column value.
- *
- * @return string
- */
- public function getDynType()
- {
-
- return $this->dyn_type;
- }
-
- /**
- * Get the [dyn_filename] column value.
- *
- * @return string
- */
- public function getDynFilename()
- {
-
- return $this->dyn_filename;
- }
-
- /**
- * Set the value of [dyn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDynUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dyn_uid !== $v || $v === '') {
- $this->dyn_uid = $v;
- $this->modifiedColumns[] = DynaformPeer::DYN_UID;
- }
-
- } // setDynUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = DynaformPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [dyn_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDynType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dyn_type !== $v || $v === 'xmlform') {
- $this->dyn_type = $v;
- $this->modifiedColumns[] = DynaformPeer::DYN_TYPE;
- }
-
- } // setDynType()
-
- /**
- * Set the value of [dyn_filename] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDynFilename($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dyn_filename !== $v || $v === '') {
- $this->dyn_filename = $v;
- $this->modifiedColumns[] = DynaformPeer::DYN_FILENAME;
- }
-
- } // setDynFilename()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->dyn_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->dyn_type = $rs->getString($startcol + 2);
-
- $this->dyn_filename = $rs->getString($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = DynaformPeer::NUM_COLUMNS - DynaformPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Dynaform object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- DynaformPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = DynaformPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += DynaformPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = DynaformPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DynaformPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getDynUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getDynType();
- break;
- case 3:
- return $this->getDynFilename();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DynaformPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getDynUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getDynType(),
- $keys[3] => $this->getDynFilename(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = DynaformPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setDynUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setDynType($value);
- break;
- case 3:
- $this->setDynFilename($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = DynaformPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setDynUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setDynType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDynFilename($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(DynaformPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(DynaformPeer::DYN_UID)) $criteria->add(DynaformPeer::DYN_UID, $this->dyn_uid);
- if ($this->isColumnModified(DynaformPeer::PRO_UID)) $criteria->add(DynaformPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(DynaformPeer::DYN_TYPE)) $criteria->add(DynaformPeer::DYN_TYPE, $this->dyn_type);
- if ($this->isColumnModified(DynaformPeer::DYN_FILENAME)) $criteria->add(DynaformPeer::DYN_FILENAME, $this->dyn_filename);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(DynaformPeer::DATABASE_NAME);
-
- $criteria->add(DynaformPeer::DYN_UID, $this->dyn_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getDynUid();
- }
-
- /**
- * Generic method to set the primary key (dyn_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setDynUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Dynaform (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setDynType($this->dyn_type);
-
- $copyObj->setDynFilename($this->dyn_filename);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setDynUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Dynaform Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return DynaformPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new DynaformPeer();
- }
- return self::$peer;
- }
-
-} // BaseDynaform
+abstract class BaseDynaform extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var DynaformPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the dyn_uid field.
+ * @var string
+ */
+ protected $dyn_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the dyn_type field.
+ * @var string
+ */
+ protected $dyn_type = 'xmlform';
+
+ /**
+ * The value for the dyn_filename field.
+ * @var string
+ */
+ protected $dyn_filename = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [dyn_uid] column value.
+ *
+ * @return string
+ */
+ public function getDynUid()
+ {
+
+ return $this->dyn_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [dyn_type] column value.
+ *
+ * @return string
+ */
+ public function getDynType()
+ {
+
+ return $this->dyn_type;
+ }
+
+ /**
+ * Get the [dyn_filename] column value.
+ *
+ * @return string
+ */
+ public function getDynFilename()
+ {
+
+ return $this->dyn_filename;
+ }
+
+ /**
+ * Set the value of [dyn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDynUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dyn_uid !== $v || $v === '') {
+ $this->dyn_uid = $v;
+ $this->modifiedColumns[] = DynaformPeer::DYN_UID;
+ }
+
+ } // setDynUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = DynaformPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [dyn_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDynType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dyn_type !== $v || $v === 'xmlform') {
+ $this->dyn_type = $v;
+ $this->modifiedColumns[] = DynaformPeer::DYN_TYPE;
+ }
+
+ } // setDynType()
+
+ /**
+ * Set the value of [dyn_filename] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDynFilename($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dyn_filename !== $v || $v === '') {
+ $this->dyn_filename = $v;
+ $this->modifiedColumns[] = DynaformPeer::DYN_FILENAME;
+ }
+
+ } // setDynFilename()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->dyn_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->dyn_type = $rs->getString($startcol + 2);
+
+ $this->dyn_filename = $rs->getString($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = DynaformPeer::NUM_COLUMNS - DynaformPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Dynaform object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ DynaformPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = DynaformPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += DynaformPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = DynaformPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DynaformPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getDynUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getDynType();
+ break;
+ case 3:
+ return $this->getDynFilename();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DynaformPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getDynUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getDynType(),
+ $keys[3] => $this->getDynFilename(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = DynaformPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setDynUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setDynType($value);
+ break;
+ case 3:
+ $this->setDynFilename($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = DynaformPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setDynUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setDynType($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDynFilename($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(DynaformPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(DynaformPeer::DYN_UID)) {
+ $criteria->add(DynaformPeer::DYN_UID, $this->dyn_uid);
+ }
+
+ if ($this->isColumnModified(DynaformPeer::PRO_UID)) {
+ $criteria->add(DynaformPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(DynaformPeer::DYN_TYPE)) {
+ $criteria->add(DynaformPeer::DYN_TYPE, $this->dyn_type);
+ }
+
+ if ($this->isColumnModified(DynaformPeer::DYN_FILENAME)) {
+ $criteria->add(DynaformPeer::DYN_FILENAME, $this->dyn_filename);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(DynaformPeer::DATABASE_NAME);
+
+ $criteria->add(DynaformPeer::DYN_UID, $this->dyn_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getDynUid();
+ }
+
+ /**
+ * Generic method to set the primary key (dyn_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setDynUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Dynaform (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setDynType($this->dyn_type);
+
+ $copyObj->setDynFilename($this->dyn_filename);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setDynUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Dynaform Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return DynaformPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new DynaformPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseDynaformPeer.php b/workflow/engine/classes/model/om/BaseDynaformPeer.php
index 8a81d6c00..0fce2d844 100755
--- a/workflow/engine/classes/model/om/BaseDynaformPeer.php
+++ b/workflow/engine/classes/model/om/BaseDynaformPeer.php
@@ -12,572 +12,574 @@ include_once 'classes/model/Dynaform.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseDynaformPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'DYNAFORM';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Dynaform';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the DYN_UID field */
- const DYN_UID = 'DYNAFORM.DYN_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'DYNAFORM.PRO_UID';
-
- /** the column name for the DYN_TYPE field */
- const DYN_TYPE = 'DYNAFORM.DYN_TYPE';
-
- /** the column name for the DYN_FILENAME field */
- const DYN_FILENAME = 'DYNAFORM.DYN_FILENAME';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('DynUid', 'ProUid', 'DynType', 'DynFilename', ),
- BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID, DynaformPeer::PRO_UID, DynaformPeer::DYN_TYPE, DynaformPeer::DYN_FILENAME, ),
- BasePeer::TYPE_FIELDNAME => array ('DYN_UID', 'PRO_UID', 'DYN_TYPE', 'DYN_FILENAME', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('DynUid' => 0, 'ProUid' => 1, 'DynType' => 2, 'DynFilename' => 3, ),
- BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID => 0, DynaformPeer::PRO_UID => 1, DynaformPeer::DYN_TYPE => 2, DynaformPeer::DYN_FILENAME => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('DYN_UID' => 0, 'PRO_UID' => 1, 'DYN_TYPE' => 2, 'DYN_FILENAME' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/DynaformMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.DynaformMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = DynaformPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. DynaformPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(DynaformPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(DynaformPeer::DYN_UID);
-
- $criteria->addSelectColumn(DynaformPeer::PRO_UID);
-
- $criteria->addSelectColumn(DynaformPeer::DYN_TYPE);
-
- $criteria->addSelectColumn(DynaformPeer::DYN_FILENAME);
-
- }
-
- const COUNT = 'COUNT(DYNAFORM.DYN_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT DYNAFORM.DYN_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(DynaformPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(DynaformPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = DynaformPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Dynaform
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = DynaformPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return DynaformPeer::populateObjects(DynaformPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- DynaformPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = DynaformPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return DynaformPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Dynaform or Criteria object.
- *
- * @param mixed $values Criteria or Dynaform object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Dynaform object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Dynaform or Criteria object.
- *
- * @param mixed $values Criteria or Dynaform object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(DynaformPeer::DYN_UID);
- $selectCriteria->add(DynaformPeer::DYN_UID, $criteria->remove(DynaformPeer::DYN_UID), $comparison);
-
- } else { // $values is Dynaform object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the DYNAFORM table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(DynaformPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Dynaform or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Dynaform object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Dynaform) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(DynaformPeer::DYN_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Dynaform object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Dynaform $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Dynaform $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(DynaformPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(DynaformPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(DynaformPeer::DYN_TYPE))
- $columns[DynaformPeer::DYN_TYPE] = $obj->getDynType();
-
- }
-
- return BasePeer::doValidate(DynaformPeer::DATABASE_NAME, DynaformPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Dynaform
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(DynaformPeer::DATABASE_NAME);
-
- $criteria->add(DynaformPeer::DYN_UID, $pk);
-
-
- $v = DynaformPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(DynaformPeer::DYN_UID, $pks, Criteria::IN);
- $objs = DynaformPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseDynaformPeer
+abstract class BaseDynaformPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'DYNAFORM';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Dynaform';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the DYN_UID field */
+ const DYN_UID = 'DYNAFORM.DYN_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'DYNAFORM.PRO_UID';
+
+ /** the column name for the DYN_TYPE field */
+ const DYN_TYPE = 'DYNAFORM.DYN_TYPE';
+
+ /** the column name for the DYN_FILENAME field */
+ const DYN_FILENAME = 'DYNAFORM.DYN_FILENAME';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('DynUid', 'ProUid', 'DynType', 'DynFilename', ),
+ BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID, DynaformPeer::PRO_UID, DynaformPeer::DYN_TYPE, DynaformPeer::DYN_FILENAME, ),
+ BasePeer::TYPE_FIELDNAME => array ('DYN_UID', 'PRO_UID', 'DYN_TYPE', 'DYN_FILENAME', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('DynUid' => 0, 'ProUid' => 1, 'DynType' => 2, 'DynFilename' => 3, ),
+ BasePeer::TYPE_COLNAME => array (DynaformPeer::DYN_UID => 0, DynaformPeer::PRO_UID => 1, DynaformPeer::DYN_TYPE => 2, DynaformPeer::DYN_FILENAME => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('DYN_UID' => 0, 'PRO_UID' => 1, 'DYN_TYPE' => 2, 'DYN_FILENAME' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/DynaformMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.DynaformMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = DynaformPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. DynaformPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(DynaformPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(DynaformPeer::DYN_UID);
+
+ $criteria->addSelectColumn(DynaformPeer::PRO_UID);
+
+ $criteria->addSelectColumn(DynaformPeer::DYN_TYPE);
+
+ $criteria->addSelectColumn(DynaformPeer::DYN_FILENAME);
+
+ }
+
+ const COUNT = 'COUNT(DYNAFORM.DYN_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT DYNAFORM.DYN_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(DynaformPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(DynaformPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = DynaformPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Dynaform
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = DynaformPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return DynaformPeer::populateObjects(DynaformPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ DynaformPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = DynaformPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return DynaformPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Dynaform or Criteria object.
+ *
+ * @param mixed $values Criteria or Dynaform object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Dynaform object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Dynaform or Criteria object.
+ *
+ * @param mixed $values Criteria or Dynaform object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(DynaformPeer::DYN_UID);
+ $selectCriteria->add(DynaformPeer::DYN_UID, $criteria->remove(DynaformPeer::DYN_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the DYNAFORM table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(DynaformPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Dynaform or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Dynaform object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Dynaform) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(DynaformPeer::DYN_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Dynaform object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Dynaform $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Dynaform $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(DynaformPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(DynaformPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(DynaformPeer::DYN_TYPE))
+ $columns[DynaformPeer::DYN_TYPE] = $obj->getDynType();
+
+ }
+
+ return BasePeer::doValidate(DynaformPeer::DATABASE_NAME, DynaformPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Dynaform
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(DynaformPeer::DATABASE_NAME);
+
+ $criteria->add(DynaformPeer::DYN_UID, $pk);
+
+
+ $v = DynaformPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(DynaformPeer::DYN_UID, $pks, Criteria::IN);
+ $objs = DynaformPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseDynaformPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseDynaformPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/DynaformMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.DynaformMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/DynaformMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.DynaformMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseEvent.php b/workflow/engine/classes/model/om/BaseEvent.php
index ef7de057e..6e1bc7e4f 100755
--- a/workflow/engine/classes/model/om/BaseEvent.php
+++ b/workflow/engine/classes/model/om/BaseEvent.php
@@ -16,1484 +16,1585 @@ include_once 'classes/model/EventPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseEvent extends BaseObject implements Persistent {
+abstract class BaseEvent extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var EventPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the evn_uid field.
+ * @var string
+ */
+ protected $evn_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the evn_status field.
+ * @var string
+ */
+ protected $evn_status = 'OPEN';
+
+ /**
+ * The value for the evn_when_occurs field.
+ * @var string
+ */
+ protected $evn_when_occurs = 'SINGLE';
+
+ /**
+ * The value for the evn_related_to field.
+ * @var string
+ */
+ protected $evn_related_to = 'SINGLE';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the evn_tas_uid_from field.
+ * @var string
+ */
+ protected $evn_tas_uid_from = '';
+
+ /**
+ * The value for the evn_tas_uid_to field.
+ * @var string
+ */
+ protected $evn_tas_uid_to = '';
+
+ /**
+ * The value for the evn_tas_estimated_duration field.
+ * @var double
+ */
+ protected $evn_tas_estimated_duration = 0;
+
+ /**
+ * The value for the evn_time_unit field.
+ * @var string
+ */
+ protected $evn_time_unit = 'DAYS';
+
+ /**
+ * The value for the evn_when field.
+ * @var double
+ */
+ protected $evn_when = 0;
+
+ /**
+ * The value for the evn_max_attempts field.
+ * @var int
+ */
+ protected $evn_max_attempts = 3;
+
+ /**
+ * The value for the evn_action field.
+ * @var string
+ */
+ protected $evn_action = '';
+
+ /**
+ * The value for the evn_conditions field.
+ * @var string
+ */
+ protected $evn_conditions;
+
+ /**
+ * The value for the evn_action_parameters field.
+ * @var string
+ */
+ protected $evn_action_parameters;
+
+ /**
+ * The value for the tri_uid field.
+ * @var string
+ */
+ protected $tri_uid = '';
+
+ /**
+ * The value for the evn_posx field.
+ * @var int
+ */
+ protected $evn_posx = 0;
+
+ /**
+ * The value for the evn_posy field.
+ * @var int
+ */
+ protected $evn_posy = 0;
+
+ /**
+ * The value for the evn_type field.
+ * @var string
+ */
+ protected $evn_type = '';
+
+ /**
+ * The value for the tas_evn_uid field.
+ * @var string
+ */
+ protected $tas_evn_uid = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [evn_uid] column value.
+ *
+ * @return string
+ */
+ public function getEvnUid()
+ {
+
+ return $this->evn_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [evn_status] column value.
+ *
+ * @return string
+ */
+ public function getEvnStatus()
+ {
+
+ return $this->evn_status;
+ }
+
+ /**
+ * Get the [evn_when_occurs] column value.
+ *
+ * @return string
+ */
+ public function getEvnWhenOccurs()
+ {
+
+ return $this->evn_when_occurs;
+ }
+
+ /**
+ * Get the [evn_related_to] column value.
+ *
+ * @return string
+ */
+ public function getEvnRelatedTo()
+ {
+
+ return $this->evn_related_to;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [evn_tas_uid_from] column value.
+ *
+ * @return string
+ */
+ public function getEvnTasUidFrom()
+ {
+
+ return $this->evn_tas_uid_from;
+ }
+
+ /**
+ * Get the [evn_tas_uid_to] column value.
+ *
+ * @return string
+ */
+ public function getEvnTasUidTo()
+ {
+
+ return $this->evn_tas_uid_to;
+ }
+
+ /**
+ * Get the [evn_tas_estimated_duration] column value.
+ *
+ * @return double
+ */
+ public function getEvnTasEstimatedDuration()
+ {
+
+ return $this->evn_tas_estimated_duration;
+ }
+
+ /**
+ * Get the [evn_time_unit] column value.
+ *
+ * @return string
+ */
+ public function getEvnTimeUnit()
+ {
+
+ return $this->evn_time_unit;
+ }
+
+ /**
+ * Get the [evn_when] column value.
+ *
+ * @return double
+ */
+ public function getEvnWhen()
+ {
+
+ return $this->evn_when;
+ }
+
+ /**
+ * Get the [evn_max_attempts] column value.
+ *
+ * @return int
+ */
+ public function getEvnMaxAttempts()
+ {
+
+ return $this->evn_max_attempts;
+ }
+
+ /**
+ * Get the [evn_action] column value.
+ *
+ * @return string
+ */
+ public function getEvnAction()
+ {
+
+ return $this->evn_action;
+ }
+
+ /**
+ * Get the [evn_conditions] column value.
+ *
+ * @return string
+ */
+ public function getEvnConditions()
+ {
+
+ return $this->evn_conditions;
+ }
+
+ /**
+ * Get the [evn_action_parameters] column value.
+ *
+ * @return string
+ */
+ public function getEvnActionParameters()
+ {
+
+ return $this->evn_action_parameters;
+ }
+
+ /**
+ * Get the [tri_uid] column value.
+ *
+ * @return string
+ */
+ public function getTriUid()
+ {
+
+ return $this->tri_uid;
+ }
+
+ /**
+ * Get the [evn_posx] column value.
+ *
+ * @return int
+ */
+ public function getEvnPosx()
+ {
+
+ return $this->evn_posx;
+ }
+
+ /**
+ * Get the [evn_posy] column value.
+ *
+ * @return int
+ */
+ public function getEvnPosy()
+ {
+
+ return $this->evn_posy;
+ }
+
+ /**
+ * Get the [evn_type] column value.
+ *
+ * @return string
+ */
+ public function getEvnType()
+ {
+
+ return $this->evn_type;
+ }
+
+ /**
+ * Get the [tas_evn_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasEvnUid()
+ {
+
+ return $this->tas_evn_uid;
+ }
+
+ /**
+ * Set the value of [evn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_uid !== $v || $v === '') {
+ $this->evn_uid = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_UID;
+ }
+
+ } // setEvnUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = EventPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [evn_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_status !== $v || $v === 'OPEN') {
+ $this->evn_status = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_STATUS;
+ }
+
+ } // setEvnStatus()
+
+ /**
+ * Set the value of [evn_when_occurs] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnWhenOccurs($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_when_occurs !== $v || $v === 'SINGLE') {
+ $this->evn_when_occurs = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_WHEN_OCCURS;
+ }
+
+ } // setEvnWhenOccurs()
+
+ /**
+ * Set the value of [evn_related_to] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnRelatedTo($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_related_to !== $v || $v === 'SINGLE') {
+ $this->evn_related_to = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_RELATED_TO;
+ }
+
+ } // setEvnRelatedTo()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = EventPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [evn_tas_uid_from] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnTasUidFrom($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_tas_uid_from !== $v || $v === '') {
+ $this->evn_tas_uid_from = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_TAS_UID_FROM;
+ }
+
+ } // setEvnTasUidFrom()
+
+ /**
+ * Set the value of [evn_tas_uid_to] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnTasUidTo($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_tas_uid_to !== $v || $v === '') {
+ $this->evn_tas_uid_to = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_TAS_UID_TO;
+ }
+
+ } // setEvnTasUidTo()
+
+ /**
+ * Set the value of [evn_tas_estimated_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setEvnTasEstimatedDuration($v)
+ {
+
+ if ($this->evn_tas_estimated_duration !== $v || $v === 0) {
+ $this->evn_tas_estimated_duration = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_TAS_ESTIMATED_DURATION;
+ }
+
+ } // setEvnTasEstimatedDuration()
+
+ /**
+ * Set the value of [evn_time_unit] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnTimeUnit($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_time_unit !== $v || $v === 'DAYS') {
+ $this->evn_time_unit = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_TIME_UNIT;
+ }
+
+ } // setEvnTimeUnit()
+
+ /**
+ * Set the value of [evn_when] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setEvnWhen($v)
+ {
+
+ if ($this->evn_when !== $v || $v === 0) {
+ $this->evn_when = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_WHEN;
+ }
+
+ } // setEvnWhen()
+
+ /**
+ * Set the value of [evn_max_attempts] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setEvnMaxAttempts($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->evn_max_attempts !== $v || $v === 3) {
+ $this->evn_max_attempts = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_MAX_ATTEMPTS;
+ }
+
+ } // setEvnMaxAttempts()
+
+ /**
+ * Set the value of [evn_action] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnAction($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_action !== $v || $v === '') {
+ $this->evn_action = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_ACTION;
+ }
+
+ } // setEvnAction()
+
+ /**
+ * Set the value of [evn_conditions] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnConditions($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_conditions !== $v) {
+ $this->evn_conditions = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_CONDITIONS;
+ }
+
+ } // setEvnConditions()
+
+ /**
+ * Set the value of [evn_action_parameters] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnActionParameters($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_action_parameters !== $v) {
+ $this->evn_action_parameters = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_ACTION_PARAMETERS;
+ }
+
+ } // setEvnActionParameters()
+
+ /**
+ * Set the value of [tri_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTriUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tri_uid !== $v || $v === '') {
+ $this->tri_uid = $v;
+ $this->modifiedColumns[] = EventPeer::TRI_UID;
+ }
+
+ } // setTriUid()
+
+ /**
+ * Set the value of [evn_posx] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setEvnPosx($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->evn_posx !== $v || $v === 0) {
+ $this->evn_posx = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_POSX;
+ }
+
+ } // setEvnPosx()
+
+ /**
+ * Set the value of [evn_posy] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setEvnPosy($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->evn_posy !== $v || $v === 0) {
+ $this->evn_posy = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_POSY;
+ }
+
+ } // setEvnPosy()
+
+ /**
+ * Set the value of [evn_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setEvnType($v)
+ {
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->evn_type !== $v || $v === '') {
+ $this->evn_type = $v;
+ $this->modifiedColumns[] = EventPeer::EVN_TYPE;
+ }
+
+ } // setEvnType()
+
+ /**
+ * Set the value of [tas_evn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasEvnUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_evn_uid !== $v || $v === '') {
+ $this->tas_evn_uid = $v;
+ $this->modifiedColumns[] = EventPeer::TAS_EVN_UID;
+ }
+
+ } // setTasEvnUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->evn_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->evn_status = $rs->getString($startcol + 2);
+
+ $this->evn_when_occurs = $rs->getString($startcol + 3);
+
+ $this->evn_related_to = $rs->getString($startcol + 4);
+
+ $this->tas_uid = $rs->getString($startcol + 5);
+
+ $this->evn_tas_uid_from = $rs->getString($startcol + 6);
+
+ $this->evn_tas_uid_to = $rs->getString($startcol + 7);
+
+ $this->evn_tas_estimated_duration = $rs->getFloat($startcol + 8);
+
+ $this->evn_time_unit = $rs->getString($startcol + 9);
+
+ $this->evn_when = $rs->getFloat($startcol + 10);
+
+ $this->evn_max_attempts = $rs->getInt($startcol + 11);
+
+ $this->evn_action = $rs->getString($startcol + 12);
+
+ $this->evn_conditions = $rs->getString($startcol + 13);
+
+ $this->evn_action_parameters = $rs->getString($startcol + 14);
+
+ $this->tri_uid = $rs->getString($startcol + 15);
+
+ $this->evn_posx = $rs->getInt($startcol + 16);
+
+ $this->evn_posy = $rs->getInt($startcol + 17);
+
+ $this->evn_type = $rs->getString($startcol + 18);
+
+ $this->tas_evn_uid = $rs->getString($startcol + 19);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 20; // 20 = EventPeer::NUM_COLUMNS - EventPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Event object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(EventPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ EventPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(EventPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = EventPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += EventPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = EventPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getEvnUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getEvnStatus();
+ break;
+ case 3:
+ return $this->getEvnWhenOccurs();
+ break;
+ case 4:
+ return $this->getEvnRelatedTo();
+ break;
+ case 5:
+ return $this->getTasUid();
+ break;
+ case 6:
+ return $this->getEvnTasUidFrom();
+ break;
+ case 7:
+ return $this->getEvnTasUidTo();
+ break;
+ case 8:
+ return $this->getEvnTasEstimatedDuration();
+ break;
+ case 9:
+ return $this->getEvnTimeUnit();
+ break;
+ case 10:
+ return $this->getEvnWhen();
+ break;
+ case 11:
+ return $this->getEvnMaxAttempts();
+ break;
+ case 12:
+ return $this->getEvnAction();
+ break;
+ case 13:
+ return $this->getEvnConditions();
+ break;
+ case 14:
+ return $this->getEvnActionParameters();
+ break;
+ case 15:
+ return $this->getTriUid();
+ break;
+ case 16:
+ return $this->getEvnPosx();
+ break;
+ case 17:
+ return $this->getEvnPosy();
+ break;
+ case 18:
+ return $this->getEvnType();
+ break;
+ case 19:
+ return $this->getTasEvnUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = EventPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getEvnUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getEvnStatus(),
+ $keys[3] => $this->getEvnWhenOccurs(),
+ $keys[4] => $this->getEvnRelatedTo(),
+ $keys[5] => $this->getTasUid(),
+ $keys[6] => $this->getEvnTasUidFrom(),
+ $keys[7] => $this->getEvnTasUidTo(),
+ $keys[8] => $this->getEvnTasEstimatedDuration(),
+ $keys[9] => $this->getEvnTimeUnit(),
+ $keys[10] => $this->getEvnWhen(),
+ $keys[11] => $this->getEvnMaxAttempts(),
+ $keys[12] => $this->getEvnAction(),
+ $keys[13] => $this->getEvnConditions(),
+ $keys[14] => $this->getEvnActionParameters(),
+ $keys[15] => $this->getTriUid(),
+ $keys[16] => $this->getEvnPosx(),
+ $keys[17] => $this->getEvnPosy(),
+ $keys[18] => $this->getEvnType(),
+ $keys[19] => $this->getTasEvnUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setEvnUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setEvnStatus($value);
+ break;
+ case 3:
+ $this->setEvnWhenOccurs($value);
+ break;
+ case 4:
+ $this->setEvnRelatedTo($value);
+ break;
+ case 5:
+ $this->setTasUid($value);
+ break;
+ case 6:
+ $this->setEvnTasUidFrom($value);
+ break;
+ case 7:
+ $this->setEvnTasUidTo($value);
+ break;
+ case 8:
+ $this->setEvnTasEstimatedDuration($value);
+ break;
+ case 9:
+ $this->setEvnTimeUnit($value);
+ break;
+ case 10:
+ $this->setEvnWhen($value);
+ break;
+ case 11:
+ $this->setEvnMaxAttempts($value);
+ break;
+ case 12:
+ $this->setEvnAction($value);
+ break;
+ case 13:
+ $this->setEvnConditions($value);
+ break;
+ case 14:
+ $this->setEvnActionParameters($value);
+ break;
+ case 15:
+ $this->setTriUid($value);
+ break;
+ case 16:
+ $this->setEvnPosx($value);
+ break;
+ case 17:
+ $this->setEvnPosy($value);
+ break;
+ case 18:
+ $this->setEvnType($value);
+ break;
+ case 19:
+ $this->setTasEvnUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = EventPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setEvnUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setEvnStatus($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setEvnWhenOccurs($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setEvnRelatedTo($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setTasUid($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setEvnTasUidFrom($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setEvnTasUidTo($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setEvnTasEstimatedDuration($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setEvnTimeUnit($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setEvnWhen($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setEvnMaxAttempts($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setEvnAction($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setEvnConditions($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setEvnActionParameters($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setTriUid($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setEvnPosx($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setEvnPosy($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setEvnType($arr[$keys[18]]);
+ }
+
+ if (array_key_exists($keys[19], $arr)) {
+ $this->setTasEvnUid($arr[$keys[19]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(EventPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(EventPeer::EVN_UID)) {
+ $criteria->add(EventPeer::EVN_UID, $this->evn_uid);
+ }
+
+ if ($this->isColumnModified(EventPeer::PRO_UID)) {
+ $criteria->add(EventPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_STATUS)) {
+ $criteria->add(EventPeer::EVN_STATUS, $this->evn_status);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_WHEN_OCCURS)) {
+ $criteria->add(EventPeer::EVN_WHEN_OCCURS, $this->evn_when_occurs);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_RELATED_TO)) {
+ $criteria->add(EventPeer::EVN_RELATED_TO, $this->evn_related_to);
+ }
+
+ if ($this->isColumnModified(EventPeer::TAS_UID)) {
+ $criteria->add(EventPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_TAS_UID_FROM)) {
+ $criteria->add(EventPeer::EVN_TAS_UID_FROM, $this->evn_tas_uid_from);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_TAS_UID_TO)) {
+ $criteria->add(EventPeer::EVN_TAS_UID_TO, $this->evn_tas_uid_to);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_TAS_ESTIMATED_DURATION)) {
+ $criteria->add(EventPeer::EVN_TAS_ESTIMATED_DURATION, $this->evn_tas_estimated_duration);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_TIME_UNIT)) {
+ $criteria->add(EventPeer::EVN_TIME_UNIT, $this->evn_time_unit);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_WHEN)) {
+ $criteria->add(EventPeer::EVN_WHEN, $this->evn_when);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_MAX_ATTEMPTS)) {
+ $criteria->add(EventPeer::EVN_MAX_ATTEMPTS, $this->evn_max_attempts);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_ACTION)) {
+ $criteria->add(EventPeer::EVN_ACTION, $this->evn_action);
+ }
+
+ if ($this->isColumnModified(EventPeer::EVN_CONDITIONS)) {
+ $criteria->add(EventPeer::EVN_CONDITIONS, $this->evn_conditions);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var EventPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(EventPeer::EVN_ACTION_PARAMETERS)) {
+ $criteria->add(EventPeer::EVN_ACTION_PARAMETERS, $this->evn_action_parameters);
+ }
+ if ($this->isColumnModified(EventPeer::TRI_UID)) {
+ $criteria->add(EventPeer::TRI_UID, $this->tri_uid);
+ }
- /**
- * The value for the evn_uid field.
- * @var string
- */
- protected $evn_uid = '';
+ if ($this->isColumnModified(EventPeer::EVN_POSX)) {
+ $criteria->add(EventPeer::EVN_POSX, $this->evn_posx);
+ }
+ if ($this->isColumnModified(EventPeer::EVN_POSY)) {
+ $criteria->add(EventPeer::EVN_POSY, $this->evn_posy);
+ }
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ if ($this->isColumnModified(EventPeer::EVN_TYPE)) {
+ $criteria->add(EventPeer::EVN_TYPE, $this->evn_type);
+ }
+ if ($this->isColumnModified(EventPeer::TAS_EVN_UID)) {
+ $criteria->add(EventPeer::TAS_EVN_UID, $this->tas_evn_uid);
+ }
- /**
- * The value for the evn_status field.
- * @var string
- */
- protected $evn_status = 'OPEN';
+ return $criteria;
+ }
- /**
- * The value for the evn_when_occurs field.
- * @var string
- */
- protected $evn_when_occurs = 'SINGLE';
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(EventPeer::DATABASE_NAME);
+ $criteria->add(EventPeer::EVN_UID, $this->evn_uid);
- /**
- * The value for the evn_related_to field.
- * @var string
- */
- protected $evn_related_to = 'SINGLE';
+ return $criteria;
+ }
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getEvnUid();
+ }
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
+ /**
+ * Generic method to set the primary key (evn_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setEvnUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Event (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+ $copyObj->setEvnStatus($this->evn_status);
+
+ $copyObj->setEvnWhenOccurs($this->evn_when_occurs);
- /**
- * The value for the evn_tas_uid_from field.
- * @var string
- */
- protected $evn_tas_uid_from = '';
+ $copyObj->setEvnRelatedTo($this->evn_related_to);
+
+ $copyObj->setTasUid($this->tas_uid);
+ $copyObj->setEvnTasUidFrom($this->evn_tas_uid_from);
+
+ $copyObj->setEvnTasUidTo($this->evn_tas_uid_to);
- /**
- * The value for the evn_tas_uid_to field.
- * @var string
- */
- protected $evn_tas_uid_to = '';
+ $copyObj->setEvnTasEstimatedDuration($this->evn_tas_estimated_duration);
+
+ $copyObj->setEvnTimeUnit($this->evn_time_unit);
+ $copyObj->setEvnWhen($this->evn_when);
+
+ $copyObj->setEvnMaxAttempts($this->evn_max_attempts);
- /**
- * The value for the evn_tas_estimated_duration field.
- * @var double
- */
- protected $evn_tas_estimated_duration = 0;
+ $copyObj->setEvnAction($this->evn_action);
+
+ $copyObj->setEvnConditions($this->evn_conditions);
+ $copyObj->setEvnActionParameters($this->evn_action_parameters);
+
+ $copyObj->setTriUid($this->tri_uid);
- /**
- * The value for the evn_time_unit field.
- * @var string
- */
- protected $evn_time_unit = 'DAYS';
+ $copyObj->setEvnPosx($this->evn_posx);
+
+ $copyObj->setEvnPosy($this->evn_posy);
+ $copyObj->setEvnType($this->evn_type);
+
+ $copyObj->setTasEvnUid($this->tas_evn_uid);
- /**
- * The value for the evn_when field.
- * @var double
- */
- protected $evn_when = 0;
+ $copyObj->setNew(true);
+
+ $copyObj->setEvnUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Event Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return EventPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new EventPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The value for the evn_max_attempts field.
- * @var int
- */
- protected $evn_max_attempts = 3;
-
-
- /**
- * The value for the evn_action field.
- * @var string
- */
- protected $evn_action = '';
-
-
- /**
- * The value for the evn_conditions field.
- * @var string
- */
- protected $evn_conditions;
-
-
- /**
- * The value for the evn_action_parameters field.
- * @var string
- */
- protected $evn_action_parameters;
-
-
- /**
- * The value for the tri_uid field.
- * @var string
- */
- protected $tri_uid = '';
-
-
- /**
- * The value for the evn_posx field.
- * @var int
- */
- protected $evn_posx = 0;
-
-
- /**
- * The value for the evn_posy field.
- * @var int
- */
- protected $evn_posy = 0;
-
-
- /**
- * The value for the evn_type field.
- * @var string
- */
- protected $evn_type = '';
-
-
- /**
- * The value for the tas_evn_uid field.
- * @var string
- */
- protected $tas_evn_uid = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [evn_uid] column value.
- *
- * @return string
- */
- public function getEvnUid()
- {
-
- return $this->evn_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [evn_status] column value.
- *
- * @return string
- */
- public function getEvnStatus()
- {
-
- return $this->evn_status;
- }
-
- /**
- * Get the [evn_when_occurs] column value.
- *
- * @return string
- */
- public function getEvnWhenOccurs()
- {
-
- return $this->evn_when_occurs;
- }
-
- /**
- * Get the [evn_related_to] column value.
- *
- * @return string
- */
- public function getEvnRelatedTo()
- {
-
- return $this->evn_related_to;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [evn_tas_uid_from] column value.
- *
- * @return string
- */
- public function getEvnTasUidFrom()
- {
-
- return $this->evn_tas_uid_from;
- }
-
- /**
- * Get the [evn_tas_uid_to] column value.
- *
- * @return string
- */
- public function getEvnTasUidTo()
- {
-
- return $this->evn_tas_uid_to;
- }
-
- /**
- * Get the [evn_tas_estimated_duration] column value.
- *
- * @return double
- */
- public function getEvnTasEstimatedDuration()
- {
-
- return $this->evn_tas_estimated_duration;
- }
-
- /**
- * Get the [evn_time_unit] column value.
- *
- * @return string
- */
- public function getEvnTimeUnit()
- {
-
- return $this->evn_time_unit;
- }
-
- /**
- * Get the [evn_when] column value.
- *
- * @return double
- */
- public function getEvnWhen()
- {
-
- return $this->evn_when;
- }
-
- /**
- * Get the [evn_max_attempts] column value.
- *
- * @return int
- */
- public function getEvnMaxAttempts()
- {
-
- return $this->evn_max_attempts;
- }
-
- /**
- * Get the [evn_action] column value.
- *
- * @return string
- */
- public function getEvnAction()
- {
-
- return $this->evn_action;
- }
-
- /**
- * Get the [evn_conditions] column value.
- *
- * @return string
- */
- public function getEvnConditions()
- {
-
- return $this->evn_conditions;
- }
-
- /**
- * Get the [evn_action_parameters] column value.
- *
- * @return string
- */
- public function getEvnActionParameters()
- {
-
- return $this->evn_action_parameters;
- }
-
- /**
- * Get the [tri_uid] column value.
- *
- * @return string
- */
- public function getTriUid()
- {
-
- return $this->tri_uid;
- }
-
- /**
- * Get the [evn_posx] column value.
- *
- * @return int
- */
- public function getEvnPosx()
- {
-
- return $this->evn_posx;
- }
-
- /**
- * Get the [evn_posy] column value.
- *
- * @return int
- */
- public function getEvnPosy()
- {
-
- return $this->evn_posy;
- }
-
- /**
- * Get the [evn_type] column value.
- *
- * @return string
- */
- public function getEvnType()
- {
-
- return $this->evn_type;
- }
-
- /**
- * Get the [tas_evn_uid] column value.
- *
- * @return string
- */
- public function getTasEvnUid()
- {
-
- return $this->tas_evn_uid;
- }
-
- /**
- * Set the value of [evn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_uid !== $v || $v === '') {
- $this->evn_uid = $v;
- $this->modifiedColumns[] = EventPeer::EVN_UID;
- }
-
- } // setEvnUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = EventPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [evn_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_status !== $v || $v === 'OPEN') {
- $this->evn_status = $v;
- $this->modifiedColumns[] = EventPeer::EVN_STATUS;
- }
-
- } // setEvnStatus()
-
- /**
- * Set the value of [evn_when_occurs] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnWhenOccurs($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_when_occurs !== $v || $v === 'SINGLE') {
- $this->evn_when_occurs = $v;
- $this->modifiedColumns[] = EventPeer::EVN_WHEN_OCCURS;
- }
-
- } // setEvnWhenOccurs()
-
- /**
- * Set the value of [evn_related_to] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnRelatedTo($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_related_to !== $v || $v === 'SINGLE') {
- $this->evn_related_to = $v;
- $this->modifiedColumns[] = EventPeer::EVN_RELATED_TO;
- }
-
- } // setEvnRelatedTo()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = EventPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [evn_tas_uid_from] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnTasUidFrom($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_tas_uid_from !== $v || $v === '') {
- $this->evn_tas_uid_from = $v;
- $this->modifiedColumns[] = EventPeer::EVN_TAS_UID_FROM;
- }
-
- } // setEvnTasUidFrom()
-
- /**
- * Set the value of [evn_tas_uid_to] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnTasUidTo($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_tas_uid_to !== $v || $v === '') {
- $this->evn_tas_uid_to = $v;
- $this->modifiedColumns[] = EventPeer::EVN_TAS_UID_TO;
- }
-
- } // setEvnTasUidTo()
-
- /**
- * Set the value of [evn_tas_estimated_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setEvnTasEstimatedDuration($v)
- {
-
- if ($this->evn_tas_estimated_duration !== $v || $v === 0) {
- $this->evn_tas_estimated_duration = $v;
- $this->modifiedColumns[] = EventPeer::EVN_TAS_ESTIMATED_DURATION;
- }
-
- } // setEvnTasEstimatedDuration()
-
- /**
- * Set the value of [evn_time_unit] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnTimeUnit($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_time_unit !== $v || $v === 'DAYS') {
- $this->evn_time_unit = $v;
- $this->modifiedColumns[] = EventPeer::EVN_TIME_UNIT;
- }
-
- } // setEvnTimeUnit()
-
- /**
- * Set the value of [evn_when] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setEvnWhen($v)
- {
-
- if ($this->evn_when !== $v || $v === 0) {
- $this->evn_when = $v;
- $this->modifiedColumns[] = EventPeer::EVN_WHEN;
- }
-
- } // setEvnWhen()
-
- /**
- * Set the value of [evn_max_attempts] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setEvnMaxAttempts($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->evn_max_attempts !== $v || $v === 3) {
- $this->evn_max_attempts = $v;
- $this->modifiedColumns[] = EventPeer::EVN_MAX_ATTEMPTS;
- }
-
- } // setEvnMaxAttempts()
-
- /**
- * Set the value of [evn_action] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnAction($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_action !== $v || $v === '') {
- $this->evn_action = $v;
- $this->modifiedColumns[] = EventPeer::EVN_ACTION;
- }
-
- } // setEvnAction()
-
- /**
- * Set the value of [evn_conditions] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnConditions($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_conditions !== $v) {
- $this->evn_conditions = $v;
- $this->modifiedColumns[] = EventPeer::EVN_CONDITIONS;
- }
-
- } // setEvnConditions()
-
- /**
- * Set the value of [evn_action_parameters] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnActionParameters($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_action_parameters !== $v) {
- $this->evn_action_parameters = $v;
- $this->modifiedColumns[] = EventPeer::EVN_ACTION_PARAMETERS;
- }
-
- } // setEvnActionParameters()
-
- /**
- * Set the value of [tri_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTriUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tri_uid !== $v || $v === '') {
- $this->tri_uid = $v;
- $this->modifiedColumns[] = EventPeer::TRI_UID;
- }
-
- } // setTriUid()
-
- /**
- * Set the value of [evn_posx] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setEvnPosx($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->evn_posx !== $v || $v === 0) {
- $this->evn_posx = $v;
- $this->modifiedColumns[] = EventPeer::EVN_POSX;
- }
-
- } // setEvnPosx()
-
- /**
- * Set the value of [evn_posy] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setEvnPosy($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->evn_posy !== $v || $v === 0) {
- $this->evn_posy = $v;
- $this->modifiedColumns[] = EventPeer::EVN_POSY;
- }
-
- } // setEvnPosy()
-
- /**
- * Set the value of [evn_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setEvnType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->evn_type !== $v || $v === '') {
- $this->evn_type = $v;
- $this->modifiedColumns[] = EventPeer::EVN_TYPE;
- }
-
- } // setEvnType()
-
- /**
- * Set the value of [tas_evn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasEvnUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_evn_uid !== $v || $v === '') {
- $this->tas_evn_uid = $v;
- $this->modifiedColumns[] = EventPeer::TAS_EVN_UID;
- }
-
- } // setTasEvnUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->evn_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->evn_status = $rs->getString($startcol + 2);
-
- $this->evn_when_occurs = $rs->getString($startcol + 3);
-
- $this->evn_related_to = $rs->getString($startcol + 4);
-
- $this->tas_uid = $rs->getString($startcol + 5);
-
- $this->evn_tas_uid_from = $rs->getString($startcol + 6);
-
- $this->evn_tas_uid_to = $rs->getString($startcol + 7);
-
- $this->evn_tas_estimated_duration = $rs->getFloat($startcol + 8);
-
- $this->evn_time_unit = $rs->getString($startcol + 9);
-
- $this->evn_when = $rs->getFloat($startcol + 10);
-
- $this->evn_max_attempts = $rs->getInt($startcol + 11);
-
- $this->evn_action = $rs->getString($startcol + 12);
-
- $this->evn_conditions = $rs->getString($startcol + 13);
-
- $this->evn_action_parameters = $rs->getString($startcol + 14);
-
- $this->tri_uid = $rs->getString($startcol + 15);
-
- $this->evn_posx = $rs->getInt($startcol + 16);
-
- $this->evn_posy = $rs->getInt($startcol + 17);
-
- $this->evn_type = $rs->getString($startcol + 18);
-
- $this->tas_evn_uid = $rs->getString($startcol + 19);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 20; // 20 = EventPeer::NUM_COLUMNS - EventPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Event object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(EventPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- EventPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(EventPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = EventPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += EventPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = EventPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getEvnUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getEvnStatus();
- break;
- case 3:
- return $this->getEvnWhenOccurs();
- break;
- case 4:
- return $this->getEvnRelatedTo();
- break;
- case 5:
- return $this->getTasUid();
- break;
- case 6:
- return $this->getEvnTasUidFrom();
- break;
- case 7:
- return $this->getEvnTasUidTo();
- break;
- case 8:
- return $this->getEvnTasEstimatedDuration();
- break;
- case 9:
- return $this->getEvnTimeUnit();
- break;
- case 10:
- return $this->getEvnWhen();
- break;
- case 11:
- return $this->getEvnMaxAttempts();
- break;
- case 12:
- return $this->getEvnAction();
- break;
- case 13:
- return $this->getEvnConditions();
- break;
- case 14:
- return $this->getEvnActionParameters();
- break;
- case 15:
- return $this->getTriUid();
- break;
- case 16:
- return $this->getEvnPosx();
- break;
- case 17:
- return $this->getEvnPosy();
- break;
- case 18:
- return $this->getEvnType();
- break;
- case 19:
- return $this->getTasEvnUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = EventPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getEvnUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getEvnStatus(),
- $keys[3] => $this->getEvnWhenOccurs(),
- $keys[4] => $this->getEvnRelatedTo(),
- $keys[5] => $this->getTasUid(),
- $keys[6] => $this->getEvnTasUidFrom(),
- $keys[7] => $this->getEvnTasUidTo(),
- $keys[8] => $this->getEvnTasEstimatedDuration(),
- $keys[9] => $this->getEvnTimeUnit(),
- $keys[10] => $this->getEvnWhen(),
- $keys[11] => $this->getEvnMaxAttempts(),
- $keys[12] => $this->getEvnAction(),
- $keys[13] => $this->getEvnConditions(),
- $keys[14] => $this->getEvnActionParameters(),
- $keys[15] => $this->getTriUid(),
- $keys[16] => $this->getEvnPosx(),
- $keys[17] => $this->getEvnPosy(),
- $keys[18] => $this->getEvnType(),
- $keys[19] => $this->getTasEvnUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setEvnUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setEvnStatus($value);
- break;
- case 3:
- $this->setEvnWhenOccurs($value);
- break;
- case 4:
- $this->setEvnRelatedTo($value);
- break;
- case 5:
- $this->setTasUid($value);
- break;
- case 6:
- $this->setEvnTasUidFrom($value);
- break;
- case 7:
- $this->setEvnTasUidTo($value);
- break;
- case 8:
- $this->setEvnTasEstimatedDuration($value);
- break;
- case 9:
- $this->setEvnTimeUnit($value);
- break;
- case 10:
- $this->setEvnWhen($value);
- break;
- case 11:
- $this->setEvnMaxAttempts($value);
- break;
- case 12:
- $this->setEvnAction($value);
- break;
- case 13:
- $this->setEvnConditions($value);
- break;
- case 14:
- $this->setEvnActionParameters($value);
- break;
- case 15:
- $this->setTriUid($value);
- break;
- case 16:
- $this->setEvnPosx($value);
- break;
- case 17:
- $this->setEvnPosy($value);
- break;
- case 18:
- $this->setEvnType($value);
- break;
- case 19:
- $this->setTasEvnUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = EventPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setEvnUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setEvnStatus($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setEvnWhenOccurs($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setEvnRelatedTo($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setTasUid($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setEvnTasUidFrom($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setEvnTasUidTo($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setEvnTasEstimatedDuration($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setEvnTimeUnit($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setEvnWhen($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setEvnMaxAttempts($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setEvnAction($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setEvnConditions($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setEvnActionParameters($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setTriUid($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setEvnPosx($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setEvnPosy($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setEvnType($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setTasEvnUid($arr[$keys[19]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(EventPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(EventPeer::EVN_UID)) $criteria->add(EventPeer::EVN_UID, $this->evn_uid);
- if ($this->isColumnModified(EventPeer::PRO_UID)) $criteria->add(EventPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(EventPeer::EVN_STATUS)) $criteria->add(EventPeer::EVN_STATUS, $this->evn_status);
- if ($this->isColumnModified(EventPeer::EVN_WHEN_OCCURS)) $criteria->add(EventPeer::EVN_WHEN_OCCURS, $this->evn_when_occurs);
- if ($this->isColumnModified(EventPeer::EVN_RELATED_TO)) $criteria->add(EventPeer::EVN_RELATED_TO, $this->evn_related_to);
- if ($this->isColumnModified(EventPeer::TAS_UID)) $criteria->add(EventPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(EventPeer::EVN_TAS_UID_FROM)) $criteria->add(EventPeer::EVN_TAS_UID_FROM, $this->evn_tas_uid_from);
- if ($this->isColumnModified(EventPeer::EVN_TAS_UID_TO)) $criteria->add(EventPeer::EVN_TAS_UID_TO, $this->evn_tas_uid_to);
- if ($this->isColumnModified(EventPeer::EVN_TAS_ESTIMATED_DURATION)) $criteria->add(EventPeer::EVN_TAS_ESTIMATED_DURATION, $this->evn_tas_estimated_duration);
- if ($this->isColumnModified(EventPeer::EVN_TIME_UNIT)) $criteria->add(EventPeer::EVN_TIME_UNIT, $this->evn_time_unit);
- if ($this->isColumnModified(EventPeer::EVN_WHEN)) $criteria->add(EventPeer::EVN_WHEN, $this->evn_when);
- if ($this->isColumnModified(EventPeer::EVN_MAX_ATTEMPTS)) $criteria->add(EventPeer::EVN_MAX_ATTEMPTS, $this->evn_max_attempts);
- if ($this->isColumnModified(EventPeer::EVN_ACTION)) $criteria->add(EventPeer::EVN_ACTION, $this->evn_action);
- if ($this->isColumnModified(EventPeer::EVN_CONDITIONS)) $criteria->add(EventPeer::EVN_CONDITIONS, $this->evn_conditions);
- if ($this->isColumnModified(EventPeer::EVN_ACTION_PARAMETERS)) $criteria->add(EventPeer::EVN_ACTION_PARAMETERS, $this->evn_action_parameters);
- if ($this->isColumnModified(EventPeer::TRI_UID)) $criteria->add(EventPeer::TRI_UID, $this->tri_uid);
- if ($this->isColumnModified(EventPeer::EVN_POSX)) $criteria->add(EventPeer::EVN_POSX, $this->evn_posx);
- if ($this->isColumnModified(EventPeer::EVN_POSY)) $criteria->add(EventPeer::EVN_POSY, $this->evn_posy);
- if ($this->isColumnModified(EventPeer::EVN_TYPE)) $criteria->add(EventPeer::EVN_TYPE, $this->evn_type);
- if ($this->isColumnModified(EventPeer::TAS_EVN_UID)) $criteria->add(EventPeer::TAS_EVN_UID, $this->tas_evn_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(EventPeer::DATABASE_NAME);
-
- $criteria->add(EventPeer::EVN_UID, $this->evn_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getEvnUid();
- }
-
- /**
- * Generic method to set the primary key (evn_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setEvnUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Event (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setEvnStatus($this->evn_status);
-
- $copyObj->setEvnWhenOccurs($this->evn_when_occurs);
-
- $copyObj->setEvnRelatedTo($this->evn_related_to);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setEvnTasUidFrom($this->evn_tas_uid_from);
-
- $copyObj->setEvnTasUidTo($this->evn_tas_uid_to);
-
- $copyObj->setEvnTasEstimatedDuration($this->evn_tas_estimated_duration);
-
- $copyObj->setEvnTimeUnit($this->evn_time_unit);
-
- $copyObj->setEvnWhen($this->evn_when);
-
- $copyObj->setEvnMaxAttempts($this->evn_max_attempts);
-
- $copyObj->setEvnAction($this->evn_action);
-
- $copyObj->setEvnConditions($this->evn_conditions);
-
- $copyObj->setEvnActionParameters($this->evn_action_parameters);
-
- $copyObj->setTriUid($this->tri_uid);
-
- $copyObj->setEvnPosx($this->evn_posx);
-
- $copyObj->setEvnPosy($this->evn_posy);
-
- $copyObj->setEvnType($this->evn_type);
-
- $copyObj->setTasEvnUid($this->tas_evn_uid);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setEvnUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Event Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return EventPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new EventPeer();
- }
- return self::$peer;
- }
-
-} // BaseEvent
diff --git a/workflow/engine/classes/model/om/BaseEventPeer.php b/workflow/engine/classes/model/om/BaseEventPeer.php
index 0d828db5d..1716483e0 100755
--- a/workflow/engine/classes/model/om/BaseEventPeer.php
+++ b/workflow/engine/classes/model/om/BaseEventPeer.php
@@ -12,649 +12,651 @@ include_once 'classes/model/Event.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseEventPeer {
+abstract class BaseEventPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'EVENT';
+ /** the table name for this class */
+ const TABLE_NAME = 'EVENT';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Event';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Event';
- /** The total number of columns. */
- const NUM_COLUMNS = 20;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 20;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the EVN_UID field */
- const EVN_UID = 'EVENT.EVN_UID';
+ /** the column name for the EVN_UID field */
+ const EVN_UID = 'EVENT.EVN_UID';
- /** the column name for the PRO_UID field */
- const PRO_UID = 'EVENT.PRO_UID';
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'EVENT.PRO_UID';
- /** the column name for the EVN_STATUS field */
- const EVN_STATUS = 'EVENT.EVN_STATUS';
+ /** the column name for the EVN_STATUS field */
+ const EVN_STATUS = 'EVENT.EVN_STATUS';
+
+ /** the column name for the EVN_WHEN_OCCURS field */
+ const EVN_WHEN_OCCURS = 'EVENT.EVN_WHEN_OCCURS';
+
+ /** the column name for the EVN_RELATED_TO field */
+ const EVN_RELATED_TO = 'EVENT.EVN_RELATED_TO';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'EVENT.TAS_UID';
+
+ /** the column name for the EVN_TAS_UID_FROM field */
+ const EVN_TAS_UID_FROM = 'EVENT.EVN_TAS_UID_FROM';
+
+ /** the column name for the EVN_TAS_UID_TO field */
+ const EVN_TAS_UID_TO = 'EVENT.EVN_TAS_UID_TO';
+
+ /** the column name for the EVN_TAS_ESTIMATED_DURATION field */
+ const EVN_TAS_ESTIMATED_DURATION = 'EVENT.EVN_TAS_ESTIMATED_DURATION';
+
+ /** the column name for the EVN_TIME_UNIT field */
+ const EVN_TIME_UNIT = 'EVENT.EVN_TIME_UNIT';
+
+ /** the column name for the EVN_WHEN field */
+ const EVN_WHEN = 'EVENT.EVN_WHEN';
+
+ /** the column name for the EVN_MAX_ATTEMPTS field */
+ const EVN_MAX_ATTEMPTS = 'EVENT.EVN_MAX_ATTEMPTS';
+
+ /** the column name for the EVN_ACTION field */
+ const EVN_ACTION = 'EVENT.EVN_ACTION';
+
+ /** the column name for the EVN_CONDITIONS field */
+ const EVN_CONDITIONS = 'EVENT.EVN_CONDITIONS';
+
+ /** the column name for the EVN_ACTION_PARAMETERS field */
+ const EVN_ACTION_PARAMETERS = 'EVENT.EVN_ACTION_PARAMETERS';
+
+ /** the column name for the TRI_UID field */
+ const TRI_UID = 'EVENT.TRI_UID';
+
+ /** the column name for the EVN_POSX field */
+ const EVN_POSX = 'EVENT.EVN_POSX';
+
+ /** the column name for the EVN_POSY field */
+ const EVN_POSY = 'EVENT.EVN_POSY';
+
+ /** the column name for the EVN_TYPE field */
+ const EVN_TYPE = 'EVENT.EVN_TYPE';
+
+ /** the column name for the TAS_EVN_UID field */
+ const TAS_EVN_UID = 'EVENT.TAS_EVN_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('EvnUid', 'ProUid', 'EvnStatus', 'EvnWhenOccurs', 'EvnRelatedTo', 'TasUid', 'EvnTasUidFrom', 'EvnTasUidTo', 'EvnTasEstimatedDuration', 'EvnTimeUnit', 'EvnWhen', 'EvnMaxAttempts', 'EvnAction', 'EvnConditions', 'EvnActionParameters', 'TriUid', 'EvnPosx', 'EvnPosy', 'EvnType', 'TasEvnUid', ),
+ BasePeer::TYPE_COLNAME => array (EventPeer::EVN_UID, EventPeer::PRO_UID, EventPeer::EVN_STATUS, EventPeer::EVN_WHEN_OCCURS, EventPeer::EVN_RELATED_TO, EventPeer::TAS_UID, EventPeer::EVN_TAS_UID_FROM, EventPeer::EVN_TAS_UID_TO, EventPeer::EVN_TAS_ESTIMATED_DURATION, EventPeer::EVN_TIME_UNIT, EventPeer::EVN_WHEN, EventPeer::EVN_MAX_ATTEMPTS, EventPeer::EVN_ACTION, EventPeer::EVN_CONDITIONS, EventPeer::EVN_ACTION_PARAMETERS, EventPeer::TRI_UID, EventPeer::EVN_POSX, EventPeer::EVN_POSY, EventPeer::EVN_TYPE, EventPeer::TAS_EVN_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('EVN_UID', 'PRO_UID', 'EVN_STATUS', 'EVN_WHEN_OCCURS', 'EVN_RELATED_TO', 'TAS_UID', 'EVN_TAS_UID_FROM', 'EVN_TAS_UID_TO', 'EVN_TAS_ESTIMATED_DURATION', 'EVN_TIME_UNIT', 'EVN_WHEN', 'EVN_MAX_ATTEMPTS', 'EVN_ACTION', 'EVN_CONDITIONS', 'EVN_ACTION_PARAMETERS', 'TRI_UID', 'EVN_POSX', 'EVN_POSY', 'EVN_TYPE', 'TAS_EVN_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('EvnUid' => 0, 'ProUid' => 1, 'EvnStatus' => 2, 'EvnWhenOccurs' => 3, 'EvnRelatedTo' => 4, 'TasUid' => 5, 'EvnTasUidFrom' => 6, 'EvnTasUidTo' => 7, 'EvnTasEstimatedDuration' => 8, 'EvnTimeUnit' => 9, 'EvnWhen' => 10, 'EvnMaxAttempts' => 11, 'EvnAction' => 12, 'EvnConditions' => 13, 'EvnActionParameters' => 14, 'TriUid' => 15, 'EvnPosx' => 16, 'EvnPosy' => 17, 'EvnType' => 18, 'TasEvnUid' => 19, ),
+ BasePeer::TYPE_COLNAME => array (EventPeer::EVN_UID => 0, EventPeer::PRO_UID => 1, EventPeer::EVN_STATUS => 2, EventPeer::EVN_WHEN_OCCURS => 3, EventPeer::EVN_RELATED_TO => 4, EventPeer::TAS_UID => 5, EventPeer::EVN_TAS_UID_FROM => 6, EventPeer::EVN_TAS_UID_TO => 7, EventPeer::EVN_TAS_ESTIMATED_DURATION => 8, EventPeer::EVN_TIME_UNIT => 9, EventPeer::EVN_WHEN => 10, EventPeer::EVN_MAX_ATTEMPTS => 11, EventPeer::EVN_ACTION => 12, EventPeer::EVN_CONDITIONS => 13, EventPeer::EVN_ACTION_PARAMETERS => 14, EventPeer::TRI_UID => 15, EventPeer::EVN_POSX => 16, EventPeer::EVN_POSY => 17, EventPeer::EVN_TYPE => 18, EventPeer::TAS_EVN_UID => 19, ),
+ BasePeer::TYPE_FIELDNAME => array ('EVN_UID' => 0, 'PRO_UID' => 1, 'EVN_STATUS' => 2, 'EVN_WHEN_OCCURS' => 3, 'EVN_RELATED_TO' => 4, 'TAS_UID' => 5, 'EVN_TAS_UID_FROM' => 6, 'EVN_TAS_UID_TO' => 7, 'EVN_TAS_ESTIMATED_DURATION' => 8, 'EVN_TIME_UNIT' => 9, 'EVN_WHEN' => 10, 'EVN_MAX_ATTEMPTS' => 11, 'EVN_ACTION' => 12, 'EVN_CONDITIONS' => 13, 'EVN_ACTION_PARAMETERS' => 14, 'TRI_UID' => 15, 'EVN_POSX' => 16, 'EVN_POSY' => 17, 'EVN_TYPE' => 18, 'TAS_EVN_UID' => 19, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/EventMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.EventMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = EventPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. EventPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(EventPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(EventPeer::EVN_UID);
+
+ $criteria->addSelectColumn(EventPeer::PRO_UID);
+
+ $criteria->addSelectColumn(EventPeer::EVN_STATUS);
+
+ $criteria->addSelectColumn(EventPeer::EVN_WHEN_OCCURS);
+
+ $criteria->addSelectColumn(EventPeer::EVN_RELATED_TO);
+
+ $criteria->addSelectColumn(EventPeer::TAS_UID);
+
+ $criteria->addSelectColumn(EventPeer::EVN_TAS_UID_FROM);
+
+ $criteria->addSelectColumn(EventPeer::EVN_TAS_UID_TO);
+
+ $criteria->addSelectColumn(EventPeer::EVN_TAS_ESTIMATED_DURATION);
+
+ $criteria->addSelectColumn(EventPeer::EVN_TIME_UNIT);
+
+ $criteria->addSelectColumn(EventPeer::EVN_WHEN);
+
+ $criteria->addSelectColumn(EventPeer::EVN_MAX_ATTEMPTS);
+
+ $criteria->addSelectColumn(EventPeer::EVN_ACTION);
+
+ $criteria->addSelectColumn(EventPeer::EVN_CONDITIONS);
+
+ $criteria->addSelectColumn(EventPeer::EVN_ACTION_PARAMETERS);
+
+ $criteria->addSelectColumn(EventPeer::TRI_UID);
+
+ $criteria->addSelectColumn(EventPeer::EVN_POSX);
+
+ $criteria->addSelectColumn(EventPeer::EVN_POSY);
+
+ $criteria->addSelectColumn(EventPeer::EVN_TYPE);
+
+ $criteria->addSelectColumn(EventPeer::TAS_EVN_UID);
+
+ }
+
+ const COUNT = 'COUNT(EVENT.EVN_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT EVENT.EVN_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(EventPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(EventPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = EventPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Event
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = EventPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return EventPeer::populateObjects(EventPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ EventPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = EventPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return EventPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Event or Criteria object.
+ *
+ * @param mixed $values Criteria or Event object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Event object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Event or Criteria object.
+ *
+ * @param mixed $values Criteria or Event object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(EventPeer::EVN_UID);
+ $selectCriteria->add(EventPeer::EVN_UID, $criteria->remove(EventPeer::EVN_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the EVENT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(EventPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Event or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Event object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(EventPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Event) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(EventPeer::EVN_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Event object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Event $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Event $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(EventPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(EventPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(EventPeer::DATABASE_NAME, EventPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Event
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(EventPeer::DATABASE_NAME);
+
+ $criteria->add(EventPeer::EVN_UID, $pk);
+
+
+ $v = EventPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(EventPeer::EVN_UID, $pks, Criteria::IN);
+ $objs = EventPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** the column name for the EVN_WHEN_OCCURS field */
- const EVN_WHEN_OCCURS = 'EVENT.EVN_WHEN_OCCURS';
-
- /** the column name for the EVN_RELATED_TO field */
- const EVN_RELATED_TO = 'EVENT.EVN_RELATED_TO';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'EVENT.TAS_UID';
-
- /** the column name for the EVN_TAS_UID_FROM field */
- const EVN_TAS_UID_FROM = 'EVENT.EVN_TAS_UID_FROM';
-
- /** the column name for the EVN_TAS_UID_TO field */
- const EVN_TAS_UID_TO = 'EVENT.EVN_TAS_UID_TO';
-
- /** the column name for the EVN_TAS_ESTIMATED_DURATION field */
- const EVN_TAS_ESTIMATED_DURATION = 'EVENT.EVN_TAS_ESTIMATED_DURATION';
-
- /** the column name for the EVN_TIME_UNIT field */
- const EVN_TIME_UNIT = 'EVENT.EVN_TIME_UNIT';
-
- /** the column name for the EVN_WHEN field */
- const EVN_WHEN = 'EVENT.EVN_WHEN';
-
- /** the column name for the EVN_MAX_ATTEMPTS field */
- const EVN_MAX_ATTEMPTS = 'EVENT.EVN_MAX_ATTEMPTS';
-
- /** the column name for the EVN_ACTION field */
- const EVN_ACTION = 'EVENT.EVN_ACTION';
-
- /** the column name for the EVN_CONDITIONS field */
- const EVN_CONDITIONS = 'EVENT.EVN_CONDITIONS';
-
- /** the column name for the EVN_ACTION_PARAMETERS field */
- const EVN_ACTION_PARAMETERS = 'EVENT.EVN_ACTION_PARAMETERS';
-
- /** the column name for the TRI_UID field */
- const TRI_UID = 'EVENT.TRI_UID';
-
- /** the column name for the EVN_POSX field */
- const EVN_POSX = 'EVENT.EVN_POSX';
-
- /** the column name for the EVN_POSY field */
- const EVN_POSY = 'EVENT.EVN_POSY';
-
- /** the column name for the EVN_TYPE field */
- const EVN_TYPE = 'EVENT.EVN_TYPE';
-
- /** the column name for the TAS_EVN_UID field */
- const TAS_EVN_UID = 'EVENT.TAS_EVN_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('EvnUid', 'ProUid', 'EvnStatus', 'EvnWhenOccurs', 'EvnRelatedTo', 'TasUid', 'EvnTasUidFrom', 'EvnTasUidTo', 'EvnTasEstimatedDuration', 'EvnTimeUnit', 'EvnWhen', 'EvnMaxAttempts', 'EvnAction', 'EvnConditions', 'EvnActionParameters', 'TriUid', 'EvnPosx', 'EvnPosy', 'EvnType', 'TasEvnUid', ),
- BasePeer::TYPE_COLNAME => array (EventPeer::EVN_UID, EventPeer::PRO_UID, EventPeer::EVN_STATUS, EventPeer::EVN_WHEN_OCCURS, EventPeer::EVN_RELATED_TO, EventPeer::TAS_UID, EventPeer::EVN_TAS_UID_FROM, EventPeer::EVN_TAS_UID_TO, EventPeer::EVN_TAS_ESTIMATED_DURATION, EventPeer::EVN_TIME_UNIT, EventPeer::EVN_WHEN, EventPeer::EVN_MAX_ATTEMPTS, EventPeer::EVN_ACTION, EventPeer::EVN_CONDITIONS, EventPeer::EVN_ACTION_PARAMETERS, EventPeer::TRI_UID, EventPeer::EVN_POSX, EventPeer::EVN_POSY, EventPeer::EVN_TYPE, EventPeer::TAS_EVN_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('EVN_UID', 'PRO_UID', 'EVN_STATUS', 'EVN_WHEN_OCCURS', 'EVN_RELATED_TO', 'TAS_UID', 'EVN_TAS_UID_FROM', 'EVN_TAS_UID_TO', 'EVN_TAS_ESTIMATED_DURATION', 'EVN_TIME_UNIT', 'EVN_WHEN', 'EVN_MAX_ATTEMPTS', 'EVN_ACTION', 'EVN_CONDITIONS', 'EVN_ACTION_PARAMETERS', 'TRI_UID', 'EVN_POSX', 'EVN_POSY', 'EVN_TYPE', 'TAS_EVN_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('EvnUid' => 0, 'ProUid' => 1, 'EvnStatus' => 2, 'EvnWhenOccurs' => 3, 'EvnRelatedTo' => 4, 'TasUid' => 5, 'EvnTasUidFrom' => 6, 'EvnTasUidTo' => 7, 'EvnTasEstimatedDuration' => 8, 'EvnTimeUnit' => 9, 'EvnWhen' => 10, 'EvnMaxAttempts' => 11, 'EvnAction' => 12, 'EvnConditions' => 13, 'EvnActionParameters' => 14, 'TriUid' => 15, 'EvnPosx' => 16, 'EvnPosy' => 17, 'EvnType' => 18, 'TasEvnUid' => 19, ),
- BasePeer::TYPE_COLNAME => array (EventPeer::EVN_UID => 0, EventPeer::PRO_UID => 1, EventPeer::EVN_STATUS => 2, EventPeer::EVN_WHEN_OCCURS => 3, EventPeer::EVN_RELATED_TO => 4, EventPeer::TAS_UID => 5, EventPeer::EVN_TAS_UID_FROM => 6, EventPeer::EVN_TAS_UID_TO => 7, EventPeer::EVN_TAS_ESTIMATED_DURATION => 8, EventPeer::EVN_TIME_UNIT => 9, EventPeer::EVN_WHEN => 10, EventPeer::EVN_MAX_ATTEMPTS => 11, EventPeer::EVN_ACTION => 12, EventPeer::EVN_CONDITIONS => 13, EventPeer::EVN_ACTION_PARAMETERS => 14, EventPeer::TRI_UID => 15, EventPeer::EVN_POSX => 16, EventPeer::EVN_POSY => 17, EventPeer::EVN_TYPE => 18, EventPeer::TAS_EVN_UID => 19, ),
- BasePeer::TYPE_FIELDNAME => array ('EVN_UID' => 0, 'PRO_UID' => 1, 'EVN_STATUS' => 2, 'EVN_WHEN_OCCURS' => 3, 'EVN_RELATED_TO' => 4, 'TAS_UID' => 5, 'EVN_TAS_UID_FROM' => 6, 'EVN_TAS_UID_TO' => 7, 'EVN_TAS_ESTIMATED_DURATION' => 8, 'EVN_TIME_UNIT' => 9, 'EVN_WHEN' => 10, 'EVN_MAX_ATTEMPTS' => 11, 'EVN_ACTION' => 12, 'EVN_CONDITIONS' => 13, 'EVN_ACTION_PARAMETERS' => 14, 'TRI_UID' => 15, 'EVN_POSX' => 16, 'EVN_POSY' => 17, 'EVN_TYPE' => 18, 'TAS_EVN_UID' => 19, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/EventMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.EventMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = EventPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. EventPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(EventPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(EventPeer::EVN_UID);
-
- $criteria->addSelectColumn(EventPeer::PRO_UID);
-
- $criteria->addSelectColumn(EventPeer::EVN_STATUS);
-
- $criteria->addSelectColumn(EventPeer::EVN_WHEN_OCCURS);
-
- $criteria->addSelectColumn(EventPeer::EVN_RELATED_TO);
-
- $criteria->addSelectColumn(EventPeer::TAS_UID);
-
- $criteria->addSelectColumn(EventPeer::EVN_TAS_UID_FROM);
-
- $criteria->addSelectColumn(EventPeer::EVN_TAS_UID_TO);
-
- $criteria->addSelectColumn(EventPeer::EVN_TAS_ESTIMATED_DURATION);
-
- $criteria->addSelectColumn(EventPeer::EVN_TIME_UNIT);
-
- $criteria->addSelectColumn(EventPeer::EVN_WHEN);
-
- $criteria->addSelectColumn(EventPeer::EVN_MAX_ATTEMPTS);
-
- $criteria->addSelectColumn(EventPeer::EVN_ACTION);
-
- $criteria->addSelectColumn(EventPeer::EVN_CONDITIONS);
-
- $criteria->addSelectColumn(EventPeer::EVN_ACTION_PARAMETERS);
-
- $criteria->addSelectColumn(EventPeer::TRI_UID);
-
- $criteria->addSelectColumn(EventPeer::EVN_POSX);
-
- $criteria->addSelectColumn(EventPeer::EVN_POSY);
-
- $criteria->addSelectColumn(EventPeer::EVN_TYPE);
-
- $criteria->addSelectColumn(EventPeer::TAS_EVN_UID);
-
- }
-
- const COUNT = 'COUNT(EVENT.EVN_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT EVENT.EVN_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(EventPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(EventPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = EventPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Event
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = EventPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return EventPeer::populateObjects(EventPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- EventPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = EventPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return EventPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Event or Criteria object.
- *
- * @param mixed $values Criteria or Event object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Event object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Event or Criteria object.
- *
- * @param mixed $values Criteria or Event object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(EventPeer::EVN_UID);
- $selectCriteria->add(EventPeer::EVN_UID, $criteria->remove(EventPeer::EVN_UID), $comparison);
-
- } else { // $values is Event object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the EVENT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(EventPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Event or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Event object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(EventPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Event) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(EventPeer::EVN_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Event object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Event $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Event $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(EventPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(EventPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(EventPeer::DATABASE_NAME, EventPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Event
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(EventPeer::DATABASE_NAME);
-
- $criteria->add(EventPeer::EVN_UID, $pk);
-
-
- $v = EventPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(EventPeer::EVN_UID, $pks, Criteria::IN);
- $objs = EventPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseEventPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseEventPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseEventPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/EventMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.EventMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/EventMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.EventMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseFieldCondition.php b/workflow/engine/classes/model/om/BaseFieldCondition.php
index 1226374c5..e798de5b5 100755
--- a/workflow/engine/classes/model/om/BaseFieldCondition.php
+++ b/workflow/engine/classes/model/om/BaseFieldCondition.php
@@ -16,860 +16,901 @@ include_once 'classes/model/FieldConditionPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseFieldCondition extends BaseObject implements Persistent {
-
+abstract class BaseFieldCondition extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var FieldConditionPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the fcd_uid field.
+ * @var string
+ */
+ protected $fcd_uid = '';
+
+ /**
+ * The value for the fcd_function field.
+ * @var string
+ */
+ protected $fcd_function;
+
+ /**
+ * The value for the fcd_fields field.
+ * @var string
+ */
+ protected $fcd_fields;
+
+ /**
+ * The value for the fcd_condition field.
+ * @var string
+ */
+ protected $fcd_condition;
+
+ /**
+ * The value for the fcd_events field.
+ * @var string
+ */
+ protected $fcd_events;
+
+ /**
+ * The value for the fcd_event_owners field.
+ * @var string
+ */
+ protected $fcd_event_owners;
+
+ /**
+ * The value for the fcd_status field.
+ * @var string
+ */
+ protected $fcd_status;
+
+ /**
+ * The value for the fcd_dyn_uid field.
+ * @var string
+ */
+ protected $fcd_dyn_uid;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [fcd_uid] column value.
+ *
+ * @return string
+ */
+ public function getFcdUid()
+ {
+
+ return $this->fcd_uid;
+ }
+
+ /**
+ * Get the [fcd_function] column value.
+ *
+ * @return string
+ */
+ public function getFcdFunction()
+ {
+
+ return $this->fcd_function;
+ }
+
+ /**
+ * Get the [fcd_fields] column value.
+ *
+ * @return string
+ */
+ public function getFcdFields()
+ {
+
+ return $this->fcd_fields;
+ }
+
+ /**
+ * Get the [fcd_condition] column value.
+ *
+ * @return string
+ */
+ public function getFcdCondition()
+ {
+
+ return $this->fcd_condition;
+ }
+
+ /**
+ * Get the [fcd_events] column value.
+ *
+ * @return string
+ */
+ public function getFcdEvents()
+ {
+
+ return $this->fcd_events;
+ }
+
+ /**
+ * Get the [fcd_event_owners] column value.
+ *
+ * @return string
+ */
+ public function getFcdEventOwners()
+ {
+
+ return $this->fcd_event_owners;
+ }
+
+ /**
+ * Get the [fcd_status] column value.
+ *
+ * @return string
+ */
+ public function getFcdStatus()
+ {
+
+ return $this->fcd_status;
+ }
+
+ /**
+ * Get the [fcd_dyn_uid] column value.
+ *
+ * @return string
+ */
+ public function getFcdDynUid()
+ {
+
+ return $this->fcd_dyn_uid;
+ }
+
+ /**
+ * Set the value of [fcd_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_uid !== $v || $v === '') {
+ $this->fcd_uid = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_UID;
+ }
+
+ } // setFcdUid()
+
+ /**
+ * Set the value of [fcd_function] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdFunction($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_function !== $v) {
+ $this->fcd_function = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_FUNCTION;
+ }
+
+ } // setFcdFunction()
+
+ /**
+ * Set the value of [fcd_fields] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdFields($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_fields !== $v) {
+ $this->fcd_fields = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_FIELDS;
+ }
+
+ } // setFcdFields()
+
+ /**
+ * Set the value of [fcd_condition] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdCondition($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_condition !== $v) {
+ $this->fcd_condition = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_CONDITION;
+ }
+
+ } // setFcdCondition()
+
+ /**
+ * Set the value of [fcd_events] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdEvents($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_events !== $v) {
+ $this->fcd_events = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_EVENTS;
+ }
+
+ } // setFcdEvents()
+
+ /**
+ * Set the value of [fcd_event_owners] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdEventOwners($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_event_owners !== $v) {
+ $this->fcd_event_owners = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_EVENT_OWNERS;
+ }
+
+ } // setFcdEventOwners()
+
+ /**
+ * Set the value of [fcd_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_status !== $v) {
+ $this->fcd_status = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_STATUS;
+ }
+
+ } // setFcdStatus()
+
+ /**
+ * Set the value of [fcd_dyn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFcdDynUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fcd_dyn_uid !== $v) {
+ $this->fcd_dyn_uid = $v;
+ $this->modifiedColumns[] = FieldConditionPeer::FCD_DYN_UID;
+ }
+
+ } // setFcdDynUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->fcd_uid = $rs->getString($startcol + 0);
+
+ $this->fcd_function = $rs->getString($startcol + 1);
+
+ $this->fcd_fields = $rs->getString($startcol + 2);
+
+ $this->fcd_condition = $rs->getString($startcol + 3);
+
+ $this->fcd_events = $rs->getString($startcol + 4);
+
+ $this->fcd_event_owners = $rs->getString($startcol + 5);
+
+ $this->fcd_status = $rs->getString($startcol + 6);
+
+ $this->fcd_dyn_uid = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = FieldConditionPeer::NUM_COLUMNS - FieldConditionPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating FieldCondition object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(FieldConditionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ FieldConditionPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(FieldConditionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = FieldConditionPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += FieldConditionPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = FieldConditionPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = FieldConditionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getFcdUid();
+ break;
+ case 1:
+ return $this->getFcdFunction();
+ break;
+ case 2:
+ return $this->getFcdFields();
+ break;
+ case 3:
+ return $this->getFcdCondition();
+ break;
+ case 4:
+ return $this->getFcdEvents();
+ break;
+ case 5:
+ return $this->getFcdEventOwners();
+ break;
+ case 6:
+ return $this->getFcdStatus();
+ break;
+ case 7:
+ return $this->getFcdDynUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = FieldConditionPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getFcdUid(),
+ $keys[1] => $this->getFcdFunction(),
+ $keys[2] => $this->getFcdFields(),
+ $keys[3] => $this->getFcdCondition(),
+ $keys[4] => $this->getFcdEvents(),
+ $keys[5] => $this->getFcdEventOwners(),
+ $keys[6] => $this->getFcdStatus(),
+ $keys[7] => $this->getFcdDynUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = FieldConditionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setFcdUid($value);
+ break;
+ case 1:
+ $this->setFcdFunction($value);
+ break;
+ case 2:
+ $this->setFcdFields($value);
+ break;
+ case 3:
+ $this->setFcdCondition($value);
+ break;
+ case 4:
+ $this->setFcdEvents($value);
+ break;
+ case 5:
+ $this->setFcdEventOwners($value);
+ break;
+ case 6:
+ $this->setFcdStatus($value);
+ break;
+ case 7:
+ $this->setFcdDynUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = FieldConditionPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setFcdUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setFcdFunction($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setFcdFields($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setFcdCondition($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setFcdEvents($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setFcdEventOwners($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setFcdStatus($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setFcdDynUid($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(FieldConditionPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_UID)) {
+ $criteria->add(FieldConditionPeer::FCD_UID, $this->fcd_uid);
+ }
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_FUNCTION)) {
+ $criteria->add(FieldConditionPeer::FCD_FUNCTION, $this->fcd_function);
+ }
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_FIELDS)) {
+ $criteria->add(FieldConditionPeer::FCD_FIELDS, $this->fcd_fields);
+ }
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_CONDITION)) {
+ $criteria->add(FieldConditionPeer::FCD_CONDITION, $this->fcd_condition);
+ }
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_EVENTS)) {
+ $criteria->add(FieldConditionPeer::FCD_EVENTS, $this->fcd_events);
+ }
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_EVENT_OWNERS)) {
+ $criteria->add(FieldConditionPeer::FCD_EVENT_OWNERS, $this->fcd_event_owners);
+ }
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_STATUS)) {
+ $criteria->add(FieldConditionPeer::FCD_STATUS, $this->fcd_status);
+ }
+
+ if ($this->isColumnModified(FieldConditionPeer::FCD_DYN_UID)) {
+ $criteria->add(FieldConditionPeer::FCD_DYN_UID, $this->fcd_dyn_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(FieldConditionPeer::DATABASE_NAME);
+
+ $criteria->add(FieldConditionPeer::FCD_UID, $this->fcd_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getFcdUid();
+ }
+
+ /**
+ * Generic method to set the primary key (fcd_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setFcdUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of FieldCondition (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setFcdFunction($this->fcd_function);
+
+ $copyObj->setFcdFields($this->fcd_fields);
+
+ $copyObj->setFcdCondition($this->fcd_condition);
+
+ $copyObj->setFcdEvents($this->fcd_events);
+
+ $copyObj->setFcdEventOwners($this->fcd_event_owners);
+
+ $copyObj->setFcdStatus($this->fcd_status);
+
+ $copyObj->setFcdDynUid($this->fcd_dyn_uid);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setFcdUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return FieldCondition Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return FieldConditionPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new FieldConditionPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var FieldConditionPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the fcd_uid field.
- * @var string
- */
- protected $fcd_uid = '';
-
-
- /**
- * The value for the fcd_function field.
- * @var string
- */
- protected $fcd_function;
-
-
- /**
- * The value for the fcd_fields field.
- * @var string
- */
- protected $fcd_fields;
-
-
- /**
- * The value for the fcd_condition field.
- * @var string
- */
- protected $fcd_condition;
-
-
- /**
- * The value for the fcd_events field.
- * @var string
- */
- protected $fcd_events;
-
-
- /**
- * The value for the fcd_event_owners field.
- * @var string
- */
- protected $fcd_event_owners;
-
-
- /**
- * The value for the fcd_status field.
- * @var string
- */
- protected $fcd_status;
-
-
- /**
- * The value for the fcd_dyn_uid field.
- * @var string
- */
- protected $fcd_dyn_uid;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [fcd_uid] column value.
- *
- * @return string
- */
- public function getFcdUid()
- {
-
- return $this->fcd_uid;
- }
-
- /**
- * Get the [fcd_function] column value.
- *
- * @return string
- */
- public function getFcdFunction()
- {
-
- return $this->fcd_function;
- }
-
- /**
- * Get the [fcd_fields] column value.
- *
- * @return string
- */
- public function getFcdFields()
- {
-
- return $this->fcd_fields;
- }
-
- /**
- * Get the [fcd_condition] column value.
- *
- * @return string
- */
- public function getFcdCondition()
- {
-
- return $this->fcd_condition;
- }
-
- /**
- * Get the [fcd_events] column value.
- *
- * @return string
- */
- public function getFcdEvents()
- {
-
- return $this->fcd_events;
- }
-
- /**
- * Get the [fcd_event_owners] column value.
- *
- * @return string
- */
- public function getFcdEventOwners()
- {
-
- return $this->fcd_event_owners;
- }
-
- /**
- * Get the [fcd_status] column value.
- *
- * @return string
- */
- public function getFcdStatus()
- {
-
- return $this->fcd_status;
- }
-
- /**
- * Get the [fcd_dyn_uid] column value.
- *
- * @return string
- */
- public function getFcdDynUid()
- {
-
- return $this->fcd_dyn_uid;
- }
-
- /**
- * Set the value of [fcd_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_uid !== $v || $v === '') {
- $this->fcd_uid = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_UID;
- }
-
- } // setFcdUid()
-
- /**
- * Set the value of [fcd_function] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdFunction($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_function !== $v) {
- $this->fcd_function = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_FUNCTION;
- }
-
- } // setFcdFunction()
-
- /**
- * Set the value of [fcd_fields] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdFields($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_fields !== $v) {
- $this->fcd_fields = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_FIELDS;
- }
-
- } // setFcdFields()
-
- /**
- * Set the value of [fcd_condition] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdCondition($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_condition !== $v) {
- $this->fcd_condition = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_CONDITION;
- }
-
- } // setFcdCondition()
-
- /**
- * Set the value of [fcd_events] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdEvents($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_events !== $v) {
- $this->fcd_events = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_EVENTS;
- }
-
- } // setFcdEvents()
-
- /**
- * Set the value of [fcd_event_owners] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdEventOwners($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_event_owners !== $v) {
- $this->fcd_event_owners = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_EVENT_OWNERS;
- }
-
- } // setFcdEventOwners()
-
- /**
- * Set the value of [fcd_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_status !== $v) {
- $this->fcd_status = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_STATUS;
- }
-
- } // setFcdStatus()
-
- /**
- * Set the value of [fcd_dyn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFcdDynUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fcd_dyn_uid !== $v) {
- $this->fcd_dyn_uid = $v;
- $this->modifiedColumns[] = FieldConditionPeer::FCD_DYN_UID;
- }
-
- } // setFcdDynUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->fcd_uid = $rs->getString($startcol + 0);
-
- $this->fcd_function = $rs->getString($startcol + 1);
-
- $this->fcd_fields = $rs->getString($startcol + 2);
-
- $this->fcd_condition = $rs->getString($startcol + 3);
-
- $this->fcd_events = $rs->getString($startcol + 4);
-
- $this->fcd_event_owners = $rs->getString($startcol + 5);
-
- $this->fcd_status = $rs->getString($startcol + 6);
-
- $this->fcd_dyn_uid = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = FieldConditionPeer::NUM_COLUMNS - FieldConditionPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating FieldCondition object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(FieldConditionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- FieldConditionPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(FieldConditionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = FieldConditionPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += FieldConditionPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = FieldConditionPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = FieldConditionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getFcdUid();
- break;
- case 1:
- return $this->getFcdFunction();
- break;
- case 2:
- return $this->getFcdFields();
- break;
- case 3:
- return $this->getFcdCondition();
- break;
- case 4:
- return $this->getFcdEvents();
- break;
- case 5:
- return $this->getFcdEventOwners();
- break;
- case 6:
- return $this->getFcdStatus();
- break;
- case 7:
- return $this->getFcdDynUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = FieldConditionPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getFcdUid(),
- $keys[1] => $this->getFcdFunction(),
- $keys[2] => $this->getFcdFields(),
- $keys[3] => $this->getFcdCondition(),
- $keys[4] => $this->getFcdEvents(),
- $keys[5] => $this->getFcdEventOwners(),
- $keys[6] => $this->getFcdStatus(),
- $keys[7] => $this->getFcdDynUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = FieldConditionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setFcdUid($value);
- break;
- case 1:
- $this->setFcdFunction($value);
- break;
- case 2:
- $this->setFcdFields($value);
- break;
- case 3:
- $this->setFcdCondition($value);
- break;
- case 4:
- $this->setFcdEvents($value);
- break;
- case 5:
- $this->setFcdEventOwners($value);
- break;
- case 6:
- $this->setFcdStatus($value);
- break;
- case 7:
- $this->setFcdDynUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = FieldConditionPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setFcdUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setFcdFunction($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setFcdFields($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setFcdCondition($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setFcdEvents($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setFcdEventOwners($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setFcdStatus($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setFcdDynUid($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(FieldConditionPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(FieldConditionPeer::FCD_UID)) $criteria->add(FieldConditionPeer::FCD_UID, $this->fcd_uid);
- if ($this->isColumnModified(FieldConditionPeer::FCD_FUNCTION)) $criteria->add(FieldConditionPeer::FCD_FUNCTION, $this->fcd_function);
- if ($this->isColumnModified(FieldConditionPeer::FCD_FIELDS)) $criteria->add(FieldConditionPeer::FCD_FIELDS, $this->fcd_fields);
- if ($this->isColumnModified(FieldConditionPeer::FCD_CONDITION)) $criteria->add(FieldConditionPeer::FCD_CONDITION, $this->fcd_condition);
- if ($this->isColumnModified(FieldConditionPeer::FCD_EVENTS)) $criteria->add(FieldConditionPeer::FCD_EVENTS, $this->fcd_events);
- if ($this->isColumnModified(FieldConditionPeer::FCD_EVENT_OWNERS)) $criteria->add(FieldConditionPeer::FCD_EVENT_OWNERS, $this->fcd_event_owners);
- if ($this->isColumnModified(FieldConditionPeer::FCD_STATUS)) $criteria->add(FieldConditionPeer::FCD_STATUS, $this->fcd_status);
- if ($this->isColumnModified(FieldConditionPeer::FCD_DYN_UID)) $criteria->add(FieldConditionPeer::FCD_DYN_UID, $this->fcd_dyn_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(FieldConditionPeer::DATABASE_NAME);
-
- $criteria->add(FieldConditionPeer::FCD_UID, $this->fcd_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getFcdUid();
- }
-
- /**
- * Generic method to set the primary key (fcd_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setFcdUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of FieldCondition (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setFcdFunction($this->fcd_function);
-
- $copyObj->setFcdFields($this->fcd_fields);
-
- $copyObj->setFcdCondition($this->fcd_condition);
-
- $copyObj->setFcdEvents($this->fcd_events);
-
- $copyObj->setFcdEventOwners($this->fcd_event_owners);
-
- $copyObj->setFcdStatus($this->fcd_status);
-
- $copyObj->setFcdDynUid($this->fcd_dyn_uid);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setFcdUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return FieldCondition Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return FieldConditionPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new FieldConditionPeer();
- }
- return self::$peer;
- }
-
-} // BaseFieldCondition
diff --git a/workflow/engine/classes/model/om/BaseFieldConditionPeer.php b/workflow/engine/classes/model/om/BaseFieldConditionPeer.php
index e5d522ba0..31ad0e6de 100755
--- a/workflow/engine/classes/model/om/BaseFieldConditionPeer.php
+++ b/workflow/engine/classes/model/om/BaseFieldConditionPeer.php
@@ -12,589 +12,591 @@ include_once 'classes/model/FieldCondition.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseFieldConditionPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'FIELD_CONDITION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.FieldCondition';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the FCD_UID field */
- const FCD_UID = 'FIELD_CONDITION.FCD_UID';
-
- /** the column name for the FCD_FUNCTION field */
- const FCD_FUNCTION = 'FIELD_CONDITION.FCD_FUNCTION';
-
- /** the column name for the FCD_FIELDS field */
- const FCD_FIELDS = 'FIELD_CONDITION.FCD_FIELDS';
-
- /** the column name for the FCD_CONDITION field */
- const FCD_CONDITION = 'FIELD_CONDITION.FCD_CONDITION';
-
- /** the column name for the FCD_EVENTS field */
- const FCD_EVENTS = 'FIELD_CONDITION.FCD_EVENTS';
-
- /** the column name for the FCD_EVENT_OWNERS field */
- const FCD_EVENT_OWNERS = 'FIELD_CONDITION.FCD_EVENT_OWNERS';
-
- /** the column name for the FCD_STATUS field */
- const FCD_STATUS = 'FIELD_CONDITION.FCD_STATUS';
-
- /** the column name for the FCD_DYN_UID field */
- const FCD_DYN_UID = 'FIELD_CONDITION.FCD_DYN_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('FcdUid', 'FcdFunction', 'FcdFields', 'FcdCondition', 'FcdEvents', 'FcdEventOwners', 'FcdStatus', 'FcdDynUid', ),
- BasePeer::TYPE_COLNAME => array (FieldConditionPeer::FCD_UID, FieldConditionPeer::FCD_FUNCTION, FieldConditionPeer::FCD_FIELDS, FieldConditionPeer::FCD_CONDITION, FieldConditionPeer::FCD_EVENTS, FieldConditionPeer::FCD_EVENT_OWNERS, FieldConditionPeer::FCD_STATUS, FieldConditionPeer::FCD_DYN_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('FCD_UID', 'FCD_FUNCTION', 'FCD_FIELDS', 'FCD_CONDITION', 'FCD_EVENTS', 'FCD_EVENT_OWNERS', 'FCD_STATUS', 'FCD_DYN_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('FcdUid' => 0, 'FcdFunction' => 1, 'FcdFields' => 2, 'FcdCondition' => 3, 'FcdEvents' => 4, 'FcdEventOwners' => 5, 'FcdStatus' => 6, 'FcdDynUid' => 7, ),
- BasePeer::TYPE_COLNAME => array (FieldConditionPeer::FCD_UID => 0, FieldConditionPeer::FCD_FUNCTION => 1, FieldConditionPeer::FCD_FIELDS => 2, FieldConditionPeer::FCD_CONDITION => 3, FieldConditionPeer::FCD_EVENTS => 4, FieldConditionPeer::FCD_EVENT_OWNERS => 5, FieldConditionPeer::FCD_STATUS => 6, FieldConditionPeer::FCD_DYN_UID => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('FCD_UID' => 0, 'FCD_FUNCTION' => 1, 'FCD_FIELDS' => 2, 'FCD_CONDITION' => 3, 'FCD_EVENTS' => 4, 'FCD_EVENT_OWNERS' => 5, 'FCD_STATUS' => 6, 'FCD_DYN_UID' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/FieldConditionMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.FieldConditionMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = FieldConditionPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. FieldConditionPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(FieldConditionPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_UID);
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_FUNCTION);
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_FIELDS);
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_CONDITION);
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_EVENTS);
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_EVENT_OWNERS);
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_STATUS);
-
- $criteria->addSelectColumn(FieldConditionPeer::FCD_DYN_UID);
-
- }
-
- const COUNT = 'COUNT(FIELD_CONDITION.FCD_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT FIELD_CONDITION.FCD_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(FieldConditionPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(FieldConditionPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = FieldConditionPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return FieldCondition
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = FieldConditionPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return FieldConditionPeer::populateObjects(FieldConditionPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- FieldConditionPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = FieldConditionPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return FieldConditionPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a FieldCondition or Criteria object.
- *
- * @param mixed $values Criteria or FieldCondition object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from FieldCondition object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a FieldCondition or Criteria object.
- *
- * @param mixed $values Criteria or FieldCondition object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(FieldConditionPeer::FCD_UID);
- $selectCriteria->add(FieldConditionPeer::FCD_UID, $criteria->remove(FieldConditionPeer::FCD_UID), $comparison);
-
- } else { // $values is FieldCondition object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the FIELD_CONDITION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(FieldConditionPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a FieldCondition or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or FieldCondition object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(FieldConditionPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof FieldCondition) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(FieldConditionPeer::FCD_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given FieldCondition object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param FieldCondition $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(FieldCondition $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(FieldConditionPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(FieldConditionPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(FieldConditionPeer::DATABASE_NAME, FieldConditionPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return FieldCondition
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(FieldConditionPeer::DATABASE_NAME);
-
- $criteria->add(FieldConditionPeer::FCD_UID, $pk);
-
-
- $v = FieldConditionPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(FieldConditionPeer::FCD_UID, $pks, Criteria::IN);
- $objs = FieldConditionPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseFieldConditionPeer
+abstract class BaseFieldConditionPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'FIELD_CONDITION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.FieldCondition';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the FCD_UID field */
+ const FCD_UID = 'FIELD_CONDITION.FCD_UID';
+
+ /** the column name for the FCD_FUNCTION field */
+ const FCD_FUNCTION = 'FIELD_CONDITION.FCD_FUNCTION';
+
+ /** the column name for the FCD_FIELDS field */
+ const FCD_FIELDS = 'FIELD_CONDITION.FCD_FIELDS';
+
+ /** the column name for the FCD_CONDITION field */
+ const FCD_CONDITION = 'FIELD_CONDITION.FCD_CONDITION';
+
+ /** the column name for the FCD_EVENTS field */
+ const FCD_EVENTS = 'FIELD_CONDITION.FCD_EVENTS';
+
+ /** the column name for the FCD_EVENT_OWNERS field */
+ const FCD_EVENT_OWNERS = 'FIELD_CONDITION.FCD_EVENT_OWNERS';
+
+ /** the column name for the FCD_STATUS field */
+ const FCD_STATUS = 'FIELD_CONDITION.FCD_STATUS';
+
+ /** the column name for the FCD_DYN_UID field */
+ const FCD_DYN_UID = 'FIELD_CONDITION.FCD_DYN_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('FcdUid', 'FcdFunction', 'FcdFields', 'FcdCondition', 'FcdEvents', 'FcdEventOwners', 'FcdStatus', 'FcdDynUid', ),
+ BasePeer::TYPE_COLNAME => array (FieldConditionPeer::FCD_UID, FieldConditionPeer::FCD_FUNCTION, FieldConditionPeer::FCD_FIELDS, FieldConditionPeer::FCD_CONDITION, FieldConditionPeer::FCD_EVENTS, FieldConditionPeer::FCD_EVENT_OWNERS, FieldConditionPeer::FCD_STATUS, FieldConditionPeer::FCD_DYN_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('FCD_UID', 'FCD_FUNCTION', 'FCD_FIELDS', 'FCD_CONDITION', 'FCD_EVENTS', 'FCD_EVENT_OWNERS', 'FCD_STATUS', 'FCD_DYN_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('FcdUid' => 0, 'FcdFunction' => 1, 'FcdFields' => 2, 'FcdCondition' => 3, 'FcdEvents' => 4, 'FcdEventOwners' => 5, 'FcdStatus' => 6, 'FcdDynUid' => 7, ),
+ BasePeer::TYPE_COLNAME => array (FieldConditionPeer::FCD_UID => 0, FieldConditionPeer::FCD_FUNCTION => 1, FieldConditionPeer::FCD_FIELDS => 2, FieldConditionPeer::FCD_CONDITION => 3, FieldConditionPeer::FCD_EVENTS => 4, FieldConditionPeer::FCD_EVENT_OWNERS => 5, FieldConditionPeer::FCD_STATUS => 6, FieldConditionPeer::FCD_DYN_UID => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('FCD_UID' => 0, 'FCD_FUNCTION' => 1, 'FCD_FIELDS' => 2, 'FCD_CONDITION' => 3, 'FCD_EVENTS' => 4, 'FCD_EVENT_OWNERS' => 5, 'FCD_STATUS' => 6, 'FCD_DYN_UID' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/FieldConditionMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.FieldConditionMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = FieldConditionPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. FieldConditionPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(FieldConditionPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_UID);
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_FUNCTION);
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_FIELDS);
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_CONDITION);
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_EVENTS);
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_EVENT_OWNERS);
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_STATUS);
+
+ $criteria->addSelectColumn(FieldConditionPeer::FCD_DYN_UID);
+
+ }
+
+ const COUNT = 'COUNT(FIELD_CONDITION.FCD_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT FIELD_CONDITION.FCD_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(FieldConditionPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(FieldConditionPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = FieldConditionPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return FieldCondition
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = FieldConditionPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return FieldConditionPeer::populateObjects(FieldConditionPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ FieldConditionPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = FieldConditionPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return FieldConditionPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a FieldCondition or Criteria object.
+ *
+ * @param mixed $values Criteria or FieldCondition object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from FieldCondition object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a FieldCondition or Criteria object.
+ *
+ * @param mixed $values Criteria or FieldCondition object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(FieldConditionPeer::FCD_UID);
+ $selectCriteria->add(FieldConditionPeer::FCD_UID, $criteria->remove(FieldConditionPeer::FCD_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the FIELD_CONDITION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(FieldConditionPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a FieldCondition or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or FieldCondition object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(FieldConditionPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof FieldCondition) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(FieldConditionPeer::FCD_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given FieldCondition object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param FieldCondition $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(FieldCondition $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(FieldConditionPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(FieldConditionPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(FieldConditionPeer::DATABASE_NAME, FieldConditionPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return FieldCondition
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(FieldConditionPeer::DATABASE_NAME);
+
+ $criteria->add(FieldConditionPeer::FCD_UID, $pk);
+
+
+ $v = FieldConditionPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(FieldConditionPeer::FCD_UID, $pks, Criteria::IN);
+ $objs = FieldConditionPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseFieldConditionPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseFieldConditionPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/FieldConditionMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.FieldConditionMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/FieldConditionMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.FieldConditionMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseFields.php b/workflow/engine/classes/model/om/BaseFields.php
index 33c94e498..cde8d208b 100755
--- a/workflow/engine/classes/model/om/BaseFields.php
+++ b/workflow/engine/classes/model/om/BaseFields.php
@@ -16,1231 +16,1307 @@ include_once 'classes/model/FieldsPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseFields extends BaseObject implements Persistent {
+abstract class BaseFields extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var FieldsPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the fld_uid field.
+ * @var string
+ */
+ protected $fld_uid = '';
+
+ /**
+ * The value for the add_tab_uid field.
+ * @var string
+ */
+ protected $add_tab_uid = '';
+
+ /**
+ * The value for the fld_index field.
+ * @var int
+ */
+ protected $fld_index = 1;
+
+ /**
+ * The value for the fld_name field.
+ * @var string
+ */
+ protected $fld_name = '';
+
+ /**
+ * The value for the fld_description field.
+ * @var string
+ */
+ protected $fld_description;
+
+ /**
+ * The value for the fld_type field.
+ * @var string
+ */
+ protected $fld_type = '';
+
+ /**
+ * The value for the fld_size field.
+ * @var int
+ */
+ protected $fld_size = 0;
+
+ /**
+ * The value for the fld_null field.
+ * @var int
+ */
+ protected $fld_null = 1;
+
+ /**
+ * The value for the fld_auto_increment field.
+ * @var int
+ */
+ protected $fld_auto_increment = 0;
+
+ /**
+ * The value for the fld_key field.
+ * @var int
+ */
+ protected $fld_key = 0;
+
+ /**
+ * The value for the fld_foreign_key field.
+ * @var int
+ */
+ protected $fld_foreign_key = 0;
+
+ /**
+ * The value for the fld_foreign_key_table field.
+ * @var string
+ */
+ protected $fld_foreign_key_table = '';
+
+ /**
+ * The value for the fld_dyn_name field.
+ * @var string
+ */
+ protected $fld_dyn_name = '';
+
+ /**
+ * The value for the fld_dyn_uid field.
+ * @var string
+ */
+ protected $fld_dyn_uid = '';
+
+ /**
+ * The value for the fld_filter field.
+ * @var int
+ */
+ protected $fld_filter = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [fld_uid] column value.
+ *
+ * @return string
+ */
+ public function getFldUid()
+ {
+
+ return $this->fld_uid;
+ }
+
+ /**
+ * Get the [add_tab_uid] column value.
+ *
+ * @return string
+ */
+ public function getAddTabUid()
+ {
+
+ return $this->add_tab_uid;
+ }
+
+ /**
+ * Get the [fld_index] column value.
+ *
+ * @return int
+ */
+ public function getFldIndex()
+ {
+
+ return $this->fld_index;
+ }
+
+ /**
+ * Get the [fld_name] column value.
+ *
+ * @return string
+ */
+ public function getFldName()
+ {
+
+ return $this->fld_name;
+ }
+
+ /**
+ * Get the [fld_description] column value.
+ *
+ * @return string
+ */
+ public function getFldDescription()
+ {
+
+ return $this->fld_description;
+ }
+
+ /**
+ * Get the [fld_type] column value.
+ *
+ * @return string
+ */
+ public function getFldType()
+ {
+
+ return $this->fld_type;
+ }
+
+ /**
+ * Get the [fld_size] column value.
+ *
+ * @return int
+ */
+ public function getFldSize()
+ {
+
+ return $this->fld_size;
+ }
+
+ /**
+ * Get the [fld_null] column value.
+ *
+ * @return int
+ */
+ public function getFldNull()
+ {
+
+ return $this->fld_null;
+ }
+
+ /**
+ * Get the [fld_auto_increment] column value.
+ *
+ * @return int
+ */
+ public function getFldAutoIncrement()
+ {
+
+ return $this->fld_auto_increment;
+ }
+
+ /**
+ * Get the [fld_key] column value.
+ *
+ * @return int
+ */
+ public function getFldKey()
+ {
+
+ return $this->fld_key;
+ }
+
+ /**
+ * Get the [fld_foreign_key] column value.
+ *
+ * @return int
+ */
+ public function getFldForeignKey()
+ {
+
+ return $this->fld_foreign_key;
+ }
+
+ /**
+ * Get the [fld_foreign_key_table] column value.
+ *
+ * @return string
+ */
+ public function getFldForeignKeyTable()
+ {
+
+ return $this->fld_foreign_key_table;
+ }
+
+ /**
+ * Get the [fld_dyn_name] column value.
+ *
+ * @return string
+ */
+ public function getFldDynName()
+ {
+
+ return $this->fld_dyn_name;
+ }
+
+ /**
+ * Get the [fld_dyn_uid] column value.
+ *
+ * @return string
+ */
+ public function getFldDynUid()
+ {
+
+ return $this->fld_dyn_uid;
+ }
+
+ /**
+ * Get the [fld_filter] column value.
+ *
+ * @return int
+ */
+ public function getFldFilter()
+ {
+
+ return $this->fld_filter;
+ }
+
+ /**
+ * Set the value of [fld_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFldUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fld_uid !== $v || $v === '') {
+ $this->fld_uid = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_UID;
+ }
+
+ } // setFldUid()
+
+ /**
+ * Set the value of [add_tab_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_uid !== $v || $v === '') {
+ $this->add_tab_uid = $v;
+ $this->modifiedColumns[] = FieldsPeer::ADD_TAB_UID;
+ }
+
+ } // setAddTabUid()
+
+ /**
+ * Set the value of [fld_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFldIndex($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->fld_index !== $v || $v === 1) {
+ $this->fld_index = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_INDEX;
+ }
+
+ } // setFldIndex()
+
+ /**
+ * Set the value of [fld_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFldName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fld_name !== $v || $v === '') {
+ $this->fld_name = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_NAME;
+ }
+
+ } // setFldName()
+
+ /**
+ * Set the value of [fld_description] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFldDescription($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fld_description !== $v) {
+ $this->fld_description = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_DESCRIPTION;
+ }
+
+ } // setFldDescription()
+
+ /**
+ * Set the value of [fld_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFldType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fld_type !== $v || $v === '') {
+ $this->fld_type = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_TYPE;
+ }
+
+ } // setFldType()
+
+ /**
+ * Set the value of [fld_size] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFldSize($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->fld_size !== $v || $v === 0) {
+ $this->fld_size = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_SIZE;
+ }
+
+ } // setFldSize()
+
+ /**
+ * Set the value of [fld_null] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFldNull($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->fld_null !== $v || $v === 1) {
+ $this->fld_null = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_NULL;
+ }
+
+ } // setFldNull()
+
+ /**
+ * Set the value of [fld_auto_increment] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFldAutoIncrement($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->fld_auto_increment !== $v || $v === 0) {
+ $this->fld_auto_increment = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_AUTO_INCREMENT;
+ }
+
+ } // setFldAutoIncrement()
+
+ /**
+ * Set the value of [fld_key] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFldKey($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->fld_key !== $v || $v === 0) {
+ $this->fld_key = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_KEY;
+ }
+
+ } // setFldKey()
+
+ /**
+ * Set the value of [fld_foreign_key] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFldForeignKey($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->fld_foreign_key !== $v || $v === 0) {
+ $this->fld_foreign_key = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_FOREIGN_KEY;
+ }
+
+ } // setFldForeignKey()
+
+ /**
+ * Set the value of [fld_foreign_key_table] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFldForeignKeyTable($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fld_foreign_key_table !== $v || $v === '') {
+ $this->fld_foreign_key_table = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_FOREIGN_KEY_TABLE;
+ }
+
+ } // setFldForeignKeyTable()
+
+ /**
+ * Set the value of [fld_dyn_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFldDynName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fld_dyn_name !== $v || $v === '') {
+ $this->fld_dyn_name = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_DYN_NAME;
+ }
+
+ } // setFldDynName()
+
+ /**
+ * Set the value of [fld_dyn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setFldDynUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->fld_dyn_uid !== $v || $v === '') {
+ $this->fld_dyn_uid = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_DYN_UID;
+ }
+
+ } // setFldDynUid()
+
+ /**
+ * Set the value of [fld_filter] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setFldFilter($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->fld_filter !== $v || $v === 0) {
+ $this->fld_filter = $v;
+ $this->modifiedColumns[] = FieldsPeer::FLD_FILTER;
+ }
+
+ } // setFldFilter()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->fld_uid = $rs->getString($startcol + 0);
+
+ $this->add_tab_uid = $rs->getString($startcol + 1);
+
+ $this->fld_index = $rs->getInt($startcol + 2);
+
+ $this->fld_name = $rs->getString($startcol + 3);
+
+ $this->fld_description = $rs->getString($startcol + 4);
+
+ $this->fld_type = $rs->getString($startcol + 5);
+
+ $this->fld_size = $rs->getInt($startcol + 6);
+
+ $this->fld_null = $rs->getInt($startcol + 7);
+
+ $this->fld_auto_increment = $rs->getInt($startcol + 8);
+
+ $this->fld_key = $rs->getInt($startcol + 9);
+
+ $this->fld_foreign_key = $rs->getInt($startcol + 10);
+
+ $this->fld_foreign_key_table = $rs->getString($startcol + 11);
+
+ $this->fld_dyn_name = $rs->getString($startcol + 12);
+
+ $this->fld_dyn_uid = $rs->getString($startcol + 13);
+
+ $this->fld_filter = $rs->getInt($startcol + 14);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 15; // 15 = FieldsPeer::NUM_COLUMNS - FieldsPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Fields object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(FieldsPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ FieldsPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(FieldsPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = FieldsPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += FieldsPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = FieldsPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = FieldsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getFldUid();
+ break;
+ case 1:
+ return $this->getAddTabUid();
+ break;
+ case 2:
+ return $this->getFldIndex();
+ break;
+ case 3:
+ return $this->getFldName();
+ break;
+ case 4:
+ return $this->getFldDescription();
+ break;
+ case 5:
+ return $this->getFldType();
+ break;
+ case 6:
+ return $this->getFldSize();
+ break;
+ case 7:
+ return $this->getFldNull();
+ break;
+ case 8:
+ return $this->getFldAutoIncrement();
+ break;
+ case 9:
+ return $this->getFldKey();
+ break;
+ case 10:
+ return $this->getFldForeignKey();
+ break;
+ case 11:
+ return $this->getFldForeignKeyTable();
+ break;
+ case 12:
+ return $this->getFldDynName();
+ break;
+ case 13:
+ return $this->getFldDynUid();
+ break;
+ case 14:
+ return $this->getFldFilter();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = FieldsPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getFldUid(),
+ $keys[1] => $this->getAddTabUid(),
+ $keys[2] => $this->getFldIndex(),
+ $keys[3] => $this->getFldName(),
+ $keys[4] => $this->getFldDescription(),
+ $keys[5] => $this->getFldType(),
+ $keys[6] => $this->getFldSize(),
+ $keys[7] => $this->getFldNull(),
+ $keys[8] => $this->getFldAutoIncrement(),
+ $keys[9] => $this->getFldKey(),
+ $keys[10] => $this->getFldForeignKey(),
+ $keys[11] => $this->getFldForeignKeyTable(),
+ $keys[12] => $this->getFldDynName(),
+ $keys[13] => $this->getFldDynUid(),
+ $keys[14] => $this->getFldFilter(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = FieldsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setFldUid($value);
+ break;
+ case 1:
+ $this->setAddTabUid($value);
+ break;
+ case 2:
+ $this->setFldIndex($value);
+ break;
+ case 3:
+ $this->setFldName($value);
+ break;
+ case 4:
+ $this->setFldDescription($value);
+ break;
+ case 5:
+ $this->setFldType($value);
+ break;
+ case 6:
+ $this->setFldSize($value);
+ break;
+ case 7:
+ $this->setFldNull($value);
+ break;
+ case 8:
+ $this->setFldAutoIncrement($value);
+ break;
+ case 9:
+ $this->setFldKey($value);
+ break;
+ case 10:
+ $this->setFldForeignKey($value);
+ break;
+ case 11:
+ $this->setFldForeignKeyTable($value);
+ break;
+ case 12:
+ $this->setFldDynName($value);
+ break;
+ case 13:
+ $this->setFldDynUid($value);
+ break;
+ case 14:
+ $this->setFldFilter($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = FieldsPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setFldUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setAddTabUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setFldIndex($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setFldName($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setFldDescription($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setFldType($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setFldSize($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setFldNull($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setFldAutoIncrement($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setFldKey($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setFldForeignKey($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setFldForeignKeyTable($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setFldDynName($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setFldDynUid($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setFldFilter($arr[$keys[14]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(FieldsPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(FieldsPeer::FLD_UID)) {
+ $criteria->add(FieldsPeer::FLD_UID, $this->fld_uid);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::ADD_TAB_UID)) {
+ $criteria->add(FieldsPeer::ADD_TAB_UID, $this->add_tab_uid);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::FLD_INDEX)) {
+ $criteria->add(FieldsPeer::FLD_INDEX, $this->fld_index);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::FLD_NAME)) {
+ $criteria->add(FieldsPeer::FLD_NAME, $this->fld_name);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::FLD_DESCRIPTION)) {
+ $criteria->add(FieldsPeer::FLD_DESCRIPTION, $this->fld_description);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::FLD_TYPE)) {
+ $criteria->add(FieldsPeer::FLD_TYPE, $this->fld_type);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::FLD_SIZE)) {
+ $criteria->add(FieldsPeer::FLD_SIZE, $this->fld_size);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::FLD_NULL)) {
+ $criteria->add(FieldsPeer::FLD_NULL, $this->fld_null);
+ }
+
+ if ($this->isColumnModified(FieldsPeer::FLD_AUTO_INCREMENT)) {
+ $criteria->add(FieldsPeer::FLD_AUTO_INCREMENT, $this->fld_auto_increment);
+ }
+ if ($this->isColumnModified(FieldsPeer::FLD_KEY)) {
+ $criteria->add(FieldsPeer::FLD_KEY, $this->fld_key);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var FieldsPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(FieldsPeer::FLD_FOREIGN_KEY)) {
+ $criteria->add(FieldsPeer::FLD_FOREIGN_KEY, $this->fld_foreign_key);
+ }
+ if ($this->isColumnModified(FieldsPeer::FLD_FOREIGN_KEY_TABLE)) {
+ $criteria->add(FieldsPeer::FLD_FOREIGN_KEY_TABLE, $this->fld_foreign_key_table);
+ }
- /**
- * The value for the fld_uid field.
- * @var string
- */
- protected $fld_uid = '';
+ if ($this->isColumnModified(FieldsPeer::FLD_DYN_NAME)) {
+ $criteria->add(FieldsPeer::FLD_DYN_NAME, $this->fld_dyn_name);
+ }
+ if ($this->isColumnModified(FieldsPeer::FLD_DYN_UID)) {
+ $criteria->add(FieldsPeer::FLD_DYN_UID, $this->fld_dyn_uid);
+ }
- /**
- * The value for the add_tab_uid field.
- * @var string
- */
- protected $add_tab_uid = '';
+ if ($this->isColumnModified(FieldsPeer::FLD_FILTER)) {
+ $criteria->add(FieldsPeer::FLD_FILTER, $this->fld_filter);
+ }
- /**
- * The value for the fld_index field.
- * @var int
- */
- protected $fld_index = 1;
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(FieldsPeer::DATABASE_NAME);
+
+ $criteria->add(FieldsPeer::FLD_UID, $this->fld_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getFldUid();
+ }
+
+ /**
+ * Generic method to set the primary key (fld_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setFldUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Fields (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAddTabUid($this->add_tab_uid);
+
+ $copyObj->setFldIndex($this->fld_index);
+
+ $copyObj->setFldName($this->fld_name);
+
+ $copyObj->setFldDescription($this->fld_description);
+
+ $copyObj->setFldType($this->fld_type);
+
+ $copyObj->setFldSize($this->fld_size);
+
+ $copyObj->setFldNull($this->fld_null);
+
+ $copyObj->setFldAutoIncrement($this->fld_auto_increment);
+
+ $copyObj->setFldKey($this->fld_key);
+
+ $copyObj->setFldForeignKey($this->fld_foreign_key);
+
+ $copyObj->setFldForeignKeyTable($this->fld_foreign_key_table);
+
+ $copyObj->setFldDynName($this->fld_dyn_name);
+
+ $copyObj->setFldDynUid($this->fld_dyn_uid);
+
+ $copyObj->setFldFilter($this->fld_filter);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setFldUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Fields Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return FieldsPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new FieldsPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The value for the fld_name field.
- * @var string
- */
- protected $fld_name = '';
-
-
- /**
- * The value for the fld_description field.
- * @var string
- */
- protected $fld_description;
-
-
- /**
- * The value for the fld_type field.
- * @var string
- */
- protected $fld_type = '';
-
-
- /**
- * The value for the fld_size field.
- * @var int
- */
- protected $fld_size = 0;
-
-
- /**
- * The value for the fld_null field.
- * @var int
- */
- protected $fld_null = 1;
-
-
- /**
- * The value for the fld_auto_increment field.
- * @var int
- */
- protected $fld_auto_increment = 0;
-
-
- /**
- * The value for the fld_key field.
- * @var int
- */
- protected $fld_key = 0;
-
-
- /**
- * The value for the fld_foreign_key field.
- * @var int
- */
- protected $fld_foreign_key = 0;
-
-
- /**
- * The value for the fld_foreign_key_table field.
- * @var string
- */
- protected $fld_foreign_key_table = '';
-
-
- /**
- * The value for the fld_dyn_name field.
- * @var string
- */
- protected $fld_dyn_name = '';
-
-
- /**
- * The value for the fld_dyn_uid field.
- * @var string
- */
- protected $fld_dyn_uid = '';
-
-
- /**
- * The value for the fld_filter field.
- * @var int
- */
- protected $fld_filter = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [fld_uid] column value.
- *
- * @return string
- */
- public function getFldUid()
- {
-
- return $this->fld_uid;
- }
-
- /**
- * Get the [add_tab_uid] column value.
- *
- * @return string
- */
- public function getAddTabUid()
- {
-
- return $this->add_tab_uid;
- }
-
- /**
- * Get the [fld_index] column value.
- *
- * @return int
- */
- public function getFldIndex()
- {
-
- return $this->fld_index;
- }
-
- /**
- * Get the [fld_name] column value.
- *
- * @return string
- */
- public function getFldName()
- {
-
- return $this->fld_name;
- }
-
- /**
- * Get the [fld_description] column value.
- *
- * @return string
- */
- public function getFldDescription()
- {
-
- return $this->fld_description;
- }
-
- /**
- * Get the [fld_type] column value.
- *
- * @return string
- */
- public function getFldType()
- {
-
- return $this->fld_type;
- }
-
- /**
- * Get the [fld_size] column value.
- *
- * @return int
- */
- public function getFldSize()
- {
-
- return $this->fld_size;
- }
-
- /**
- * Get the [fld_null] column value.
- *
- * @return int
- */
- public function getFldNull()
- {
-
- return $this->fld_null;
- }
-
- /**
- * Get the [fld_auto_increment] column value.
- *
- * @return int
- */
- public function getFldAutoIncrement()
- {
-
- return $this->fld_auto_increment;
- }
-
- /**
- * Get the [fld_key] column value.
- *
- * @return int
- */
- public function getFldKey()
- {
-
- return $this->fld_key;
- }
-
- /**
- * Get the [fld_foreign_key] column value.
- *
- * @return int
- */
- public function getFldForeignKey()
- {
-
- return $this->fld_foreign_key;
- }
-
- /**
- * Get the [fld_foreign_key_table] column value.
- *
- * @return string
- */
- public function getFldForeignKeyTable()
- {
-
- return $this->fld_foreign_key_table;
- }
-
- /**
- * Get the [fld_dyn_name] column value.
- *
- * @return string
- */
- public function getFldDynName()
- {
-
- return $this->fld_dyn_name;
- }
-
- /**
- * Get the [fld_dyn_uid] column value.
- *
- * @return string
- */
- public function getFldDynUid()
- {
-
- return $this->fld_dyn_uid;
- }
-
- /**
- * Get the [fld_filter] column value.
- *
- * @return int
- */
- public function getFldFilter()
- {
-
- return $this->fld_filter;
- }
-
- /**
- * Set the value of [fld_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFldUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fld_uid !== $v || $v === '') {
- $this->fld_uid = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_UID;
- }
-
- } // setFldUid()
-
- /**
- * Set the value of [add_tab_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_uid !== $v || $v === '') {
- $this->add_tab_uid = $v;
- $this->modifiedColumns[] = FieldsPeer::ADD_TAB_UID;
- }
-
- } // setAddTabUid()
-
- /**
- * Set the value of [fld_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFldIndex($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->fld_index !== $v || $v === 1) {
- $this->fld_index = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_INDEX;
- }
-
- } // setFldIndex()
-
- /**
- * Set the value of [fld_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFldName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fld_name !== $v || $v === '') {
- $this->fld_name = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_NAME;
- }
-
- } // setFldName()
-
- /**
- * Set the value of [fld_description] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFldDescription($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fld_description !== $v) {
- $this->fld_description = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_DESCRIPTION;
- }
-
- } // setFldDescription()
-
- /**
- * Set the value of [fld_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFldType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fld_type !== $v || $v === '') {
- $this->fld_type = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_TYPE;
- }
-
- } // setFldType()
-
- /**
- * Set the value of [fld_size] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFldSize($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->fld_size !== $v || $v === 0) {
- $this->fld_size = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_SIZE;
- }
-
- } // setFldSize()
-
- /**
- * Set the value of [fld_null] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFldNull($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->fld_null !== $v || $v === 1) {
- $this->fld_null = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_NULL;
- }
-
- } // setFldNull()
-
- /**
- * Set the value of [fld_auto_increment] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFldAutoIncrement($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->fld_auto_increment !== $v || $v === 0) {
- $this->fld_auto_increment = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_AUTO_INCREMENT;
- }
-
- } // setFldAutoIncrement()
-
- /**
- * Set the value of [fld_key] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFldKey($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->fld_key !== $v || $v === 0) {
- $this->fld_key = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_KEY;
- }
-
- } // setFldKey()
-
- /**
- * Set the value of [fld_foreign_key] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFldForeignKey($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->fld_foreign_key !== $v || $v === 0) {
- $this->fld_foreign_key = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_FOREIGN_KEY;
- }
-
- } // setFldForeignKey()
-
- /**
- * Set the value of [fld_foreign_key_table] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFldForeignKeyTable($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fld_foreign_key_table !== $v || $v === '') {
- $this->fld_foreign_key_table = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_FOREIGN_KEY_TABLE;
- }
-
- } // setFldForeignKeyTable()
-
- /**
- * Set the value of [fld_dyn_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFldDynName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fld_dyn_name !== $v || $v === '') {
- $this->fld_dyn_name = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_DYN_NAME;
- }
-
- } // setFldDynName()
-
- /**
- * Set the value of [fld_dyn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setFldDynUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->fld_dyn_uid !== $v || $v === '') {
- $this->fld_dyn_uid = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_DYN_UID;
- }
-
- } // setFldDynUid()
-
- /**
- * Set the value of [fld_filter] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setFldFilter($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->fld_filter !== $v || $v === 0) {
- $this->fld_filter = $v;
- $this->modifiedColumns[] = FieldsPeer::FLD_FILTER;
- }
-
- } // setFldFilter()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->fld_uid = $rs->getString($startcol + 0);
-
- $this->add_tab_uid = $rs->getString($startcol + 1);
-
- $this->fld_index = $rs->getInt($startcol + 2);
-
- $this->fld_name = $rs->getString($startcol + 3);
-
- $this->fld_description = $rs->getString($startcol + 4);
-
- $this->fld_type = $rs->getString($startcol + 5);
-
- $this->fld_size = $rs->getInt($startcol + 6);
-
- $this->fld_null = $rs->getInt($startcol + 7);
-
- $this->fld_auto_increment = $rs->getInt($startcol + 8);
-
- $this->fld_key = $rs->getInt($startcol + 9);
-
- $this->fld_foreign_key = $rs->getInt($startcol + 10);
-
- $this->fld_foreign_key_table = $rs->getString($startcol + 11);
-
- $this->fld_dyn_name = $rs->getString($startcol + 12);
-
- $this->fld_dyn_uid = $rs->getString($startcol + 13);
-
- $this->fld_filter = $rs->getInt($startcol + 14);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 15; // 15 = FieldsPeer::NUM_COLUMNS - FieldsPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Fields object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(FieldsPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- FieldsPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(FieldsPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = FieldsPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += FieldsPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = FieldsPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = FieldsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getFldUid();
- break;
- case 1:
- return $this->getAddTabUid();
- break;
- case 2:
- return $this->getFldIndex();
- break;
- case 3:
- return $this->getFldName();
- break;
- case 4:
- return $this->getFldDescription();
- break;
- case 5:
- return $this->getFldType();
- break;
- case 6:
- return $this->getFldSize();
- break;
- case 7:
- return $this->getFldNull();
- break;
- case 8:
- return $this->getFldAutoIncrement();
- break;
- case 9:
- return $this->getFldKey();
- break;
- case 10:
- return $this->getFldForeignKey();
- break;
- case 11:
- return $this->getFldForeignKeyTable();
- break;
- case 12:
- return $this->getFldDynName();
- break;
- case 13:
- return $this->getFldDynUid();
- break;
- case 14:
- return $this->getFldFilter();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = FieldsPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getFldUid(),
- $keys[1] => $this->getAddTabUid(),
- $keys[2] => $this->getFldIndex(),
- $keys[3] => $this->getFldName(),
- $keys[4] => $this->getFldDescription(),
- $keys[5] => $this->getFldType(),
- $keys[6] => $this->getFldSize(),
- $keys[7] => $this->getFldNull(),
- $keys[8] => $this->getFldAutoIncrement(),
- $keys[9] => $this->getFldKey(),
- $keys[10] => $this->getFldForeignKey(),
- $keys[11] => $this->getFldForeignKeyTable(),
- $keys[12] => $this->getFldDynName(),
- $keys[13] => $this->getFldDynUid(),
- $keys[14] => $this->getFldFilter(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = FieldsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setFldUid($value);
- break;
- case 1:
- $this->setAddTabUid($value);
- break;
- case 2:
- $this->setFldIndex($value);
- break;
- case 3:
- $this->setFldName($value);
- break;
- case 4:
- $this->setFldDescription($value);
- break;
- case 5:
- $this->setFldType($value);
- break;
- case 6:
- $this->setFldSize($value);
- break;
- case 7:
- $this->setFldNull($value);
- break;
- case 8:
- $this->setFldAutoIncrement($value);
- break;
- case 9:
- $this->setFldKey($value);
- break;
- case 10:
- $this->setFldForeignKey($value);
- break;
- case 11:
- $this->setFldForeignKeyTable($value);
- break;
- case 12:
- $this->setFldDynName($value);
- break;
- case 13:
- $this->setFldDynUid($value);
- break;
- case 14:
- $this->setFldFilter($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = FieldsPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setFldUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAddTabUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setFldIndex($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setFldName($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setFldDescription($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setFldType($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setFldSize($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setFldNull($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setFldAutoIncrement($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setFldKey($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setFldForeignKey($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setFldForeignKeyTable($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setFldDynName($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setFldDynUid($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setFldFilter($arr[$keys[14]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(FieldsPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(FieldsPeer::FLD_UID)) $criteria->add(FieldsPeer::FLD_UID, $this->fld_uid);
- if ($this->isColumnModified(FieldsPeer::ADD_TAB_UID)) $criteria->add(FieldsPeer::ADD_TAB_UID, $this->add_tab_uid);
- if ($this->isColumnModified(FieldsPeer::FLD_INDEX)) $criteria->add(FieldsPeer::FLD_INDEX, $this->fld_index);
- if ($this->isColumnModified(FieldsPeer::FLD_NAME)) $criteria->add(FieldsPeer::FLD_NAME, $this->fld_name);
- if ($this->isColumnModified(FieldsPeer::FLD_DESCRIPTION)) $criteria->add(FieldsPeer::FLD_DESCRIPTION, $this->fld_description);
- if ($this->isColumnModified(FieldsPeer::FLD_TYPE)) $criteria->add(FieldsPeer::FLD_TYPE, $this->fld_type);
- if ($this->isColumnModified(FieldsPeer::FLD_SIZE)) $criteria->add(FieldsPeer::FLD_SIZE, $this->fld_size);
- if ($this->isColumnModified(FieldsPeer::FLD_NULL)) $criteria->add(FieldsPeer::FLD_NULL, $this->fld_null);
- if ($this->isColumnModified(FieldsPeer::FLD_AUTO_INCREMENT)) $criteria->add(FieldsPeer::FLD_AUTO_INCREMENT, $this->fld_auto_increment);
- if ($this->isColumnModified(FieldsPeer::FLD_KEY)) $criteria->add(FieldsPeer::FLD_KEY, $this->fld_key);
- if ($this->isColumnModified(FieldsPeer::FLD_FOREIGN_KEY)) $criteria->add(FieldsPeer::FLD_FOREIGN_KEY, $this->fld_foreign_key);
- if ($this->isColumnModified(FieldsPeer::FLD_FOREIGN_KEY_TABLE)) $criteria->add(FieldsPeer::FLD_FOREIGN_KEY_TABLE, $this->fld_foreign_key_table);
- if ($this->isColumnModified(FieldsPeer::FLD_DYN_NAME)) $criteria->add(FieldsPeer::FLD_DYN_NAME, $this->fld_dyn_name);
- if ($this->isColumnModified(FieldsPeer::FLD_DYN_UID)) $criteria->add(FieldsPeer::FLD_DYN_UID, $this->fld_dyn_uid);
- if ($this->isColumnModified(FieldsPeer::FLD_FILTER)) $criteria->add(FieldsPeer::FLD_FILTER, $this->fld_filter);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(FieldsPeer::DATABASE_NAME);
-
- $criteria->add(FieldsPeer::FLD_UID, $this->fld_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getFldUid();
- }
-
- /**
- * Generic method to set the primary key (fld_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setFldUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Fields (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAddTabUid($this->add_tab_uid);
-
- $copyObj->setFldIndex($this->fld_index);
-
- $copyObj->setFldName($this->fld_name);
-
- $copyObj->setFldDescription($this->fld_description);
-
- $copyObj->setFldType($this->fld_type);
-
- $copyObj->setFldSize($this->fld_size);
-
- $copyObj->setFldNull($this->fld_null);
-
- $copyObj->setFldAutoIncrement($this->fld_auto_increment);
-
- $copyObj->setFldKey($this->fld_key);
-
- $copyObj->setFldForeignKey($this->fld_foreign_key);
-
- $copyObj->setFldForeignKeyTable($this->fld_foreign_key_table);
-
- $copyObj->setFldDynName($this->fld_dyn_name);
-
- $copyObj->setFldDynUid($this->fld_dyn_uid);
-
- $copyObj->setFldFilter($this->fld_filter);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setFldUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Fields Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return FieldsPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new FieldsPeer();
- }
- return self::$peer;
- }
-
-} // BaseFields
diff --git a/workflow/engine/classes/model/om/BaseFieldsPeer.php b/workflow/engine/classes/model/om/BaseFieldsPeer.php
index bdff52692..1b8eb5a6f 100755
--- a/workflow/engine/classes/model/om/BaseFieldsPeer.php
+++ b/workflow/engine/classes/model/om/BaseFieldsPeer.php
@@ -12,624 +12,626 @@ include_once 'classes/model/Fields.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseFieldsPeer {
+abstract class BaseFieldsPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'FIELDS';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Fields';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 15;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the FLD_UID field */
+ const FLD_UID = 'FIELDS.FLD_UID';
+
+ /** the column name for the ADD_TAB_UID field */
+ const ADD_TAB_UID = 'FIELDS.ADD_TAB_UID';
+
+ /** the column name for the FLD_INDEX field */
+ const FLD_INDEX = 'FIELDS.FLD_INDEX';
+
+ /** the column name for the FLD_NAME field */
+ const FLD_NAME = 'FIELDS.FLD_NAME';
+
+ /** the column name for the FLD_DESCRIPTION field */
+ const FLD_DESCRIPTION = 'FIELDS.FLD_DESCRIPTION';
+
+ /** the column name for the FLD_TYPE field */
+ const FLD_TYPE = 'FIELDS.FLD_TYPE';
+
+ /** the column name for the FLD_SIZE field */
+ const FLD_SIZE = 'FIELDS.FLD_SIZE';
+
+ /** the column name for the FLD_NULL field */
+ const FLD_NULL = 'FIELDS.FLD_NULL';
+
+ /** the column name for the FLD_AUTO_INCREMENT field */
+ const FLD_AUTO_INCREMENT = 'FIELDS.FLD_AUTO_INCREMENT';
+
+ /** the column name for the FLD_KEY field */
+ const FLD_KEY = 'FIELDS.FLD_KEY';
+
+ /** the column name for the FLD_FOREIGN_KEY field */
+ const FLD_FOREIGN_KEY = 'FIELDS.FLD_FOREIGN_KEY';
+
+ /** the column name for the FLD_FOREIGN_KEY_TABLE field */
+ const FLD_FOREIGN_KEY_TABLE = 'FIELDS.FLD_FOREIGN_KEY_TABLE';
+
+ /** the column name for the FLD_DYN_NAME field */
+ const FLD_DYN_NAME = 'FIELDS.FLD_DYN_NAME';
+
+ /** the column name for the FLD_DYN_UID field */
+ const FLD_DYN_UID = 'FIELDS.FLD_DYN_UID';
+
+ /** the column name for the FLD_FILTER field */
+ const FLD_FILTER = 'FIELDS.FLD_FILTER';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('FldUid', 'AddTabUid', 'FldIndex', 'FldName', 'FldDescription', 'FldType', 'FldSize', 'FldNull', 'FldAutoIncrement', 'FldKey', 'FldForeignKey', 'FldForeignKeyTable', 'FldDynName', 'FldDynUid', 'FldFilter', ),
+ BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID, FieldsPeer::ADD_TAB_UID, FieldsPeer::FLD_INDEX, FieldsPeer::FLD_NAME, FieldsPeer::FLD_DESCRIPTION, FieldsPeer::FLD_TYPE, FieldsPeer::FLD_SIZE, FieldsPeer::FLD_NULL, FieldsPeer::FLD_AUTO_INCREMENT, FieldsPeer::FLD_KEY, FieldsPeer::FLD_FOREIGN_KEY, FieldsPeer::FLD_FOREIGN_KEY_TABLE, FieldsPeer::FLD_DYN_NAME, FieldsPeer::FLD_DYN_UID, FieldsPeer::FLD_FILTER, ),
+ BasePeer::TYPE_FIELDNAME => array ('FLD_UID', 'ADD_TAB_UID', 'FLD_INDEX', 'FLD_NAME', 'FLD_DESCRIPTION', 'FLD_TYPE', 'FLD_SIZE', 'FLD_NULL', 'FLD_AUTO_INCREMENT', 'FLD_KEY', 'FLD_FOREIGN_KEY', 'FLD_FOREIGN_KEY_TABLE', 'FLD_DYN_NAME', 'FLD_DYN_UID', 'FLD_FILTER', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('FldUid' => 0, 'AddTabUid' => 1, 'FldIndex' => 2, 'FldName' => 3, 'FldDescription' => 4, 'FldType' => 5, 'FldSize' => 6, 'FldNull' => 7, 'FldAutoIncrement' => 8, 'FldKey' => 9, 'FldForeignKey' => 10, 'FldForeignKeyTable' => 11, 'FldDynName' => 12, 'FldDynUid' => 13, 'FldFilter' => 14, ),
+ BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID => 0, FieldsPeer::ADD_TAB_UID => 1, FieldsPeer::FLD_INDEX => 2, FieldsPeer::FLD_NAME => 3, FieldsPeer::FLD_DESCRIPTION => 4, FieldsPeer::FLD_TYPE => 5, FieldsPeer::FLD_SIZE => 6, FieldsPeer::FLD_NULL => 7, FieldsPeer::FLD_AUTO_INCREMENT => 8, FieldsPeer::FLD_KEY => 9, FieldsPeer::FLD_FOREIGN_KEY => 10, FieldsPeer::FLD_FOREIGN_KEY_TABLE => 11, FieldsPeer::FLD_DYN_NAME => 12, FieldsPeer::FLD_DYN_UID => 13, FieldsPeer::FLD_FILTER => 14, ),
+ BasePeer::TYPE_FIELDNAME => array ('FLD_UID' => 0, 'ADD_TAB_UID' => 1, 'FLD_INDEX' => 2, 'FLD_NAME' => 3, 'FLD_DESCRIPTION' => 4, 'FLD_TYPE' => 5, 'FLD_SIZE' => 6, 'FLD_NULL' => 7, 'FLD_AUTO_INCREMENT' => 8, 'FLD_KEY' => 9, 'FLD_FOREIGN_KEY' => 10, 'FLD_FOREIGN_KEY_TABLE' => 11, 'FLD_DYN_NAME' => 12, 'FLD_DYN_UID' => 13, 'FLD_FILTER' => 14, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/FieldsMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.FieldsMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = FieldsPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. FieldsPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(FieldsPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_UID);
+
+ $criteria->addSelectColumn(FieldsPeer::ADD_TAB_UID);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_INDEX);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_NAME);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_DESCRIPTION);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_TYPE);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_SIZE);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_NULL);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_AUTO_INCREMENT);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_KEY);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_FOREIGN_KEY);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_FOREIGN_KEY_TABLE);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_DYN_NAME);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_DYN_UID);
+
+ $criteria->addSelectColumn(FieldsPeer::FLD_FILTER);
+
+ }
+
+ const COUNT = 'COUNT(FIELDS.FLD_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT FIELDS.FLD_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(FieldsPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(FieldsPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = FieldsPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Fields
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = FieldsPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return FieldsPeer::populateObjects(FieldsPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ FieldsPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = FieldsPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return FieldsPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Fields or Criteria object.
+ *
+ * @param mixed $values Criteria or Fields object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Fields object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Fields or Criteria object.
+ *
+ * @param mixed $values Criteria or Fields object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(FieldsPeer::FLD_UID);
+ $selectCriteria->add(FieldsPeer::FLD_UID, $criteria->remove(FieldsPeer::FLD_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the FIELDS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(FieldsPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Fields or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Fields object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(FieldsPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Fields) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(FieldsPeer::FLD_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Fields object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Fields $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Fields $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(FieldsPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(FieldsPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(FieldsPeer::DATABASE_NAME, FieldsPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Fields
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(FieldsPeer::DATABASE_NAME);
+
+ $criteria->add(FieldsPeer::FLD_UID, $pk);
+
+
+ $v = FieldsPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(FieldsPeer::FLD_UID, $pks, Criteria::IN);
+ $objs = FieldsPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** the table name for this class */
- const TABLE_NAME = 'FIELDS';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Fields';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 15;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the FLD_UID field */
- const FLD_UID = 'FIELDS.FLD_UID';
-
- /** the column name for the ADD_TAB_UID field */
- const ADD_TAB_UID = 'FIELDS.ADD_TAB_UID';
-
- /** the column name for the FLD_INDEX field */
- const FLD_INDEX = 'FIELDS.FLD_INDEX';
-
- /** the column name for the FLD_NAME field */
- const FLD_NAME = 'FIELDS.FLD_NAME';
-
- /** the column name for the FLD_DESCRIPTION field */
- const FLD_DESCRIPTION = 'FIELDS.FLD_DESCRIPTION';
-
- /** the column name for the FLD_TYPE field */
- const FLD_TYPE = 'FIELDS.FLD_TYPE';
-
- /** the column name for the FLD_SIZE field */
- const FLD_SIZE = 'FIELDS.FLD_SIZE';
-
- /** the column name for the FLD_NULL field */
- const FLD_NULL = 'FIELDS.FLD_NULL';
-
- /** the column name for the FLD_AUTO_INCREMENT field */
- const FLD_AUTO_INCREMENT = 'FIELDS.FLD_AUTO_INCREMENT';
-
- /** the column name for the FLD_KEY field */
- const FLD_KEY = 'FIELDS.FLD_KEY';
-
- /** the column name for the FLD_FOREIGN_KEY field */
- const FLD_FOREIGN_KEY = 'FIELDS.FLD_FOREIGN_KEY';
-
- /** the column name for the FLD_FOREIGN_KEY_TABLE field */
- const FLD_FOREIGN_KEY_TABLE = 'FIELDS.FLD_FOREIGN_KEY_TABLE';
-
- /** the column name for the FLD_DYN_NAME field */
- const FLD_DYN_NAME = 'FIELDS.FLD_DYN_NAME';
-
- /** the column name for the FLD_DYN_UID field */
- const FLD_DYN_UID = 'FIELDS.FLD_DYN_UID';
-
- /** the column name for the FLD_FILTER field */
- const FLD_FILTER = 'FIELDS.FLD_FILTER';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('FldUid', 'AddTabUid', 'FldIndex', 'FldName', 'FldDescription', 'FldType', 'FldSize', 'FldNull', 'FldAutoIncrement', 'FldKey', 'FldForeignKey', 'FldForeignKeyTable', 'FldDynName', 'FldDynUid', 'FldFilter', ),
- BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID, FieldsPeer::ADD_TAB_UID, FieldsPeer::FLD_INDEX, FieldsPeer::FLD_NAME, FieldsPeer::FLD_DESCRIPTION, FieldsPeer::FLD_TYPE, FieldsPeer::FLD_SIZE, FieldsPeer::FLD_NULL, FieldsPeer::FLD_AUTO_INCREMENT, FieldsPeer::FLD_KEY, FieldsPeer::FLD_FOREIGN_KEY, FieldsPeer::FLD_FOREIGN_KEY_TABLE, FieldsPeer::FLD_DYN_NAME, FieldsPeer::FLD_DYN_UID, FieldsPeer::FLD_FILTER, ),
- BasePeer::TYPE_FIELDNAME => array ('FLD_UID', 'ADD_TAB_UID', 'FLD_INDEX', 'FLD_NAME', 'FLD_DESCRIPTION', 'FLD_TYPE', 'FLD_SIZE', 'FLD_NULL', 'FLD_AUTO_INCREMENT', 'FLD_KEY', 'FLD_FOREIGN_KEY', 'FLD_FOREIGN_KEY_TABLE', 'FLD_DYN_NAME', 'FLD_DYN_UID', 'FLD_FILTER', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('FldUid' => 0, 'AddTabUid' => 1, 'FldIndex' => 2, 'FldName' => 3, 'FldDescription' => 4, 'FldType' => 5, 'FldSize' => 6, 'FldNull' => 7, 'FldAutoIncrement' => 8, 'FldKey' => 9, 'FldForeignKey' => 10, 'FldForeignKeyTable' => 11, 'FldDynName' => 12, 'FldDynUid' => 13, 'FldFilter' => 14, ),
- BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID => 0, FieldsPeer::ADD_TAB_UID => 1, FieldsPeer::FLD_INDEX => 2, FieldsPeer::FLD_NAME => 3, FieldsPeer::FLD_DESCRIPTION => 4, FieldsPeer::FLD_TYPE => 5, FieldsPeer::FLD_SIZE => 6, FieldsPeer::FLD_NULL => 7, FieldsPeer::FLD_AUTO_INCREMENT => 8, FieldsPeer::FLD_KEY => 9, FieldsPeer::FLD_FOREIGN_KEY => 10, FieldsPeer::FLD_FOREIGN_KEY_TABLE => 11, FieldsPeer::FLD_DYN_NAME => 12, FieldsPeer::FLD_DYN_UID => 13, FieldsPeer::FLD_FILTER => 14, ),
- BasePeer::TYPE_FIELDNAME => array ('FLD_UID' => 0, 'ADD_TAB_UID' => 1, 'FLD_INDEX' => 2, 'FLD_NAME' => 3, 'FLD_DESCRIPTION' => 4, 'FLD_TYPE' => 5, 'FLD_SIZE' => 6, 'FLD_NULL' => 7, 'FLD_AUTO_INCREMENT' => 8, 'FLD_KEY' => 9, 'FLD_FOREIGN_KEY' => 10, 'FLD_FOREIGN_KEY_TABLE' => 11, 'FLD_DYN_NAME' => 12, 'FLD_DYN_UID' => 13, 'FLD_FILTER' => 14, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/FieldsMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.FieldsMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = FieldsPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. FieldsPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(FieldsPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(FieldsPeer::FLD_UID);
-
- $criteria->addSelectColumn(FieldsPeer::ADD_TAB_UID);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_INDEX);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_NAME);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_DESCRIPTION);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_TYPE);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_SIZE);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_NULL);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_AUTO_INCREMENT);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_KEY);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_FOREIGN_KEY);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_FOREIGN_KEY_TABLE);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_DYN_NAME);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_DYN_UID);
-
- $criteria->addSelectColumn(FieldsPeer::FLD_FILTER);
-
- }
-
- const COUNT = 'COUNT(FIELDS.FLD_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT FIELDS.FLD_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(FieldsPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(FieldsPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = FieldsPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Fields
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = FieldsPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return FieldsPeer::populateObjects(FieldsPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- FieldsPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = FieldsPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return FieldsPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Fields or Criteria object.
- *
- * @param mixed $values Criteria or Fields object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Fields object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Fields or Criteria object.
- *
- * @param mixed $values Criteria or Fields object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(FieldsPeer::FLD_UID);
- $selectCriteria->add(FieldsPeer::FLD_UID, $criteria->remove(FieldsPeer::FLD_UID), $comparison);
-
- } else { // $values is Fields object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the FIELDS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(FieldsPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Fields or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Fields object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(FieldsPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Fields) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(FieldsPeer::FLD_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Fields object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Fields $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Fields $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(FieldsPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(FieldsPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(FieldsPeer::DATABASE_NAME, FieldsPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Fields
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(FieldsPeer::DATABASE_NAME);
-
- $criteria->add(FieldsPeer::FLD_UID, $pk);
-
-
- $v = FieldsPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(FieldsPeer::FLD_UID, $pks, Criteria::IN);
- $objs = FieldsPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseFieldsPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseFieldsPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseFieldsPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/FieldsMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.FieldsMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/FieldsMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.FieldsMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseGateway.php b/workflow/engine/classes/model/om/BaseGateway.php
index c276c45de..563aff761 100755
--- a/workflow/engine/classes/model/om/BaseGateway.php
+++ b/workflow/engine/classes/model/om/BaseGateway.php
@@ -16,807 +16,843 @@ include_once 'classes/model/GatewayPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseGateway extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var GatewayPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the gat_uid field.
- * @var string
- */
- protected $gat_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
-
-
- /**
- * The value for the gat_next_task field.
- * @var string
- */
- protected $gat_next_task = '';
-
-
- /**
- * The value for the gat_x field.
- * @var int
- */
- protected $gat_x = 0;
-
-
- /**
- * The value for the gat_y field.
- * @var int
- */
- protected $gat_y = 0;
-
-
- /**
- * The value for the gat_type field.
- * @var string
- */
- protected $gat_type = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [gat_uid] column value.
- *
- * @return string
- */
- public function getGatUid()
- {
-
- return $this->gat_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [gat_next_task] column value.
- *
- * @return string
- */
- public function getGatNextTask()
- {
-
- return $this->gat_next_task;
- }
-
- /**
- * Get the [gat_x] column value.
- *
- * @return int
- */
- public function getGatX()
- {
-
- return $this->gat_x;
- }
-
- /**
- * Get the [gat_y] column value.
- *
- * @return int
- */
- public function getGatY()
- {
-
- return $this->gat_y;
- }
-
- /**
- * Get the [gat_type] column value.
- *
- * @return string
- */
- public function getGatType()
- {
-
- return $this->gat_type;
- }
-
- /**
- * Set the value of [gat_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGatUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->gat_uid !== $v || $v === '') {
- $this->gat_uid = $v;
- $this->modifiedColumns[] = GatewayPeer::GAT_UID;
- }
-
- } // setGatUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = GatewayPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = GatewayPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [gat_next_task] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGatNextTask($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->gat_next_task !== $v || $v === '') {
- $this->gat_next_task = $v;
- $this->modifiedColumns[] = GatewayPeer::GAT_NEXT_TASK;
- }
-
- } // setGatNextTask()
-
- /**
- * Set the value of [gat_x] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setGatX($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->gat_x !== $v || $v === 0) {
- $this->gat_x = $v;
- $this->modifiedColumns[] = GatewayPeer::GAT_X;
- }
-
- } // setGatX()
-
- /**
- * Set the value of [gat_y] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setGatY($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->gat_y !== $v || $v === 0) {
- $this->gat_y = $v;
- $this->modifiedColumns[] = GatewayPeer::GAT_Y;
- }
-
- } // setGatY()
-
- /**
- * Set the value of [gat_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGatType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->gat_type !== $v || $v === '') {
- $this->gat_type = $v;
- $this->modifiedColumns[] = GatewayPeer::GAT_TYPE;
- }
-
- } // setGatType()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->gat_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->tas_uid = $rs->getString($startcol + 2);
-
- $this->gat_next_task = $rs->getString($startcol + 3);
-
- $this->gat_x = $rs->getInt($startcol + 4);
-
- $this->gat_y = $rs->getInt($startcol + 5);
-
- $this->gat_type = $rs->getString($startcol + 6);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 7; // 7 = GatewayPeer::NUM_COLUMNS - GatewayPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Gateway object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- GatewayPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = GatewayPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += GatewayPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = GatewayPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = GatewayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getGatUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getTasUid();
- break;
- case 3:
- return $this->getGatNextTask();
- break;
- case 4:
- return $this->getGatX();
- break;
- case 5:
- return $this->getGatY();
- break;
- case 6:
- return $this->getGatType();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = GatewayPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getGatUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getTasUid(),
- $keys[3] => $this->getGatNextTask(),
- $keys[4] => $this->getGatX(),
- $keys[5] => $this->getGatY(),
- $keys[6] => $this->getGatType(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = GatewayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setGatUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setTasUid($value);
- break;
- case 3:
- $this->setGatNextTask($value);
- break;
- case 4:
- $this->setGatX($value);
- break;
- case 5:
- $this->setGatY($value);
- break;
- case 6:
- $this->setGatType($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = GatewayPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setGatUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTasUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setGatNextTask($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setGatX($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setGatY($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setGatType($arr[$keys[6]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(GatewayPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(GatewayPeer::GAT_UID)) $criteria->add(GatewayPeer::GAT_UID, $this->gat_uid);
- if ($this->isColumnModified(GatewayPeer::PRO_UID)) $criteria->add(GatewayPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(GatewayPeer::TAS_UID)) $criteria->add(GatewayPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(GatewayPeer::GAT_NEXT_TASK)) $criteria->add(GatewayPeer::GAT_NEXT_TASK, $this->gat_next_task);
- if ($this->isColumnModified(GatewayPeer::GAT_X)) $criteria->add(GatewayPeer::GAT_X, $this->gat_x);
- if ($this->isColumnModified(GatewayPeer::GAT_Y)) $criteria->add(GatewayPeer::GAT_Y, $this->gat_y);
- if ($this->isColumnModified(GatewayPeer::GAT_TYPE)) $criteria->add(GatewayPeer::GAT_TYPE, $this->gat_type);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(GatewayPeer::DATABASE_NAME);
-
- $criteria->add(GatewayPeer::GAT_UID, $this->gat_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getGatUid();
- }
-
- /**
- * Generic method to set the primary key (gat_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setGatUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Gateway (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setGatNextTask($this->gat_next_task);
-
- $copyObj->setGatX($this->gat_x);
-
- $copyObj->setGatY($this->gat_y);
-
- $copyObj->setGatType($this->gat_type);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setGatUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Gateway Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return GatewayPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new GatewayPeer();
- }
- return self::$peer;
- }
-
-} // BaseGateway
+abstract class BaseGateway extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var GatewayPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the gat_uid field.
+ * @var string
+ */
+ protected $gat_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the gat_next_task field.
+ * @var string
+ */
+ protected $gat_next_task = '';
+
+ /**
+ * The value for the gat_x field.
+ * @var int
+ */
+ protected $gat_x = 0;
+
+ /**
+ * The value for the gat_y field.
+ * @var int
+ */
+ protected $gat_y = 0;
+
+ /**
+ * The value for the gat_type field.
+ * @var string
+ */
+ protected $gat_type = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [gat_uid] column value.
+ *
+ * @return string
+ */
+ public function getGatUid()
+ {
+
+ return $this->gat_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [gat_next_task] column value.
+ *
+ * @return string
+ */
+ public function getGatNextTask()
+ {
+
+ return $this->gat_next_task;
+ }
+
+ /**
+ * Get the [gat_x] column value.
+ *
+ * @return int
+ */
+ public function getGatX()
+ {
+
+ return $this->gat_x;
+ }
+
+ /**
+ * Get the [gat_y] column value.
+ *
+ * @return int
+ */
+ public function getGatY()
+ {
+
+ return $this->gat_y;
+ }
+
+ /**
+ * Get the [gat_type] column value.
+ *
+ * @return string
+ */
+ public function getGatType()
+ {
+
+ return $this->gat_type;
+ }
+
+ /**
+ * Set the value of [gat_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGatUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->gat_uid !== $v || $v === '') {
+ $this->gat_uid = $v;
+ $this->modifiedColumns[] = GatewayPeer::GAT_UID;
+ }
+
+ } // setGatUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = GatewayPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = GatewayPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [gat_next_task] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGatNextTask($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->gat_next_task !== $v || $v === '') {
+ $this->gat_next_task = $v;
+ $this->modifiedColumns[] = GatewayPeer::GAT_NEXT_TASK;
+ }
+
+ } // setGatNextTask()
+
+ /**
+ * Set the value of [gat_x] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setGatX($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->gat_x !== $v || $v === 0) {
+ $this->gat_x = $v;
+ $this->modifiedColumns[] = GatewayPeer::GAT_X;
+ }
+
+ } // setGatX()
+
+ /**
+ * Set the value of [gat_y] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setGatY($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->gat_y !== $v || $v === 0) {
+ $this->gat_y = $v;
+ $this->modifiedColumns[] = GatewayPeer::GAT_Y;
+ }
+
+ } // setGatY()
+
+ /**
+ * Set the value of [gat_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGatType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->gat_type !== $v || $v === '') {
+ $this->gat_type = $v;
+ $this->modifiedColumns[] = GatewayPeer::GAT_TYPE;
+ }
+
+ } // setGatType()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->gat_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->tas_uid = $rs->getString($startcol + 2);
+
+ $this->gat_next_task = $rs->getString($startcol + 3);
+
+ $this->gat_x = $rs->getInt($startcol + 4);
+
+ $this->gat_y = $rs->getInt($startcol + 5);
+
+ $this->gat_type = $rs->getString($startcol + 6);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 7; // 7 = GatewayPeer::NUM_COLUMNS - GatewayPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Gateway object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ GatewayPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = GatewayPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += GatewayPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = GatewayPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = GatewayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getGatUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getTasUid();
+ break;
+ case 3:
+ return $this->getGatNextTask();
+ break;
+ case 4:
+ return $this->getGatX();
+ break;
+ case 5:
+ return $this->getGatY();
+ break;
+ case 6:
+ return $this->getGatType();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = GatewayPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getGatUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getTasUid(),
+ $keys[3] => $this->getGatNextTask(),
+ $keys[4] => $this->getGatX(),
+ $keys[5] => $this->getGatY(),
+ $keys[6] => $this->getGatType(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = GatewayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setGatUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setTasUid($value);
+ break;
+ case 3:
+ $this->setGatNextTask($value);
+ break;
+ case 4:
+ $this->setGatX($value);
+ break;
+ case 5:
+ $this->setGatY($value);
+ break;
+ case 6:
+ $this->setGatType($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = GatewayPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setGatUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTasUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setGatNextTask($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setGatX($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setGatY($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setGatType($arr[$keys[6]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(GatewayPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(GatewayPeer::GAT_UID)) {
+ $criteria->add(GatewayPeer::GAT_UID, $this->gat_uid);
+ }
+
+ if ($this->isColumnModified(GatewayPeer::PRO_UID)) {
+ $criteria->add(GatewayPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(GatewayPeer::TAS_UID)) {
+ $criteria->add(GatewayPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(GatewayPeer::GAT_NEXT_TASK)) {
+ $criteria->add(GatewayPeer::GAT_NEXT_TASK, $this->gat_next_task);
+ }
+
+ if ($this->isColumnModified(GatewayPeer::GAT_X)) {
+ $criteria->add(GatewayPeer::GAT_X, $this->gat_x);
+ }
+
+ if ($this->isColumnModified(GatewayPeer::GAT_Y)) {
+ $criteria->add(GatewayPeer::GAT_Y, $this->gat_y);
+ }
+
+ if ($this->isColumnModified(GatewayPeer::GAT_TYPE)) {
+ $criteria->add(GatewayPeer::GAT_TYPE, $this->gat_type);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(GatewayPeer::DATABASE_NAME);
+
+ $criteria->add(GatewayPeer::GAT_UID, $this->gat_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getGatUid();
+ }
+
+ /**
+ * Generic method to set the primary key (gat_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setGatUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Gateway (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTasUid($this->tas_uid);
+
+ $copyObj->setGatNextTask($this->gat_next_task);
+
+ $copyObj->setGatX($this->gat_x);
+
+ $copyObj->setGatY($this->gat_y);
+
+ $copyObj->setGatType($this->gat_type);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setGatUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Gateway Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return GatewayPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new GatewayPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseGatewayPeer.php b/workflow/engine/classes/model/om/BaseGatewayPeer.php
index 20bbc4e6a..67319cc47 100755
--- a/workflow/engine/classes/model/om/BaseGatewayPeer.php
+++ b/workflow/engine/classes/model/om/BaseGatewayPeer.php
@@ -12,590 +12,592 @@ include_once 'classes/model/Gateway.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseGatewayPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'GATEWAY';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Gateway';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 7;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the GAT_UID field */
- const GAT_UID = 'GATEWAY.GAT_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'GATEWAY.PRO_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'GATEWAY.TAS_UID';
-
- /** the column name for the GAT_NEXT_TASK field */
- const GAT_NEXT_TASK = 'GATEWAY.GAT_NEXT_TASK';
-
- /** the column name for the GAT_X field */
- const GAT_X = 'GATEWAY.GAT_X';
-
- /** the column name for the GAT_Y field */
- const GAT_Y = 'GATEWAY.GAT_Y';
-
- /** the column name for the GAT_TYPE field */
- const GAT_TYPE = 'GATEWAY.GAT_TYPE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('GatUid', 'ProUid', 'TasUid', 'GatNextTask', 'GatX', 'GatY', 'GatType', ),
- BasePeer::TYPE_COLNAME => array (GatewayPeer::GAT_UID, GatewayPeer::PRO_UID, GatewayPeer::TAS_UID, GatewayPeer::GAT_NEXT_TASK, GatewayPeer::GAT_X, GatewayPeer::GAT_Y, GatewayPeer::GAT_TYPE, ),
- BasePeer::TYPE_FIELDNAME => array ('GAT_UID', 'PRO_UID', 'TAS_UID', 'GAT_NEXT_TASK', 'GAT_X', 'GAT_Y', 'GAT_TYPE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('GatUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'GatNextTask' => 3, 'GatX' => 4, 'GatY' => 5, 'GatType' => 6, ),
- BasePeer::TYPE_COLNAME => array (GatewayPeer::GAT_UID => 0, GatewayPeer::PRO_UID => 1, GatewayPeer::TAS_UID => 2, GatewayPeer::GAT_NEXT_TASK => 3, GatewayPeer::GAT_X => 4, GatewayPeer::GAT_Y => 5, GatewayPeer::GAT_TYPE => 6, ),
- BasePeer::TYPE_FIELDNAME => array ('GAT_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'GAT_NEXT_TASK' => 3, 'GAT_X' => 4, 'GAT_Y' => 5, 'GAT_TYPE' => 6, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/GatewayMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.GatewayMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = GatewayPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. GatewayPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(GatewayPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(GatewayPeer::GAT_UID);
-
- $criteria->addSelectColumn(GatewayPeer::PRO_UID);
-
- $criteria->addSelectColumn(GatewayPeer::TAS_UID);
-
- $criteria->addSelectColumn(GatewayPeer::GAT_NEXT_TASK);
-
- $criteria->addSelectColumn(GatewayPeer::GAT_X);
-
- $criteria->addSelectColumn(GatewayPeer::GAT_Y);
-
- $criteria->addSelectColumn(GatewayPeer::GAT_TYPE);
-
- }
-
- const COUNT = 'COUNT(GATEWAY.GAT_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT GATEWAY.GAT_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(GatewayPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(GatewayPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = GatewayPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Gateway
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = GatewayPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return GatewayPeer::populateObjects(GatewayPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- GatewayPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = GatewayPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return GatewayPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Gateway or Criteria object.
- *
- * @param mixed $values Criteria or Gateway object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Gateway object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Gateway or Criteria object.
- *
- * @param mixed $values Criteria or Gateway object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(GatewayPeer::GAT_UID);
- $selectCriteria->add(GatewayPeer::GAT_UID, $criteria->remove(GatewayPeer::GAT_UID), $comparison);
-
- } else { // $values is Gateway object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the GATEWAY table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(GatewayPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Gateway or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Gateway object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Gateway) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(GatewayPeer::GAT_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Gateway object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Gateway $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Gateway $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(GatewayPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(GatewayPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(GatewayPeer::GAT_UID))
- $columns[GatewayPeer::GAT_UID] = $obj->getGatUid();
-
- if ($obj->isNew() || $obj->isColumnModified(GatewayPeer::PRO_UID))
- $columns[GatewayPeer::PRO_UID] = $obj->getProUid();
-
- }
-
- return BasePeer::doValidate(GatewayPeer::DATABASE_NAME, GatewayPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Gateway
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(GatewayPeer::DATABASE_NAME);
-
- $criteria->add(GatewayPeer::GAT_UID, $pk);
-
-
- $v = GatewayPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(GatewayPeer::GAT_UID, $pks, Criteria::IN);
- $objs = GatewayPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseGatewayPeer
+abstract class BaseGatewayPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'GATEWAY';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Gateway';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 7;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the GAT_UID field */
+ const GAT_UID = 'GATEWAY.GAT_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'GATEWAY.PRO_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'GATEWAY.TAS_UID';
+
+ /** the column name for the GAT_NEXT_TASK field */
+ const GAT_NEXT_TASK = 'GATEWAY.GAT_NEXT_TASK';
+
+ /** the column name for the GAT_X field */
+ const GAT_X = 'GATEWAY.GAT_X';
+
+ /** the column name for the GAT_Y field */
+ const GAT_Y = 'GATEWAY.GAT_Y';
+
+ /** the column name for the GAT_TYPE field */
+ const GAT_TYPE = 'GATEWAY.GAT_TYPE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('GatUid', 'ProUid', 'TasUid', 'GatNextTask', 'GatX', 'GatY', 'GatType', ),
+ BasePeer::TYPE_COLNAME => array (GatewayPeer::GAT_UID, GatewayPeer::PRO_UID, GatewayPeer::TAS_UID, GatewayPeer::GAT_NEXT_TASK, GatewayPeer::GAT_X, GatewayPeer::GAT_Y, GatewayPeer::GAT_TYPE, ),
+ BasePeer::TYPE_FIELDNAME => array ('GAT_UID', 'PRO_UID', 'TAS_UID', 'GAT_NEXT_TASK', 'GAT_X', 'GAT_Y', 'GAT_TYPE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('GatUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'GatNextTask' => 3, 'GatX' => 4, 'GatY' => 5, 'GatType' => 6, ),
+ BasePeer::TYPE_COLNAME => array (GatewayPeer::GAT_UID => 0, GatewayPeer::PRO_UID => 1, GatewayPeer::TAS_UID => 2, GatewayPeer::GAT_NEXT_TASK => 3, GatewayPeer::GAT_X => 4, GatewayPeer::GAT_Y => 5, GatewayPeer::GAT_TYPE => 6, ),
+ BasePeer::TYPE_FIELDNAME => array ('GAT_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'GAT_NEXT_TASK' => 3, 'GAT_X' => 4, 'GAT_Y' => 5, 'GAT_TYPE' => 6, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/GatewayMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.GatewayMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = GatewayPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. GatewayPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(GatewayPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(GatewayPeer::GAT_UID);
+
+ $criteria->addSelectColumn(GatewayPeer::PRO_UID);
+
+ $criteria->addSelectColumn(GatewayPeer::TAS_UID);
+
+ $criteria->addSelectColumn(GatewayPeer::GAT_NEXT_TASK);
+
+ $criteria->addSelectColumn(GatewayPeer::GAT_X);
+
+ $criteria->addSelectColumn(GatewayPeer::GAT_Y);
+
+ $criteria->addSelectColumn(GatewayPeer::GAT_TYPE);
+
+ }
+
+ const COUNT = 'COUNT(GATEWAY.GAT_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT GATEWAY.GAT_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(GatewayPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(GatewayPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = GatewayPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Gateway
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = GatewayPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return GatewayPeer::populateObjects(GatewayPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ GatewayPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = GatewayPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return GatewayPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Gateway or Criteria object.
+ *
+ * @param mixed $values Criteria or Gateway object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Gateway object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Gateway or Criteria object.
+ *
+ * @param mixed $values Criteria or Gateway object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(GatewayPeer::GAT_UID);
+ $selectCriteria->add(GatewayPeer::GAT_UID, $criteria->remove(GatewayPeer::GAT_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the GATEWAY table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(GatewayPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Gateway or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Gateway object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Gateway) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(GatewayPeer::GAT_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Gateway object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Gateway $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Gateway $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(GatewayPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(GatewayPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(GatewayPeer::GAT_UID))
+ $columns[GatewayPeer::GAT_UID] = $obj->getGatUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(GatewayPeer::PRO_UID))
+ $columns[GatewayPeer::PRO_UID] = $obj->getProUid();
+
+ }
+
+ return BasePeer::doValidate(GatewayPeer::DATABASE_NAME, GatewayPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Gateway
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(GatewayPeer::DATABASE_NAME);
+
+ $criteria->add(GatewayPeer::GAT_UID, $pk);
+
+
+ $v = GatewayPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(GatewayPeer::GAT_UID, $pks, Criteria::IN);
+ $objs = GatewayPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseGatewayPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseGatewayPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/GatewayMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.GatewayMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/GatewayMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.GatewayMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseGroupUser.php b/workflow/engine/classes/model/om/BaseGroupUser.php
index 801c34043..936011c3d 100755
--- a/workflow/engine/classes/model/om/BaseGroupUser.php
+++ b/workflow/engine/classes/model/om/BaseGroupUser.php
@@ -16,554 +16,565 @@ include_once 'classes/model/GroupUserPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseGroupUser extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var GroupUserPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the grp_uid field.
- * @var string
- */
- protected $grp_uid = '0';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '0';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [grp_uid] column value.
- *
- * @return string
- */
- public function getGrpUid()
- {
-
- return $this->grp_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Set the value of [grp_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGrpUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->grp_uid !== $v || $v === '0') {
- $this->grp_uid = $v;
- $this->modifiedColumns[] = GroupUserPeer::GRP_UID;
- }
-
- } // setGrpUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '0') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = GroupUserPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->grp_uid = $rs->getString($startcol + 0);
-
- $this->usr_uid = $rs->getString($startcol + 1);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 2; // 2 = GroupUserPeer::NUM_COLUMNS - GroupUserPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating GroupUser object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- GroupUserPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = GroupUserPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += GroupUserPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = GroupUserPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = GroupUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getGrpUid();
- break;
- case 1:
- return $this->getUsrUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = GroupUserPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getGrpUid(),
- $keys[1] => $this->getUsrUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = GroupUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setGrpUid($value);
- break;
- case 1:
- $this->setUsrUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = GroupUserPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setGrpUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setUsrUid($arr[$keys[1]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(GroupUserPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(GroupUserPeer::GRP_UID)) $criteria->add(GroupUserPeer::GRP_UID, $this->grp_uid);
- if ($this->isColumnModified(GroupUserPeer::USR_UID)) $criteria->add(GroupUserPeer::USR_UID, $this->usr_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(GroupUserPeer::DATABASE_NAME);
-
- $criteria->add(GroupUserPeer::GRP_UID, $this->grp_uid);
- $criteria->add(GroupUserPeer::USR_UID, $this->usr_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getGrpUid();
-
- $pks[1] = $this->getUsrUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setGrpUid($keys[0]);
-
- $this->setUsrUid($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of GroupUser (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
-
- $copyObj->setNew(true);
-
- $copyObj->setGrpUid('0'); // this is a pkey column, so set to default value
-
- $copyObj->setUsrUid('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return GroupUser Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return GroupUserPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new GroupUserPeer();
- }
- return self::$peer;
- }
-
-} // BaseGroupUser
+abstract class BaseGroupUser extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var GroupUserPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the grp_uid field.
+ * @var string
+ */
+ protected $grp_uid = '0';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '0';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [grp_uid] column value.
+ *
+ * @return string
+ */
+ public function getGrpUid()
+ {
+
+ return $this->grp_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Set the value of [grp_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGrpUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->grp_uid !== $v || $v === '0') {
+ $this->grp_uid = $v;
+ $this->modifiedColumns[] = GroupUserPeer::GRP_UID;
+ }
+
+ } // setGrpUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '0') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = GroupUserPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->grp_uid = $rs->getString($startcol + 0);
+
+ $this->usr_uid = $rs->getString($startcol + 1);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 2; // 2 = GroupUserPeer::NUM_COLUMNS - GroupUserPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating GroupUser object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ GroupUserPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = GroupUserPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += GroupUserPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = GroupUserPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = GroupUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getGrpUid();
+ break;
+ case 1:
+ return $this->getUsrUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = GroupUserPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getGrpUid(),
+ $keys[1] => $this->getUsrUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = GroupUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setGrpUid($value);
+ break;
+ case 1:
+ $this->setUsrUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = GroupUserPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setGrpUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setUsrUid($arr[$keys[1]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(GroupUserPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(GroupUserPeer::GRP_UID)) {
+ $criteria->add(GroupUserPeer::GRP_UID, $this->grp_uid);
+ }
+
+ if ($this->isColumnModified(GroupUserPeer::USR_UID)) {
+ $criteria->add(GroupUserPeer::USR_UID, $this->usr_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(GroupUserPeer::DATABASE_NAME);
+
+ $criteria->add(GroupUserPeer::GRP_UID, $this->grp_uid);
+ $criteria->add(GroupUserPeer::USR_UID, $this->usr_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getGrpUid();
+
+ $pks[1] = $this->getUsrUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setGrpUid($keys[0]);
+
+ $this->setUsrUid($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of GroupUser (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setGrpUid('0'); // this is a pkey column, so set to default value
+
+ $copyObj->setUsrUid('0'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return GroupUser Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return GroupUserPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new GroupUserPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseGroupUserPeer.php b/workflow/engine/classes/model/om/BaseGroupUserPeer.php
index 1fb3591ab..73deae7b2 100755
--- a/workflow/engine/classes/model/om/BaseGroupUserPeer.php
+++ b/workflow/engine/classes/model/om/BaseGroupUserPeer.php
@@ -12,556 +12,557 @@ include_once 'classes/model/GroupUser.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseGroupUserPeer {
+abstract class BaseGroupUserPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'GROUP_USER';
+ /** the table name for this class */
+ const TABLE_NAME = 'GROUP_USER';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.GroupUser';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.GroupUser';
- /** The total number of columns. */
- const NUM_COLUMNS = 2;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 2;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the GRP_UID field */
- const GRP_UID = 'GROUP_USER.GRP_UID';
+ /** the column name for the GRP_UID field */
+ const GRP_UID = 'GROUP_USER.GRP_UID';
- /** the column name for the USR_UID field */
- const USR_UID = 'GROUP_USER.USR_UID';
+ /** the column name for the USR_UID field */
+ const USR_UID = 'GROUP_USER.USR_UID';
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('GrpUid', 'UsrUid', ),
- BasePeer::TYPE_COLNAME => array (GroupUserPeer::GRP_UID, GroupUserPeer::USR_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('GRP_UID', 'USR_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, )
- );
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('GrpUid', 'UsrUid', ),
+ BasePeer::TYPE_COLNAME => array (GroupUserPeer::GRP_UID, GroupUserPeer::USR_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('GRP_UID', 'USR_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, )
+ );
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('GrpUid' => 0, 'UsrUid' => 1, ),
- BasePeer::TYPE_COLNAME => array (GroupUserPeer::GRP_UID => 0, GroupUserPeer::USR_UID => 1, ),
- BasePeer::TYPE_FIELDNAME => array ('GRP_UID' => 0, 'USR_UID' => 1, ),
- BasePeer::TYPE_NUM => array (0, 1, )
- );
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('GrpUid' => 0, 'UsrUid' => 1, ),
+ BasePeer::TYPE_COLNAME => array (GroupUserPeer::GRP_UID => 0, GroupUserPeer::USR_UID => 1, ),
+ BasePeer::TYPE_FIELDNAME => array ('GRP_UID' => 0, 'USR_UID' => 1, ),
+ BasePeer::TYPE_NUM => array (0, 1, )
+ );
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/GroupUserMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.GroupUserMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = GroupUserPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/GroupUserMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.GroupUserMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = GroupUserPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. GroupUserPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(GroupUserPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. GroupUserPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(GroupUserPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(GroupUserPeer::GRP_UID);
+ $criteria->addSelectColumn(GroupUserPeer::GRP_UID);
- $criteria->addSelectColumn(GroupUserPeer::USR_UID);
+ $criteria->addSelectColumn(GroupUserPeer::USR_UID);
- }
+ }
- const COUNT = 'COUNT(GROUP_USER.GRP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT GROUP_USER.GRP_UID)';
+ const COUNT = 'COUNT(GROUP_USER.GRP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT GROUP_USER.GRP_UID)';
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(GroupUserPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(GroupUserPeer::COUNT);
- }
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(GroupUserPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(GroupUserPeer::COUNT);
+ }
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
- $rs = GroupUserPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return GroupUser
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = GroupUserPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return GroupUserPeer::populateObjects(GroupUserPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $rs = GroupUserPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return GroupUser
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = GroupUserPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return GroupUserPeer::populateObjects(GroupUserPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- GroupUserPeer::addSelectColumns($criteria);
- }
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ GroupUserPeer::addSelectColumns($criteria);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = GroupUserPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return GroupUserPeer::CLASS_DEFAULT;
- }
+ // set the class once to avoid overhead in the loop
+ $cls = GroupUserPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
- /**
- * Method perform an INSERT on the database, given a GroupUser or Criteria object.
- *
- * @param mixed $values Criteria or GroupUser object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from GroupUser object
- }
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return GroupUserPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a GroupUser or Criteria object.
+ *
+ * @param mixed $values Criteria or GroupUser object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from GroupUser object
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
- return $pk;
- }
+ return $pk;
+ }
- /**
- * Method perform an UPDATE on the database, given a GroupUser or Criteria object.
- *
- * @param mixed $values Criteria or GroupUser object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Method perform an UPDATE on the database, given a GroupUser or Criteria object.
+ *
+ * @param mixed $values Criteria or GroupUser object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $selectCriteria = new Criteria(self::DATABASE_NAME);
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
- $comparison = $criteria->getComparison(GroupUserPeer::GRP_UID);
- $selectCriteria->add(GroupUserPeer::GRP_UID, $criteria->remove(GroupUserPeer::GRP_UID), $comparison);
+ $comparison = $criteria->getComparison(GroupUserPeer::GRP_UID);
+ $selectCriteria->add(GroupUserPeer::GRP_UID, $criteria->remove(GroupUserPeer::GRP_UID), $comparison);
- $comparison = $criteria->getComparison(GroupUserPeer::USR_UID);
- $selectCriteria->add(GroupUserPeer::USR_UID, $criteria->remove(GroupUserPeer::USR_UID), $comparison);
+ $comparison = $criteria->getComparison(GroupUserPeer::USR_UID);
+ $selectCriteria->add(GroupUserPeer::USR_UID, $criteria->remove(GroupUserPeer::USR_UID), $comparison);
- } else { // $values is GroupUser object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
- /**
- * Method to DELETE all rows from the GROUP_USER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(GroupUserPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ /**
+ * Method to DELETE all rows from the GROUP_USER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(GroupUserPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- /**
- * Method perform a DELETE on the database, given a GroupUser or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or GroupUser object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
- }
+ /**
+ * Method perform a DELETE on the database, given a GroupUser or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or GroupUser object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
+ }
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof GroupUser) {
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof GroupUser) {
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
- $criteria->add(GroupUserPeer::GRP_UID, $vals[0], Criteria::IN);
- $criteria->add(GroupUserPeer::USR_UID, $vals[1], Criteria::IN);
- }
+ $criteria->add(GroupUserPeer::GRP_UID, $vals[0], Criteria::IN);
+ $criteria->add(GroupUserPeer::USR_UID, $vals[1], Criteria::IN);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- $affectedRows = 0; // initialize var to track total num of affected rows
+ $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
- /**
- * Validates all modified columns of given GroupUser object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param GroupUser $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(GroupUser $obj, $cols = null)
- {
- $columns = array();
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(GroupUserPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(GroupUserPeer::TABLE_NAME);
+ /**
+ * Validates all modified columns of given GroupUser object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param GroupUser $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(GroupUser $obj, $cols = null)
+ {
+ $columns = array();
- if (! is_array($cols)) {
- $cols = array($cols);
- }
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(GroupUserPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(GroupUserPeer::TABLE_NAME);
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
- if ($obj->isNew() || $obj->isColumnModified(GroupUserPeer::GRP_UID))
- $columns[GroupUserPeer::GRP_UID] = $obj->getGrpUid();
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
- if ($obj->isNew() || $obj->isColumnModified(GroupUserPeer::USR_UID))
- $columns[GroupUserPeer::USR_UID] = $obj->getUsrUid();
+ if ($obj->isNew() || $obj->isColumnModified(GroupUserPeer::GRP_UID))
+ $columns[GroupUserPeer::GRP_UID] = $obj->getGrpUid();
- }
+ if ($obj->isNew() || $obj->isColumnModified(GroupUserPeer::USR_UID))
+ $columns[GroupUserPeer::USR_UID] = $obj->getUsrUid();
- return BasePeer::doValidate(GroupUserPeer::DATABASE_NAME, GroupUserPeer::TABLE_NAME, $columns);
- }
+ }
- /**
- * Retrieve object using using composite pkey values.
- * @param string $grp_uid
- @param string $usr_uid
-
- * @param Connection $con
- * @return GroupUser
- */
- public static function retrieveByPK( $grp_uid, $usr_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(GroupUserPeer::GRP_UID, $grp_uid);
- $criteria->add(GroupUserPeer::USR_UID, $usr_uid);
- $v = GroupUserPeer::doSelect($criteria, $con);
+ return BasePeer::doValidate(GroupUserPeer::DATABASE_NAME, GroupUserPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $grp_uid
+ * @param string $usr_uid
+ * @param Connection $con
+ * @return GroupUser
+ */
+ public static function retrieveByPK($grp_uid, $usr_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(GroupUserPeer::GRP_UID, $grp_uid);
+ $criteria->add(GroupUserPeer::USR_UID, $usr_uid);
+ $v = GroupUserPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- return !empty($v) ? $v[0] : null;
- }
-} // BaseGroupUserPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseGroupUserPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseGroupUserPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/GroupUserMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.GroupUserMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/GroupUserMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.GroupUserMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseGroupwf.php b/workflow/engine/classes/model/om/BaseGroupwf.php
index 350e16f08..948522ea8 100755
--- a/workflow/engine/classes/model/om/BaseGroupwf.php
+++ b/workflow/engine/classes/model/om/BaseGroupwf.php
@@ -16,648 +16,669 @@ include_once 'classes/model/GroupwfPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseGroupwf extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var GroupwfPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the grp_uid field.
- * @var string
- */
- protected $grp_uid = '';
-
-
- /**
- * The value for the grp_status field.
- * @var string
- */
- protected $grp_status = 'ACTIVE';
-
-
- /**
- * The value for the grp_ldap_dn field.
- * @var string
- */
- protected $grp_ldap_dn = '';
-
-
- /**
- * The value for the grp_ux field.
- * @var string
- */
- protected $grp_ux = 'NORMAL';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [grp_uid] column value.
- *
- * @return string
- */
- public function getGrpUid()
- {
-
- return $this->grp_uid;
- }
-
- /**
- * Get the [grp_status] column value.
- *
- * @return string
- */
- public function getGrpStatus()
- {
-
- return $this->grp_status;
- }
-
- /**
- * Get the [grp_ldap_dn] column value.
- *
- * @return string
- */
- public function getGrpLdapDn()
- {
-
- return $this->grp_ldap_dn;
- }
-
- /**
- * Get the [grp_ux] column value.
- *
- * @return string
- */
- public function getGrpUx()
- {
-
- return $this->grp_ux;
- }
-
- /**
- * Set the value of [grp_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGrpUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->grp_uid !== $v || $v === '') {
- $this->grp_uid = $v;
- $this->modifiedColumns[] = GroupwfPeer::GRP_UID;
- }
-
- } // setGrpUid()
-
- /**
- * Set the value of [grp_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGrpStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->grp_status !== $v || $v === 'ACTIVE') {
- $this->grp_status = $v;
- $this->modifiedColumns[] = GroupwfPeer::GRP_STATUS;
- }
-
- } // setGrpStatus()
-
- /**
- * Set the value of [grp_ldap_dn] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGrpLdapDn($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->grp_ldap_dn !== $v || $v === '') {
- $this->grp_ldap_dn = $v;
- $this->modifiedColumns[] = GroupwfPeer::GRP_LDAP_DN;
- }
-
- } // setGrpLdapDn()
-
- /**
- * Set the value of [grp_ux] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGrpUx($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->grp_ux !== $v || $v === 'NORMAL') {
- $this->grp_ux = $v;
- $this->modifiedColumns[] = GroupwfPeer::GRP_UX;
- }
-
- } // setGrpUx()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->grp_uid = $rs->getString($startcol + 0);
-
- $this->grp_status = $rs->getString($startcol + 1);
-
- $this->grp_ldap_dn = $rs->getString($startcol + 2);
-
- $this->grp_ux = $rs->getString($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = GroupwfPeer::NUM_COLUMNS - GroupwfPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Groupwf object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- GroupwfPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = GroupwfPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += GroupwfPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = GroupwfPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = GroupwfPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getGrpUid();
- break;
- case 1:
- return $this->getGrpStatus();
- break;
- case 2:
- return $this->getGrpLdapDn();
- break;
- case 3:
- return $this->getGrpUx();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = GroupwfPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getGrpUid(),
- $keys[1] => $this->getGrpStatus(),
- $keys[2] => $this->getGrpLdapDn(),
- $keys[3] => $this->getGrpUx(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = GroupwfPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setGrpUid($value);
- break;
- case 1:
- $this->setGrpStatus($value);
- break;
- case 2:
- $this->setGrpLdapDn($value);
- break;
- case 3:
- $this->setGrpUx($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = GroupwfPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setGrpUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setGrpStatus($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setGrpLdapDn($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setGrpUx($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(GroupwfPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(GroupwfPeer::GRP_UID)) $criteria->add(GroupwfPeer::GRP_UID, $this->grp_uid);
- if ($this->isColumnModified(GroupwfPeer::GRP_STATUS)) $criteria->add(GroupwfPeer::GRP_STATUS, $this->grp_status);
- if ($this->isColumnModified(GroupwfPeer::GRP_LDAP_DN)) $criteria->add(GroupwfPeer::GRP_LDAP_DN, $this->grp_ldap_dn);
- if ($this->isColumnModified(GroupwfPeer::GRP_UX)) $criteria->add(GroupwfPeer::GRP_UX, $this->grp_ux);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(GroupwfPeer::DATABASE_NAME);
-
- $criteria->add(GroupwfPeer::GRP_UID, $this->grp_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getGrpUid();
- }
-
- /**
- * Generic method to set the primary key (grp_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setGrpUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Groupwf (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setGrpStatus($this->grp_status);
-
- $copyObj->setGrpLdapDn($this->grp_ldap_dn);
-
- $copyObj->setGrpUx($this->grp_ux);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setGrpUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Groupwf Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return GroupwfPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new GroupwfPeer();
- }
- return self::$peer;
- }
-
-} // BaseGroupwf
+abstract class BaseGroupwf extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var GroupwfPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the grp_uid field.
+ * @var string
+ */
+ protected $grp_uid = '';
+
+ /**
+ * The value for the grp_status field.
+ * @var string
+ */
+ protected $grp_status = 'ACTIVE';
+
+ /**
+ * The value for the grp_ldap_dn field.
+ * @var string
+ */
+ protected $grp_ldap_dn = '';
+
+ /**
+ * The value for the grp_ux field.
+ * @var string
+ */
+ protected $grp_ux = 'NORMAL';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [grp_uid] column value.
+ *
+ * @return string
+ */
+ public function getGrpUid()
+ {
+
+ return $this->grp_uid;
+ }
+
+ /**
+ * Get the [grp_status] column value.
+ *
+ * @return string
+ */
+ public function getGrpStatus()
+ {
+
+ return $this->grp_status;
+ }
+
+ /**
+ * Get the [grp_ldap_dn] column value.
+ *
+ * @return string
+ */
+ public function getGrpLdapDn()
+ {
+
+ return $this->grp_ldap_dn;
+ }
+
+ /**
+ * Get the [grp_ux] column value.
+ *
+ * @return string
+ */
+ public function getGrpUx()
+ {
+
+ return $this->grp_ux;
+ }
+
+ /**
+ * Set the value of [grp_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGrpUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->grp_uid !== $v || $v === '') {
+ $this->grp_uid = $v;
+ $this->modifiedColumns[] = GroupwfPeer::GRP_UID;
+ }
+
+ } // setGrpUid()
+
+ /**
+ * Set the value of [grp_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGrpStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->grp_status !== $v || $v === 'ACTIVE') {
+ $this->grp_status = $v;
+ $this->modifiedColumns[] = GroupwfPeer::GRP_STATUS;
+ }
+
+ } // setGrpStatus()
+
+ /**
+ * Set the value of [grp_ldap_dn] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGrpLdapDn($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->grp_ldap_dn !== $v || $v === '') {
+ $this->grp_ldap_dn = $v;
+ $this->modifiedColumns[] = GroupwfPeer::GRP_LDAP_DN;
+ }
+
+ } // setGrpLdapDn()
+
+ /**
+ * Set the value of [grp_ux] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGrpUx($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->grp_ux !== $v || $v === 'NORMAL') {
+ $this->grp_ux = $v;
+ $this->modifiedColumns[] = GroupwfPeer::GRP_UX;
+ }
+
+ } // setGrpUx()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->grp_uid = $rs->getString($startcol + 0);
+
+ $this->grp_status = $rs->getString($startcol + 1);
+
+ $this->grp_ldap_dn = $rs->getString($startcol + 2);
+
+ $this->grp_ux = $rs->getString($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = GroupwfPeer::NUM_COLUMNS - GroupwfPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Groupwf object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ GroupwfPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = GroupwfPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += GroupwfPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = GroupwfPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = GroupwfPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getGrpUid();
+ break;
+ case 1:
+ return $this->getGrpStatus();
+ break;
+ case 2:
+ return $this->getGrpLdapDn();
+ break;
+ case 3:
+ return $this->getGrpUx();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = GroupwfPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getGrpUid(),
+ $keys[1] => $this->getGrpStatus(),
+ $keys[2] => $this->getGrpLdapDn(),
+ $keys[3] => $this->getGrpUx(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = GroupwfPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setGrpUid($value);
+ break;
+ case 1:
+ $this->setGrpStatus($value);
+ break;
+ case 2:
+ $this->setGrpLdapDn($value);
+ break;
+ case 3:
+ $this->setGrpUx($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = GroupwfPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setGrpUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setGrpStatus($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setGrpLdapDn($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setGrpUx($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(GroupwfPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(GroupwfPeer::GRP_UID)) {
+ $criteria->add(GroupwfPeer::GRP_UID, $this->grp_uid);
+ }
+
+ if ($this->isColumnModified(GroupwfPeer::GRP_STATUS)) {
+ $criteria->add(GroupwfPeer::GRP_STATUS, $this->grp_status);
+ }
+
+ if ($this->isColumnModified(GroupwfPeer::GRP_LDAP_DN)) {
+ $criteria->add(GroupwfPeer::GRP_LDAP_DN, $this->grp_ldap_dn);
+ }
+
+ if ($this->isColumnModified(GroupwfPeer::GRP_UX)) {
+ $criteria->add(GroupwfPeer::GRP_UX, $this->grp_ux);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(GroupwfPeer::DATABASE_NAME);
+
+ $criteria->add(GroupwfPeer::GRP_UID, $this->grp_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getGrpUid();
+ }
+
+ /**
+ * Generic method to set the primary key (grp_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setGrpUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Groupwf (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setGrpStatus($this->grp_status);
+
+ $copyObj->setGrpLdapDn($this->grp_ldap_dn);
+
+ $copyObj->setGrpUx($this->grp_ux);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setGrpUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Groupwf Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return GroupwfPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new GroupwfPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseGroupwfPeer.php b/workflow/engine/classes/model/om/BaseGroupwfPeer.php
index 8440a9287..d90262069 100755
--- a/workflow/engine/classes/model/om/BaseGroupwfPeer.php
+++ b/workflow/engine/classes/model/om/BaseGroupwfPeer.php
@@ -12,572 +12,574 @@ include_once 'classes/model/Groupwf.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseGroupwfPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'GROUPWF';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Groupwf';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the GRP_UID field */
- const GRP_UID = 'GROUPWF.GRP_UID';
-
- /** the column name for the GRP_STATUS field */
- const GRP_STATUS = 'GROUPWF.GRP_STATUS';
-
- /** the column name for the GRP_LDAP_DN field */
- const GRP_LDAP_DN = 'GROUPWF.GRP_LDAP_DN';
-
- /** the column name for the GRP_UX field */
- const GRP_UX = 'GROUPWF.GRP_UX';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('GrpUid', 'GrpStatus', 'GrpLdapDn', 'GrpUx', ),
- BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID, GroupwfPeer::GRP_STATUS, GroupwfPeer::GRP_LDAP_DN, GroupwfPeer::GRP_UX, ),
- BasePeer::TYPE_FIELDNAME => array ('GRP_UID', 'GRP_STATUS', 'GRP_LDAP_DN', 'GRP_UX', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('GrpUid' => 0, 'GrpStatus' => 1, 'GrpLdapDn' => 2, 'GrpUx' => 3, ),
- BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID => 0, GroupwfPeer::GRP_STATUS => 1, GroupwfPeer::GRP_LDAP_DN => 2, GroupwfPeer::GRP_UX => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('GRP_UID' => 0, 'GRP_STATUS' => 1, 'GRP_LDAP_DN' => 2, 'GRP_UX' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/GroupwfMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.GroupwfMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = GroupwfPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. GroupwfPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(GroupwfPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(GroupwfPeer::GRP_UID);
-
- $criteria->addSelectColumn(GroupwfPeer::GRP_STATUS);
-
- $criteria->addSelectColumn(GroupwfPeer::GRP_LDAP_DN);
-
- $criteria->addSelectColumn(GroupwfPeer::GRP_UX);
-
- }
-
- const COUNT = 'COUNT(GROUPWF.GRP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT GROUPWF.GRP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(GroupwfPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(GroupwfPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = GroupwfPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Groupwf
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = GroupwfPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return GroupwfPeer::populateObjects(GroupwfPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- GroupwfPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = GroupwfPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return GroupwfPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Groupwf or Criteria object.
- *
- * @param mixed $values Criteria or Groupwf object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Groupwf object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Groupwf or Criteria object.
- *
- * @param mixed $values Criteria or Groupwf object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(GroupwfPeer::GRP_UID);
- $selectCriteria->add(GroupwfPeer::GRP_UID, $criteria->remove(GroupwfPeer::GRP_UID), $comparison);
-
- } else { // $values is Groupwf object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the GROUPWF table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(GroupwfPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Groupwf or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Groupwf object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Groupwf) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(GroupwfPeer::GRP_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Groupwf object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Groupwf $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Groupwf $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(GroupwfPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(GroupwfPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(GroupwfPeer::GRP_STATUS))
- $columns[GroupwfPeer::GRP_STATUS] = $obj->getGrpStatus();
-
- }
-
- return BasePeer::doValidate(GroupwfPeer::DATABASE_NAME, GroupwfPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Groupwf
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(GroupwfPeer::DATABASE_NAME);
-
- $criteria->add(GroupwfPeer::GRP_UID, $pk);
-
-
- $v = GroupwfPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(GroupwfPeer::GRP_UID, $pks, Criteria::IN);
- $objs = GroupwfPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseGroupwfPeer
+abstract class BaseGroupwfPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'GROUPWF';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Groupwf';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the GRP_UID field */
+ const GRP_UID = 'GROUPWF.GRP_UID';
+
+ /** the column name for the GRP_STATUS field */
+ const GRP_STATUS = 'GROUPWF.GRP_STATUS';
+
+ /** the column name for the GRP_LDAP_DN field */
+ const GRP_LDAP_DN = 'GROUPWF.GRP_LDAP_DN';
+
+ /** the column name for the GRP_UX field */
+ const GRP_UX = 'GROUPWF.GRP_UX';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('GrpUid', 'GrpStatus', 'GrpLdapDn', 'GrpUx', ),
+ BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID, GroupwfPeer::GRP_STATUS, GroupwfPeer::GRP_LDAP_DN, GroupwfPeer::GRP_UX, ),
+ BasePeer::TYPE_FIELDNAME => array ('GRP_UID', 'GRP_STATUS', 'GRP_LDAP_DN', 'GRP_UX', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('GrpUid' => 0, 'GrpStatus' => 1, 'GrpLdapDn' => 2, 'GrpUx' => 3, ),
+ BasePeer::TYPE_COLNAME => array (GroupwfPeer::GRP_UID => 0, GroupwfPeer::GRP_STATUS => 1, GroupwfPeer::GRP_LDAP_DN => 2, GroupwfPeer::GRP_UX => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('GRP_UID' => 0, 'GRP_STATUS' => 1, 'GRP_LDAP_DN' => 2, 'GRP_UX' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/GroupwfMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.GroupwfMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = GroupwfPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. GroupwfPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(GroupwfPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(GroupwfPeer::GRP_UID);
+
+ $criteria->addSelectColumn(GroupwfPeer::GRP_STATUS);
+
+ $criteria->addSelectColumn(GroupwfPeer::GRP_LDAP_DN);
+
+ $criteria->addSelectColumn(GroupwfPeer::GRP_UX);
+
+ }
+
+ const COUNT = 'COUNT(GROUPWF.GRP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT GROUPWF.GRP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(GroupwfPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(GroupwfPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = GroupwfPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Groupwf
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = GroupwfPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return GroupwfPeer::populateObjects(GroupwfPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ GroupwfPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = GroupwfPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return GroupwfPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Groupwf or Criteria object.
+ *
+ * @param mixed $values Criteria or Groupwf object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Groupwf object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Groupwf or Criteria object.
+ *
+ * @param mixed $values Criteria or Groupwf object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(GroupwfPeer::GRP_UID);
+ $selectCriteria->add(GroupwfPeer::GRP_UID, $criteria->remove(GroupwfPeer::GRP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the GROUPWF table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(GroupwfPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Groupwf or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Groupwf object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Groupwf) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(GroupwfPeer::GRP_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Groupwf object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Groupwf $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Groupwf $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(GroupwfPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(GroupwfPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(GroupwfPeer::GRP_STATUS))
+ $columns[GroupwfPeer::GRP_STATUS] = $obj->getGrpStatus();
+
+ }
+
+ return BasePeer::doValidate(GroupwfPeer::DATABASE_NAME, GroupwfPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Groupwf
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(GroupwfPeer::DATABASE_NAME);
+
+ $criteria->add(GroupwfPeer::GRP_UID, $pk);
+
+
+ $v = GroupwfPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(GroupwfPeer::GRP_UID, $pks, Criteria::IN);
+ $objs = GroupwfPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseGroupwfPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseGroupwfPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/GroupwfMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.GroupwfMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/GroupwfMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.GroupwfMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseHoliday.php b/workflow/engine/classes/model/om/BaseHoliday.php
index d22bbd8c1..fcb3f7bae 100755
--- a/workflow/engine/classes/model/om/BaseHoliday.php
+++ b/workflow/engine/classes/model/om/BaseHoliday.php
@@ -16,597 +16,613 @@ include_once 'classes/model/HolidayPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseHoliday extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var HolidayPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the hld_uid field.
- * @var int
- */
- protected $hld_uid;
-
-
- /**
- * The value for the hld_date field.
- * @var string
- */
- protected $hld_date = '0000-00-00';
-
-
- /**
- * The value for the hld_description field.
- * @var string
- */
- protected $hld_description = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [hld_uid] column value.
- *
- * @return int
- */
- public function getHldUid()
- {
-
- return $this->hld_uid;
- }
-
- /**
- * Get the [hld_date] column value.
- *
- * @return string
- */
- public function getHldDate()
- {
-
- return $this->hld_date;
- }
-
- /**
- * Get the [hld_description] column value.
- *
- * @return string
- */
- public function getHldDescription()
- {
-
- return $this->hld_description;
- }
-
- /**
- * Set the value of [hld_uid] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setHldUid($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->hld_uid !== $v) {
- $this->hld_uid = $v;
- $this->modifiedColumns[] = HolidayPeer::HLD_UID;
- }
-
- } // setHldUid()
-
- /**
- * Set the value of [hld_date] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setHldDate($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->hld_date !== $v || $v === '0000-00-00') {
- $this->hld_date = $v;
- $this->modifiedColumns[] = HolidayPeer::HLD_DATE;
- }
-
- } // setHldDate()
-
- /**
- * Set the value of [hld_description] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setHldDescription($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->hld_description !== $v || $v === '') {
- $this->hld_description = $v;
- $this->modifiedColumns[] = HolidayPeer::HLD_DESCRIPTION;
- }
-
- } // setHldDescription()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->hld_uid = $rs->getInt($startcol + 0);
-
- $this->hld_date = $rs->getString($startcol + 1);
-
- $this->hld_description = $rs->getString($startcol + 2);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 3; // 3 = HolidayPeer::NUM_COLUMNS - HolidayPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Holiday object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(HolidayPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- HolidayPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(HolidayPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = HolidayPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setHldUid($pk); //[IMV] update autoincrement primary key
-
- $this->setNew(false);
- } else {
- $affectedRows += HolidayPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = HolidayPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = HolidayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getHldUid();
- break;
- case 1:
- return $this->getHldDate();
- break;
- case 2:
- return $this->getHldDescription();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = HolidayPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getHldUid(),
- $keys[1] => $this->getHldDate(),
- $keys[2] => $this->getHldDescription(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = HolidayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setHldUid($value);
- break;
- case 1:
- $this->setHldDate($value);
- break;
- case 2:
- $this->setHldDescription($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = HolidayPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setHldUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setHldDate($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setHldDescription($arr[$keys[2]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(HolidayPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(HolidayPeer::HLD_UID)) $criteria->add(HolidayPeer::HLD_UID, $this->hld_uid);
- if ($this->isColumnModified(HolidayPeer::HLD_DATE)) $criteria->add(HolidayPeer::HLD_DATE, $this->hld_date);
- if ($this->isColumnModified(HolidayPeer::HLD_DESCRIPTION)) $criteria->add(HolidayPeer::HLD_DESCRIPTION, $this->hld_description);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(HolidayPeer::DATABASE_NAME);
-
- $criteria->add(HolidayPeer::HLD_UID, $this->hld_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return int
- */
- public function getPrimaryKey()
- {
- return $this->getHldUid();
- }
-
- /**
- * Generic method to set the primary key (hld_uid column).
- *
- * @param int $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setHldUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Holiday (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setHldDate($this->hld_date);
-
- $copyObj->setHldDescription($this->hld_description);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setHldUid(NULL); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Holiday Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return HolidayPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new HolidayPeer();
- }
- return self::$peer;
- }
-
-} // BaseHoliday
+abstract class BaseHoliday extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var HolidayPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the hld_uid field.
+ * @var int
+ */
+ protected $hld_uid;
+
+ /**
+ * The value for the hld_date field.
+ * @var string
+ */
+ protected $hld_date = '0000-00-00';
+
+ /**
+ * The value for the hld_description field.
+ * @var string
+ */
+ protected $hld_description = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [hld_uid] column value.
+ *
+ * @return int
+ */
+ public function getHldUid()
+ {
+
+ return $this->hld_uid;
+ }
+
+ /**
+ * Get the [hld_date] column value.
+ *
+ * @return string
+ */
+ public function getHldDate()
+ {
+
+ return $this->hld_date;
+ }
+
+ /**
+ * Get the [hld_description] column value.
+ *
+ * @return string
+ */
+ public function getHldDescription()
+ {
+
+ return $this->hld_description;
+ }
+
+ /**
+ * Set the value of [hld_uid] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setHldUid($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->hld_uid !== $v) {
+ $this->hld_uid = $v;
+ $this->modifiedColumns[] = HolidayPeer::HLD_UID;
+ }
+
+ } // setHldUid()
+
+ /**
+ * Set the value of [hld_date] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setHldDate($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->hld_date !== $v || $v === '0000-00-00') {
+ $this->hld_date = $v;
+ $this->modifiedColumns[] = HolidayPeer::HLD_DATE;
+ }
+
+ } // setHldDate()
+
+ /**
+ * Set the value of [hld_description] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setHldDescription($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->hld_description !== $v || $v === '') {
+ $this->hld_description = $v;
+ $this->modifiedColumns[] = HolidayPeer::HLD_DESCRIPTION;
+ }
+
+ } // setHldDescription()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->hld_uid = $rs->getInt($startcol + 0);
+
+ $this->hld_date = $rs->getString($startcol + 1);
+
+ $this->hld_description = $rs->getString($startcol + 2);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 3; // 3 = HolidayPeer::NUM_COLUMNS - HolidayPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Holiday object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(HolidayPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ HolidayPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(HolidayPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = HolidayPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setHldUid($pk); //[IMV] update autoincrement primary key
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += HolidayPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = HolidayPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = HolidayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getHldUid();
+ break;
+ case 1:
+ return $this->getHldDate();
+ break;
+ case 2:
+ return $this->getHldDescription();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = HolidayPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getHldUid(),
+ $keys[1] => $this->getHldDate(),
+ $keys[2] => $this->getHldDescription(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = HolidayPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setHldUid($value);
+ break;
+ case 1:
+ $this->setHldDate($value);
+ break;
+ case 2:
+ $this->setHldDescription($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = HolidayPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setHldUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setHldDate($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setHldDescription($arr[$keys[2]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(HolidayPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(HolidayPeer::HLD_UID)) {
+ $criteria->add(HolidayPeer::HLD_UID, $this->hld_uid);
+ }
+
+ if ($this->isColumnModified(HolidayPeer::HLD_DATE)) {
+ $criteria->add(HolidayPeer::HLD_DATE, $this->hld_date);
+ }
+
+ if ($this->isColumnModified(HolidayPeer::HLD_DESCRIPTION)) {
+ $criteria->add(HolidayPeer::HLD_DESCRIPTION, $this->hld_description);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(HolidayPeer::DATABASE_NAME);
+
+ $criteria->add(HolidayPeer::HLD_UID, $this->hld_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return int
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getHldUid();
+ }
+
+ /**
+ * Generic method to set the primary key (hld_uid column).
+ *
+ * @param int $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setHldUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Holiday (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setHldDate($this->hld_date);
+
+ $copyObj->setHldDescription($this->hld_description);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setHldUid(NULL); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Holiday Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return HolidayPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new HolidayPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseHolidayPeer.php b/workflow/engine/classes/model/om/BaseHolidayPeer.php
index 3e284c93a..46a07d158 100755
--- a/workflow/engine/classes/model/om/BaseHolidayPeer.php
+++ b/workflow/engine/classes/model/om/BaseHolidayPeer.php
@@ -12,566 +12,568 @@ include_once 'classes/model/Holiday.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseHolidayPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'HOLIDAY';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Holiday';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 3;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the HLD_UID field */
- const HLD_UID = 'HOLIDAY.HLD_UID';
-
- /** the column name for the HLD_DATE field */
- const HLD_DATE = 'HOLIDAY.HLD_DATE';
-
- /** the column name for the HLD_DESCRIPTION field */
- const HLD_DESCRIPTION = 'HOLIDAY.HLD_DESCRIPTION';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('HldUid', 'HldDate', 'HldDescription', ),
- BasePeer::TYPE_COLNAME => array (HolidayPeer::HLD_UID, HolidayPeer::HLD_DATE, HolidayPeer::HLD_DESCRIPTION, ),
- BasePeer::TYPE_FIELDNAME => array ('HLD_UID', 'HLD_DATE', 'HLD_DESCRIPTION', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('HldUid' => 0, 'HldDate' => 1, 'HldDescription' => 2, ),
- BasePeer::TYPE_COLNAME => array (HolidayPeer::HLD_UID => 0, HolidayPeer::HLD_DATE => 1, HolidayPeer::HLD_DESCRIPTION => 2, ),
- BasePeer::TYPE_FIELDNAME => array ('HLD_UID' => 0, 'HLD_DATE' => 1, 'HLD_DESCRIPTION' => 2, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/HolidayMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.HolidayMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = HolidayPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. HolidayPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(HolidayPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(HolidayPeer::HLD_UID);
-
- $criteria->addSelectColumn(HolidayPeer::HLD_DATE);
-
- $criteria->addSelectColumn(HolidayPeer::HLD_DESCRIPTION);
-
- }
-
- const COUNT = 'COUNT(HOLIDAY.HLD_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT HOLIDAY.HLD_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(HolidayPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(HolidayPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = HolidayPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Holiday
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = HolidayPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return HolidayPeer::populateObjects(HolidayPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- HolidayPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = HolidayPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return HolidayPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Holiday or Criteria object.
- *
- * @param mixed $values Criteria or Holiday object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Holiday object
- }
-
- $criteria->remove(HolidayPeer::HLD_UID); // remove pkey col since this table uses auto-increment
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Holiday or Criteria object.
- *
- * @param mixed $values Criteria or Holiday object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(HolidayPeer::HLD_UID);
- $selectCriteria->add(HolidayPeer::HLD_UID, $criteria->remove(HolidayPeer::HLD_UID), $comparison);
-
- } else { // $values is Holiday object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the HOLIDAY table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(HolidayPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Holiday or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Holiday object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(HolidayPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Holiday) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(HolidayPeer::HLD_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Holiday object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Holiday $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Holiday $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(HolidayPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(HolidayPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(HolidayPeer::DATABASE_NAME, HolidayPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Holiday
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(HolidayPeer::DATABASE_NAME);
-
- $criteria->add(HolidayPeer::HLD_UID, $pk);
-
-
- $v = HolidayPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(HolidayPeer::HLD_UID, $pks, Criteria::IN);
- $objs = HolidayPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseHolidayPeer
+abstract class BaseHolidayPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'HOLIDAY';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Holiday';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 3;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the HLD_UID field */
+ const HLD_UID = 'HOLIDAY.HLD_UID';
+
+ /** the column name for the HLD_DATE field */
+ const HLD_DATE = 'HOLIDAY.HLD_DATE';
+
+ /** the column name for the HLD_DESCRIPTION field */
+ const HLD_DESCRIPTION = 'HOLIDAY.HLD_DESCRIPTION';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('HldUid', 'HldDate', 'HldDescription', ),
+ BasePeer::TYPE_COLNAME => array (HolidayPeer::HLD_UID, HolidayPeer::HLD_DATE, HolidayPeer::HLD_DESCRIPTION, ),
+ BasePeer::TYPE_FIELDNAME => array ('HLD_UID', 'HLD_DATE', 'HLD_DESCRIPTION', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('HldUid' => 0, 'HldDate' => 1, 'HldDescription' => 2, ),
+ BasePeer::TYPE_COLNAME => array (HolidayPeer::HLD_UID => 0, HolidayPeer::HLD_DATE => 1, HolidayPeer::HLD_DESCRIPTION => 2, ),
+ BasePeer::TYPE_FIELDNAME => array ('HLD_UID' => 0, 'HLD_DATE' => 1, 'HLD_DESCRIPTION' => 2, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/HolidayMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.HolidayMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = HolidayPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. HolidayPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(HolidayPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(HolidayPeer::HLD_UID);
+
+ $criteria->addSelectColumn(HolidayPeer::HLD_DATE);
+
+ $criteria->addSelectColumn(HolidayPeer::HLD_DESCRIPTION);
+
+ }
+
+ const COUNT = 'COUNT(HOLIDAY.HLD_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT HOLIDAY.HLD_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(HolidayPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(HolidayPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = HolidayPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Holiday
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = HolidayPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return HolidayPeer::populateObjects(HolidayPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ HolidayPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = HolidayPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return HolidayPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Holiday or Criteria object.
+ *
+ * @param mixed $values Criteria or Holiday object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Holiday object
+ }
+
+ $criteria->remove(HolidayPeer::HLD_UID); // remove pkey col since this table uses auto-increment
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Holiday or Criteria object.
+ *
+ * @param mixed $values Criteria or Holiday object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(HolidayPeer::HLD_UID);
+ $selectCriteria->add(HolidayPeer::HLD_UID, $criteria->remove(HolidayPeer::HLD_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the HOLIDAY table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(HolidayPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Holiday or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Holiday object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(HolidayPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Holiday) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(HolidayPeer::HLD_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Holiday object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Holiday $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Holiday $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(HolidayPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(HolidayPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(HolidayPeer::DATABASE_NAME, HolidayPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Holiday
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(HolidayPeer::DATABASE_NAME);
+
+ $criteria->add(HolidayPeer::HLD_UID, $pk);
+
+
+ $v = HolidayPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(HolidayPeer::HLD_UID, $pks, Criteria::IN);
+ $objs = HolidayPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseHolidayPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseHolidayPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/HolidayMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.HolidayMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/HolidayMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.HolidayMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseInputDocument.php b/workflow/engine/classes/model/om/BaseInputDocument.php
index 71c2405b6..5daf7b89b 100755
--- a/workflow/engine/classes/model/om/BaseInputDocument.php
+++ b/workflow/engine/classes/model/om/BaseInputDocument.php
@@ -16,860 +16,901 @@ include_once 'classes/model/InputDocumentPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseInputDocument extends BaseObject implements Persistent {
-
+abstract class BaseInputDocument extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var InputDocumentPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the inp_doc_uid field.
+ * @var string
+ */
+ protected $inp_doc_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the inp_doc_form_needed field.
+ * @var string
+ */
+ protected $inp_doc_form_needed = 'REAL';
+
+ /**
+ * The value for the inp_doc_original field.
+ * @var string
+ */
+ protected $inp_doc_original = 'COPY';
+
+ /**
+ * The value for the inp_doc_published field.
+ * @var string
+ */
+ protected $inp_doc_published = 'PRIVATE';
+
+ /**
+ * The value for the inp_doc_versioning field.
+ * @var int
+ */
+ protected $inp_doc_versioning = 0;
+
+ /**
+ * The value for the inp_doc_destination_path field.
+ * @var string
+ */
+ protected $inp_doc_destination_path;
+
+ /**
+ * The value for the inp_doc_tags field.
+ * @var string
+ */
+ protected $inp_doc_tags;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [inp_doc_uid] column value.
+ *
+ * @return string
+ */
+ public function getInpDocUid()
+ {
+
+ return $this->inp_doc_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [inp_doc_form_needed] column value.
+ *
+ * @return string
+ */
+ public function getInpDocFormNeeded()
+ {
+
+ return $this->inp_doc_form_needed;
+ }
+
+ /**
+ * Get the [inp_doc_original] column value.
+ *
+ * @return string
+ */
+ public function getInpDocOriginal()
+ {
+
+ return $this->inp_doc_original;
+ }
+
+ /**
+ * Get the [inp_doc_published] column value.
+ *
+ * @return string
+ */
+ public function getInpDocPublished()
+ {
+
+ return $this->inp_doc_published;
+ }
+
+ /**
+ * Get the [inp_doc_versioning] column value.
+ *
+ * @return int
+ */
+ public function getInpDocVersioning()
+ {
+
+ return $this->inp_doc_versioning;
+ }
+
+ /**
+ * Get the [inp_doc_destination_path] column value.
+ *
+ * @return string
+ */
+ public function getInpDocDestinationPath()
+ {
+
+ return $this->inp_doc_destination_path;
+ }
+
+ /**
+ * Get the [inp_doc_tags] column value.
+ *
+ * @return string
+ */
+ public function getInpDocTags()
+ {
+
+ return $this->inp_doc_tags;
+ }
+
+ /**
+ * Set the value of [inp_doc_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setInpDocUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->inp_doc_uid !== $v || $v === '') {
+ $this->inp_doc_uid = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_UID;
+ }
+
+ } // setInpDocUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [inp_doc_form_needed] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setInpDocFormNeeded($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->inp_doc_form_needed !== $v || $v === 'REAL') {
+ $this->inp_doc_form_needed = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_FORM_NEEDED;
+ }
+
+ } // setInpDocFormNeeded()
+
+ /**
+ * Set the value of [inp_doc_original] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setInpDocOriginal($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->inp_doc_original !== $v || $v === 'COPY') {
+ $this->inp_doc_original = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_ORIGINAL;
+ }
+
+ } // setInpDocOriginal()
+
+ /**
+ * Set the value of [inp_doc_published] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setInpDocPublished($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->inp_doc_published !== $v || $v === 'PRIVATE') {
+ $this->inp_doc_published = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_PUBLISHED;
+ }
+
+ } // setInpDocPublished()
+
+ /**
+ * Set the value of [inp_doc_versioning] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setInpDocVersioning($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->inp_doc_versioning !== $v || $v === 0) {
+ $this->inp_doc_versioning = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_VERSIONING;
+ }
+
+ } // setInpDocVersioning()
+
+ /**
+ * Set the value of [inp_doc_destination_path] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setInpDocDestinationPath($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->inp_doc_destination_path !== $v) {
+ $this->inp_doc_destination_path = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_DESTINATION_PATH;
+ }
+
+ } // setInpDocDestinationPath()
+
+ /**
+ * Set the value of [inp_doc_tags] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setInpDocTags($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->inp_doc_tags !== $v) {
+ $this->inp_doc_tags = $v;
+ $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_TAGS;
+ }
+
+ } // setInpDocTags()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->inp_doc_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->inp_doc_form_needed = $rs->getString($startcol + 2);
+
+ $this->inp_doc_original = $rs->getString($startcol + 3);
+
+ $this->inp_doc_published = $rs->getString($startcol + 4);
+
+ $this->inp_doc_versioning = $rs->getInt($startcol + 5);
+
+ $this->inp_doc_destination_path = $rs->getString($startcol + 6);
+
+ $this->inp_doc_tags = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = InputDocumentPeer::NUM_COLUMNS - InputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating InputDocument object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ InputDocumentPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = InputDocumentPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += InputDocumentPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = InputDocumentPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = InputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getInpDocUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getInpDocFormNeeded();
+ break;
+ case 3:
+ return $this->getInpDocOriginal();
+ break;
+ case 4:
+ return $this->getInpDocPublished();
+ break;
+ case 5:
+ return $this->getInpDocVersioning();
+ break;
+ case 6:
+ return $this->getInpDocDestinationPath();
+ break;
+ case 7:
+ return $this->getInpDocTags();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = InputDocumentPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getInpDocUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getInpDocFormNeeded(),
+ $keys[3] => $this->getInpDocOriginal(),
+ $keys[4] => $this->getInpDocPublished(),
+ $keys[5] => $this->getInpDocVersioning(),
+ $keys[6] => $this->getInpDocDestinationPath(),
+ $keys[7] => $this->getInpDocTags(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = InputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setInpDocUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setInpDocFormNeeded($value);
+ break;
+ case 3:
+ $this->setInpDocOriginal($value);
+ break;
+ case 4:
+ $this->setInpDocPublished($value);
+ break;
+ case 5:
+ $this->setInpDocVersioning($value);
+ break;
+ case 6:
+ $this->setInpDocDestinationPath($value);
+ break;
+ case 7:
+ $this->setInpDocTags($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = InputDocumentPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setInpDocUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setInpDocFormNeeded($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setInpDocOriginal($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setInpDocPublished($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setInpDocVersioning($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setInpDocDestinationPath($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setInpDocTags($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(InputDocumentPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(InputDocumentPeer::INP_DOC_UID)) {
+ $criteria->add(InputDocumentPeer::INP_DOC_UID, $this->inp_doc_uid);
+ }
+
+ if ($this->isColumnModified(InputDocumentPeer::PRO_UID)) {
+ $criteria->add(InputDocumentPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(InputDocumentPeer::INP_DOC_FORM_NEEDED)) {
+ $criteria->add(InputDocumentPeer::INP_DOC_FORM_NEEDED, $this->inp_doc_form_needed);
+ }
+
+ if ($this->isColumnModified(InputDocumentPeer::INP_DOC_ORIGINAL)) {
+ $criteria->add(InputDocumentPeer::INP_DOC_ORIGINAL, $this->inp_doc_original);
+ }
+
+ if ($this->isColumnModified(InputDocumentPeer::INP_DOC_PUBLISHED)) {
+ $criteria->add(InputDocumentPeer::INP_DOC_PUBLISHED, $this->inp_doc_published);
+ }
+
+ if ($this->isColumnModified(InputDocumentPeer::INP_DOC_VERSIONING)) {
+ $criteria->add(InputDocumentPeer::INP_DOC_VERSIONING, $this->inp_doc_versioning);
+ }
+
+ if ($this->isColumnModified(InputDocumentPeer::INP_DOC_DESTINATION_PATH)) {
+ $criteria->add(InputDocumentPeer::INP_DOC_DESTINATION_PATH, $this->inp_doc_destination_path);
+ }
+
+ if ($this->isColumnModified(InputDocumentPeer::INP_DOC_TAGS)) {
+ $criteria->add(InputDocumentPeer::INP_DOC_TAGS, $this->inp_doc_tags);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(InputDocumentPeer::DATABASE_NAME);
+
+ $criteria->add(InputDocumentPeer::INP_DOC_UID, $this->inp_doc_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getInpDocUid();
+ }
+
+ /**
+ * Generic method to set the primary key (inp_doc_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setInpDocUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of InputDocument (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setInpDocFormNeeded($this->inp_doc_form_needed);
+
+ $copyObj->setInpDocOriginal($this->inp_doc_original);
+
+ $copyObj->setInpDocPublished($this->inp_doc_published);
+
+ $copyObj->setInpDocVersioning($this->inp_doc_versioning);
+
+ $copyObj->setInpDocDestinationPath($this->inp_doc_destination_path);
+
+ $copyObj->setInpDocTags($this->inp_doc_tags);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setInpDocUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return InputDocument Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return InputDocumentPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new InputDocumentPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var InputDocumentPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the inp_doc_uid field.
- * @var string
- */
- protected $inp_doc_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the inp_doc_form_needed field.
- * @var string
- */
- protected $inp_doc_form_needed = 'REAL';
-
-
- /**
- * The value for the inp_doc_original field.
- * @var string
- */
- protected $inp_doc_original = 'COPY';
-
-
- /**
- * The value for the inp_doc_published field.
- * @var string
- */
- protected $inp_doc_published = 'PRIVATE';
-
-
- /**
- * The value for the inp_doc_versioning field.
- * @var int
- */
- protected $inp_doc_versioning = 0;
-
-
- /**
- * The value for the inp_doc_destination_path field.
- * @var string
- */
- protected $inp_doc_destination_path;
-
-
- /**
- * The value for the inp_doc_tags field.
- * @var string
- */
- protected $inp_doc_tags;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [inp_doc_uid] column value.
- *
- * @return string
- */
- public function getInpDocUid()
- {
-
- return $this->inp_doc_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [inp_doc_form_needed] column value.
- *
- * @return string
- */
- public function getInpDocFormNeeded()
- {
-
- return $this->inp_doc_form_needed;
- }
-
- /**
- * Get the [inp_doc_original] column value.
- *
- * @return string
- */
- public function getInpDocOriginal()
- {
-
- return $this->inp_doc_original;
- }
-
- /**
- * Get the [inp_doc_published] column value.
- *
- * @return string
- */
- public function getInpDocPublished()
- {
-
- return $this->inp_doc_published;
- }
-
- /**
- * Get the [inp_doc_versioning] column value.
- *
- * @return int
- */
- public function getInpDocVersioning()
- {
-
- return $this->inp_doc_versioning;
- }
-
- /**
- * Get the [inp_doc_destination_path] column value.
- *
- * @return string
- */
- public function getInpDocDestinationPath()
- {
-
- return $this->inp_doc_destination_path;
- }
-
- /**
- * Get the [inp_doc_tags] column value.
- *
- * @return string
- */
- public function getInpDocTags()
- {
-
- return $this->inp_doc_tags;
- }
-
- /**
- * Set the value of [inp_doc_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setInpDocUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->inp_doc_uid !== $v || $v === '') {
- $this->inp_doc_uid = $v;
- $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_UID;
- }
-
- } // setInpDocUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = InputDocumentPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [inp_doc_form_needed] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setInpDocFormNeeded($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->inp_doc_form_needed !== $v || $v === 'REAL') {
- $this->inp_doc_form_needed = $v;
- $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_FORM_NEEDED;
- }
-
- } // setInpDocFormNeeded()
-
- /**
- * Set the value of [inp_doc_original] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setInpDocOriginal($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->inp_doc_original !== $v || $v === 'COPY') {
- $this->inp_doc_original = $v;
- $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_ORIGINAL;
- }
-
- } // setInpDocOriginal()
-
- /**
- * Set the value of [inp_doc_published] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setInpDocPublished($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->inp_doc_published !== $v || $v === 'PRIVATE') {
- $this->inp_doc_published = $v;
- $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_PUBLISHED;
- }
-
- } // setInpDocPublished()
-
- /**
- * Set the value of [inp_doc_versioning] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setInpDocVersioning($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->inp_doc_versioning !== $v || $v === 0) {
- $this->inp_doc_versioning = $v;
- $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_VERSIONING;
- }
-
- } // setInpDocVersioning()
-
- /**
- * Set the value of [inp_doc_destination_path] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setInpDocDestinationPath($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->inp_doc_destination_path !== $v) {
- $this->inp_doc_destination_path = $v;
- $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_DESTINATION_PATH;
- }
-
- } // setInpDocDestinationPath()
-
- /**
- * Set the value of [inp_doc_tags] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setInpDocTags($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->inp_doc_tags !== $v) {
- $this->inp_doc_tags = $v;
- $this->modifiedColumns[] = InputDocumentPeer::INP_DOC_TAGS;
- }
-
- } // setInpDocTags()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->inp_doc_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->inp_doc_form_needed = $rs->getString($startcol + 2);
-
- $this->inp_doc_original = $rs->getString($startcol + 3);
-
- $this->inp_doc_published = $rs->getString($startcol + 4);
-
- $this->inp_doc_versioning = $rs->getInt($startcol + 5);
-
- $this->inp_doc_destination_path = $rs->getString($startcol + 6);
-
- $this->inp_doc_tags = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = InputDocumentPeer::NUM_COLUMNS - InputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating InputDocument object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- InputDocumentPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = InputDocumentPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += InputDocumentPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = InputDocumentPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = InputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getInpDocUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getInpDocFormNeeded();
- break;
- case 3:
- return $this->getInpDocOriginal();
- break;
- case 4:
- return $this->getInpDocPublished();
- break;
- case 5:
- return $this->getInpDocVersioning();
- break;
- case 6:
- return $this->getInpDocDestinationPath();
- break;
- case 7:
- return $this->getInpDocTags();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = InputDocumentPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getInpDocUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getInpDocFormNeeded(),
- $keys[3] => $this->getInpDocOriginal(),
- $keys[4] => $this->getInpDocPublished(),
- $keys[5] => $this->getInpDocVersioning(),
- $keys[6] => $this->getInpDocDestinationPath(),
- $keys[7] => $this->getInpDocTags(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = InputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setInpDocUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setInpDocFormNeeded($value);
- break;
- case 3:
- $this->setInpDocOriginal($value);
- break;
- case 4:
- $this->setInpDocPublished($value);
- break;
- case 5:
- $this->setInpDocVersioning($value);
- break;
- case 6:
- $this->setInpDocDestinationPath($value);
- break;
- case 7:
- $this->setInpDocTags($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = InputDocumentPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setInpDocUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setInpDocFormNeeded($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setInpDocOriginal($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setInpDocPublished($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setInpDocVersioning($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setInpDocDestinationPath($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setInpDocTags($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(InputDocumentPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(InputDocumentPeer::INP_DOC_UID)) $criteria->add(InputDocumentPeer::INP_DOC_UID, $this->inp_doc_uid);
- if ($this->isColumnModified(InputDocumentPeer::PRO_UID)) $criteria->add(InputDocumentPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(InputDocumentPeer::INP_DOC_FORM_NEEDED)) $criteria->add(InputDocumentPeer::INP_DOC_FORM_NEEDED, $this->inp_doc_form_needed);
- if ($this->isColumnModified(InputDocumentPeer::INP_DOC_ORIGINAL)) $criteria->add(InputDocumentPeer::INP_DOC_ORIGINAL, $this->inp_doc_original);
- if ($this->isColumnModified(InputDocumentPeer::INP_DOC_PUBLISHED)) $criteria->add(InputDocumentPeer::INP_DOC_PUBLISHED, $this->inp_doc_published);
- if ($this->isColumnModified(InputDocumentPeer::INP_DOC_VERSIONING)) $criteria->add(InputDocumentPeer::INP_DOC_VERSIONING, $this->inp_doc_versioning);
- if ($this->isColumnModified(InputDocumentPeer::INP_DOC_DESTINATION_PATH)) $criteria->add(InputDocumentPeer::INP_DOC_DESTINATION_PATH, $this->inp_doc_destination_path);
- if ($this->isColumnModified(InputDocumentPeer::INP_DOC_TAGS)) $criteria->add(InputDocumentPeer::INP_DOC_TAGS, $this->inp_doc_tags);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(InputDocumentPeer::DATABASE_NAME);
-
- $criteria->add(InputDocumentPeer::INP_DOC_UID, $this->inp_doc_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getInpDocUid();
- }
-
- /**
- * Generic method to set the primary key (inp_doc_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setInpDocUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of InputDocument (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setInpDocFormNeeded($this->inp_doc_form_needed);
-
- $copyObj->setInpDocOriginal($this->inp_doc_original);
-
- $copyObj->setInpDocPublished($this->inp_doc_published);
-
- $copyObj->setInpDocVersioning($this->inp_doc_versioning);
-
- $copyObj->setInpDocDestinationPath($this->inp_doc_destination_path);
-
- $copyObj->setInpDocTags($this->inp_doc_tags);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setInpDocUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return InputDocument Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return InputDocumentPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new InputDocumentPeer();
- }
- return self::$peer;
- }
-
-} // BaseInputDocument
diff --git a/workflow/engine/classes/model/om/BaseInputDocumentPeer.php b/workflow/engine/classes/model/om/BaseInputDocumentPeer.php
index ce45cc68b..ed7c0acff 100755
--- a/workflow/engine/classes/model/om/BaseInputDocumentPeer.php
+++ b/workflow/engine/classes/model/om/BaseInputDocumentPeer.php
@@ -12,604 +12,606 @@ include_once 'classes/model/InputDocument.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseInputDocumentPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'INPUT_DOCUMENT';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.InputDocument';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the INP_DOC_UID field */
- const INP_DOC_UID = 'INPUT_DOCUMENT.INP_DOC_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'INPUT_DOCUMENT.PRO_UID';
-
- /** the column name for the INP_DOC_FORM_NEEDED field */
- const INP_DOC_FORM_NEEDED = 'INPUT_DOCUMENT.INP_DOC_FORM_NEEDED';
-
- /** the column name for the INP_DOC_ORIGINAL field */
- const INP_DOC_ORIGINAL = 'INPUT_DOCUMENT.INP_DOC_ORIGINAL';
-
- /** the column name for the INP_DOC_PUBLISHED field */
- const INP_DOC_PUBLISHED = 'INPUT_DOCUMENT.INP_DOC_PUBLISHED';
-
- /** the column name for the INP_DOC_VERSIONING field */
- const INP_DOC_VERSIONING = 'INPUT_DOCUMENT.INP_DOC_VERSIONING';
-
- /** the column name for the INP_DOC_DESTINATION_PATH field */
- const INP_DOC_DESTINATION_PATH = 'INPUT_DOCUMENT.INP_DOC_DESTINATION_PATH';
-
- /** the column name for the INP_DOC_TAGS field */
- const INP_DOC_TAGS = 'INPUT_DOCUMENT.INP_DOC_TAGS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('InpDocUid', 'ProUid', 'InpDocFormNeeded', 'InpDocOriginal', 'InpDocPublished', 'InpDocVersioning', 'InpDocDestinationPath', 'InpDocTags', ),
- BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID, InputDocumentPeer::PRO_UID, InputDocumentPeer::INP_DOC_FORM_NEEDED, InputDocumentPeer::INP_DOC_ORIGINAL, InputDocumentPeer::INP_DOC_PUBLISHED, InputDocumentPeer::INP_DOC_VERSIONING, InputDocumentPeer::INP_DOC_DESTINATION_PATH, InputDocumentPeer::INP_DOC_TAGS, ),
- BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID', 'PRO_UID', 'INP_DOC_FORM_NEEDED', 'INP_DOC_ORIGINAL', 'INP_DOC_PUBLISHED', 'INP_DOC_VERSIONING', 'INP_DOC_DESTINATION_PATH', 'INP_DOC_TAGS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('InpDocUid' => 0, 'ProUid' => 1, 'InpDocFormNeeded' => 2, 'InpDocOriginal' => 3, 'InpDocPublished' => 4, 'InpDocVersioning' => 5, 'InpDocDestinationPath' => 6, 'InpDocTags' => 7, ),
- BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID => 0, InputDocumentPeer::PRO_UID => 1, InputDocumentPeer::INP_DOC_FORM_NEEDED => 2, InputDocumentPeer::INP_DOC_ORIGINAL => 3, InputDocumentPeer::INP_DOC_PUBLISHED => 4, InputDocumentPeer::INP_DOC_VERSIONING => 5, InputDocumentPeer::INP_DOC_DESTINATION_PATH => 6, InputDocumentPeer::INP_DOC_TAGS => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID' => 0, 'PRO_UID' => 1, 'INP_DOC_FORM_NEEDED' => 2, 'INP_DOC_ORIGINAL' => 3, 'INP_DOC_PUBLISHED' => 4, 'INP_DOC_VERSIONING' => 5, 'INP_DOC_DESTINATION_PATH' => 6, 'INP_DOC_TAGS' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/InputDocumentMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.InputDocumentMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = InputDocumentPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. InputDocumentPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(InputDocumentPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_UID);
-
- $criteria->addSelectColumn(InputDocumentPeer::PRO_UID);
-
- $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_FORM_NEEDED);
-
- $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_ORIGINAL);
-
- $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_PUBLISHED);
-
- $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_VERSIONING);
-
- $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_DESTINATION_PATH);
-
- $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_TAGS);
-
- }
-
- const COUNT = 'COUNT(INPUT_DOCUMENT.INP_DOC_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT INPUT_DOCUMENT.INP_DOC_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(InputDocumentPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(InputDocumentPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = InputDocumentPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return InputDocument
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = InputDocumentPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return InputDocumentPeer::populateObjects(InputDocumentPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- InputDocumentPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = InputDocumentPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return InputDocumentPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a InputDocument or Criteria object.
- *
- * @param mixed $values Criteria or InputDocument object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from InputDocument object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a InputDocument or Criteria object.
- *
- * @param mixed $values Criteria or InputDocument object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(InputDocumentPeer::INP_DOC_UID);
- $selectCriteria->add(InputDocumentPeer::INP_DOC_UID, $criteria->remove(InputDocumentPeer::INP_DOC_UID), $comparison);
-
- } else { // $values is InputDocument object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the INPUT_DOCUMENT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(InputDocumentPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a InputDocument or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or InputDocument object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof InputDocument) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(InputDocumentPeer::INP_DOC_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given InputDocument object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param InputDocument $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(InputDocument $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(InputDocumentPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(InputDocumentPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_UID))
- $columns[InputDocumentPeer::INP_DOC_UID] = $obj->getInpDocUid();
-
- if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::PRO_UID))
- $columns[InputDocumentPeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_FORM_NEEDED))
- $columns[InputDocumentPeer::INP_DOC_FORM_NEEDED] = $obj->getInpDocFormNeeded();
-
- if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_ORIGINAL))
- $columns[InputDocumentPeer::INP_DOC_ORIGINAL] = $obj->getInpDocOriginal();
-
- if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_PUBLISHED))
- $columns[InputDocumentPeer::INP_DOC_PUBLISHED] = $obj->getInpDocPublished();
-
- }
-
- return BasePeer::doValidate(InputDocumentPeer::DATABASE_NAME, InputDocumentPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return InputDocument
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(InputDocumentPeer::DATABASE_NAME);
-
- $criteria->add(InputDocumentPeer::INP_DOC_UID, $pk);
-
-
- $v = InputDocumentPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(InputDocumentPeer::INP_DOC_UID, $pks, Criteria::IN);
- $objs = InputDocumentPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseInputDocumentPeer
+abstract class BaseInputDocumentPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'INPUT_DOCUMENT';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.InputDocument';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the INP_DOC_UID field */
+ const INP_DOC_UID = 'INPUT_DOCUMENT.INP_DOC_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'INPUT_DOCUMENT.PRO_UID';
+
+ /** the column name for the INP_DOC_FORM_NEEDED field */
+ const INP_DOC_FORM_NEEDED = 'INPUT_DOCUMENT.INP_DOC_FORM_NEEDED';
+
+ /** the column name for the INP_DOC_ORIGINAL field */
+ const INP_DOC_ORIGINAL = 'INPUT_DOCUMENT.INP_DOC_ORIGINAL';
+
+ /** the column name for the INP_DOC_PUBLISHED field */
+ const INP_DOC_PUBLISHED = 'INPUT_DOCUMENT.INP_DOC_PUBLISHED';
+
+ /** the column name for the INP_DOC_VERSIONING field */
+ const INP_DOC_VERSIONING = 'INPUT_DOCUMENT.INP_DOC_VERSIONING';
+
+ /** the column name for the INP_DOC_DESTINATION_PATH field */
+ const INP_DOC_DESTINATION_PATH = 'INPUT_DOCUMENT.INP_DOC_DESTINATION_PATH';
+
+ /** the column name for the INP_DOC_TAGS field */
+ const INP_DOC_TAGS = 'INPUT_DOCUMENT.INP_DOC_TAGS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('InpDocUid', 'ProUid', 'InpDocFormNeeded', 'InpDocOriginal', 'InpDocPublished', 'InpDocVersioning', 'InpDocDestinationPath', 'InpDocTags', ),
+ BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID, InputDocumentPeer::PRO_UID, InputDocumentPeer::INP_DOC_FORM_NEEDED, InputDocumentPeer::INP_DOC_ORIGINAL, InputDocumentPeer::INP_DOC_PUBLISHED, InputDocumentPeer::INP_DOC_VERSIONING, InputDocumentPeer::INP_DOC_DESTINATION_PATH, InputDocumentPeer::INP_DOC_TAGS, ),
+ BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID', 'PRO_UID', 'INP_DOC_FORM_NEEDED', 'INP_DOC_ORIGINAL', 'INP_DOC_PUBLISHED', 'INP_DOC_VERSIONING', 'INP_DOC_DESTINATION_PATH', 'INP_DOC_TAGS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('InpDocUid' => 0, 'ProUid' => 1, 'InpDocFormNeeded' => 2, 'InpDocOriginal' => 3, 'InpDocPublished' => 4, 'InpDocVersioning' => 5, 'InpDocDestinationPath' => 6, 'InpDocTags' => 7, ),
+ BasePeer::TYPE_COLNAME => array (InputDocumentPeer::INP_DOC_UID => 0, InputDocumentPeer::PRO_UID => 1, InputDocumentPeer::INP_DOC_FORM_NEEDED => 2, InputDocumentPeer::INP_DOC_ORIGINAL => 3, InputDocumentPeer::INP_DOC_PUBLISHED => 4, InputDocumentPeer::INP_DOC_VERSIONING => 5, InputDocumentPeer::INP_DOC_DESTINATION_PATH => 6, InputDocumentPeer::INP_DOC_TAGS => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('INP_DOC_UID' => 0, 'PRO_UID' => 1, 'INP_DOC_FORM_NEEDED' => 2, 'INP_DOC_ORIGINAL' => 3, 'INP_DOC_PUBLISHED' => 4, 'INP_DOC_VERSIONING' => 5, 'INP_DOC_DESTINATION_PATH' => 6, 'INP_DOC_TAGS' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/InputDocumentMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.InputDocumentMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = InputDocumentPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. InputDocumentPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(InputDocumentPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_UID);
+
+ $criteria->addSelectColumn(InputDocumentPeer::PRO_UID);
+
+ $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_FORM_NEEDED);
+
+ $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_ORIGINAL);
+
+ $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_PUBLISHED);
+
+ $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_VERSIONING);
+
+ $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_DESTINATION_PATH);
+
+ $criteria->addSelectColumn(InputDocumentPeer::INP_DOC_TAGS);
+
+ }
+
+ const COUNT = 'COUNT(INPUT_DOCUMENT.INP_DOC_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT INPUT_DOCUMENT.INP_DOC_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(InputDocumentPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(InputDocumentPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = InputDocumentPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return InputDocument
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = InputDocumentPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return InputDocumentPeer::populateObjects(InputDocumentPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ InputDocumentPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = InputDocumentPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return InputDocumentPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a InputDocument or Criteria object.
+ *
+ * @param mixed $values Criteria or InputDocument object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from InputDocument object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a InputDocument or Criteria object.
+ *
+ * @param mixed $values Criteria or InputDocument object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(InputDocumentPeer::INP_DOC_UID);
+ $selectCriteria->add(InputDocumentPeer::INP_DOC_UID, $criteria->remove(InputDocumentPeer::INP_DOC_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the INPUT_DOCUMENT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(InputDocumentPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a InputDocument or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or InputDocument object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof InputDocument) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(InputDocumentPeer::INP_DOC_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given InputDocument object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param InputDocument $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(InputDocument $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(InputDocumentPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(InputDocumentPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_UID))
+ $columns[InputDocumentPeer::INP_DOC_UID] = $obj->getInpDocUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::PRO_UID))
+ $columns[InputDocumentPeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_FORM_NEEDED))
+ $columns[InputDocumentPeer::INP_DOC_FORM_NEEDED] = $obj->getInpDocFormNeeded();
+
+ if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_ORIGINAL))
+ $columns[InputDocumentPeer::INP_DOC_ORIGINAL] = $obj->getInpDocOriginal();
+
+ if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_PUBLISHED))
+ $columns[InputDocumentPeer::INP_DOC_PUBLISHED] = $obj->getInpDocPublished();
+
+ }
+
+ return BasePeer::doValidate(InputDocumentPeer::DATABASE_NAME, InputDocumentPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return InputDocument
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(InputDocumentPeer::DATABASE_NAME);
+
+ $criteria->add(InputDocumentPeer::INP_DOC_UID, $pk);
+
+
+ $v = InputDocumentPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(InputDocumentPeer::INP_DOC_UID, $pks, Criteria::IN);
+ $objs = InputDocumentPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseInputDocumentPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseInputDocumentPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/InputDocumentMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.InputDocumentMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/InputDocumentMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.InputDocumentMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseIsoCountry.php b/workflow/engine/classes/model/om/BaseIsoCountry.php
index b16be92de..e5d14e4b6 100755
--- a/workflow/engine/classes/model/om/BaseIsoCountry.php
+++ b/workflow/engine/classes/model/om/BaseIsoCountry.php
@@ -16,595 +16,611 @@ include_once 'classes/model/IsoCountryPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseIsoCountry extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var IsoCountryPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the ic_uid field.
- * @var string
- */
- protected $ic_uid = '';
-
-
- /**
- * The value for the ic_name field.
- * @var string
- */
- protected $ic_name;
-
-
- /**
- * The value for the ic_sort_order field.
- * @var string
- */
- protected $ic_sort_order;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [ic_uid] column value.
- *
- * @return string
- */
- public function getIcUid()
- {
-
- return $this->ic_uid;
- }
-
- /**
- * Get the [ic_name] column value.
- *
- * @return string
- */
- public function getIcName()
- {
-
- return $this->ic_name;
- }
-
- /**
- * Get the [ic_sort_order] column value.
- *
- * @return string
- */
- public function getIcSortOrder()
- {
-
- return $this->ic_sort_order;
- }
-
- /**
- * Set the value of [ic_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIcUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ic_uid !== $v || $v === '') {
- $this->ic_uid = $v;
- $this->modifiedColumns[] = IsoCountryPeer::IC_UID;
- }
-
- } // setIcUid()
-
- /**
- * Set the value of [ic_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIcName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ic_name !== $v) {
- $this->ic_name = $v;
- $this->modifiedColumns[] = IsoCountryPeer::IC_NAME;
- }
-
- } // setIcName()
-
- /**
- * Set the value of [ic_sort_order] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIcSortOrder($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ic_sort_order !== $v) {
- $this->ic_sort_order = $v;
- $this->modifiedColumns[] = IsoCountryPeer::IC_SORT_ORDER;
- }
-
- } // setIcSortOrder()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->ic_uid = $rs->getString($startcol + 0);
-
- $this->ic_name = $rs->getString($startcol + 1);
-
- $this->ic_sort_order = $rs->getString($startcol + 2);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 3; // 3 = IsoCountryPeer::NUM_COLUMNS - IsoCountryPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating IsoCountry object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(IsoCountryPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- IsoCountryPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(IsoCountryPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = IsoCountryPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += IsoCountryPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = IsoCountryPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = IsoCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getIcUid();
- break;
- case 1:
- return $this->getIcName();
- break;
- case 2:
- return $this->getIcSortOrder();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = IsoCountryPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getIcUid(),
- $keys[1] => $this->getIcName(),
- $keys[2] => $this->getIcSortOrder(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = IsoCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setIcUid($value);
- break;
- case 1:
- $this->setIcName($value);
- break;
- case 2:
- $this->setIcSortOrder($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = IsoCountryPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setIcUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setIcName($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setIcSortOrder($arr[$keys[2]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(IsoCountryPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(IsoCountryPeer::IC_UID)) $criteria->add(IsoCountryPeer::IC_UID, $this->ic_uid);
- if ($this->isColumnModified(IsoCountryPeer::IC_NAME)) $criteria->add(IsoCountryPeer::IC_NAME, $this->ic_name);
- if ($this->isColumnModified(IsoCountryPeer::IC_SORT_ORDER)) $criteria->add(IsoCountryPeer::IC_SORT_ORDER, $this->ic_sort_order);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(IsoCountryPeer::DATABASE_NAME);
-
- $criteria->add(IsoCountryPeer::IC_UID, $this->ic_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getIcUid();
- }
-
- /**
- * Generic method to set the primary key (ic_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setIcUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of IsoCountry (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setIcName($this->ic_name);
-
- $copyObj->setIcSortOrder($this->ic_sort_order);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setIcUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return IsoCountry Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return IsoCountryPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new IsoCountryPeer();
- }
- return self::$peer;
- }
-
-} // BaseIsoCountry
+abstract class BaseIsoCountry extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var IsoCountryPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the ic_uid field.
+ * @var string
+ */
+ protected $ic_uid = '';
+
+ /**
+ * The value for the ic_name field.
+ * @var string
+ */
+ protected $ic_name;
+
+ /**
+ * The value for the ic_sort_order field.
+ * @var string
+ */
+ protected $ic_sort_order;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [ic_uid] column value.
+ *
+ * @return string
+ */
+ public function getIcUid()
+ {
+
+ return $this->ic_uid;
+ }
+
+ /**
+ * Get the [ic_name] column value.
+ *
+ * @return string
+ */
+ public function getIcName()
+ {
+
+ return $this->ic_name;
+ }
+
+ /**
+ * Get the [ic_sort_order] column value.
+ *
+ * @return string
+ */
+ public function getIcSortOrder()
+ {
+
+ return $this->ic_sort_order;
+ }
+
+ /**
+ * Set the value of [ic_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIcUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ic_uid !== $v || $v === '') {
+ $this->ic_uid = $v;
+ $this->modifiedColumns[] = IsoCountryPeer::IC_UID;
+ }
+
+ } // setIcUid()
+
+ /**
+ * Set the value of [ic_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIcName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ic_name !== $v) {
+ $this->ic_name = $v;
+ $this->modifiedColumns[] = IsoCountryPeer::IC_NAME;
+ }
+
+ } // setIcName()
+
+ /**
+ * Set the value of [ic_sort_order] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIcSortOrder($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ic_sort_order !== $v) {
+ $this->ic_sort_order = $v;
+ $this->modifiedColumns[] = IsoCountryPeer::IC_SORT_ORDER;
+ }
+
+ } // setIcSortOrder()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->ic_uid = $rs->getString($startcol + 0);
+
+ $this->ic_name = $rs->getString($startcol + 1);
+
+ $this->ic_sort_order = $rs->getString($startcol + 2);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 3; // 3 = IsoCountryPeer::NUM_COLUMNS - IsoCountryPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating IsoCountry object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(IsoCountryPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ IsoCountryPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(IsoCountryPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = IsoCountryPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += IsoCountryPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = IsoCountryPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = IsoCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getIcUid();
+ break;
+ case 1:
+ return $this->getIcName();
+ break;
+ case 2:
+ return $this->getIcSortOrder();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = IsoCountryPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getIcUid(),
+ $keys[1] => $this->getIcName(),
+ $keys[2] => $this->getIcSortOrder(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = IsoCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setIcUid($value);
+ break;
+ case 1:
+ $this->setIcName($value);
+ break;
+ case 2:
+ $this->setIcSortOrder($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = IsoCountryPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setIcUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setIcName($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setIcSortOrder($arr[$keys[2]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(IsoCountryPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(IsoCountryPeer::IC_UID)) {
+ $criteria->add(IsoCountryPeer::IC_UID, $this->ic_uid);
+ }
+
+ if ($this->isColumnModified(IsoCountryPeer::IC_NAME)) {
+ $criteria->add(IsoCountryPeer::IC_NAME, $this->ic_name);
+ }
+
+ if ($this->isColumnModified(IsoCountryPeer::IC_SORT_ORDER)) {
+ $criteria->add(IsoCountryPeer::IC_SORT_ORDER, $this->ic_sort_order);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(IsoCountryPeer::DATABASE_NAME);
+
+ $criteria->add(IsoCountryPeer::IC_UID, $this->ic_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getIcUid();
+ }
+
+ /**
+ * Generic method to set the primary key (ic_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setIcUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of IsoCountry (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setIcName($this->ic_name);
+
+ $copyObj->setIcSortOrder($this->ic_sort_order);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setIcUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return IsoCountry Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return IsoCountryPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new IsoCountryPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseIsoCountryPeer.php b/workflow/engine/classes/model/om/BaseIsoCountryPeer.php
index 40f537ae6..7a4ff9629 100755
--- a/workflow/engine/classes/model/om/BaseIsoCountryPeer.php
+++ b/workflow/engine/classes/model/om/BaseIsoCountryPeer.php
@@ -12,564 +12,566 @@ include_once 'classes/model/IsoCountry.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseIsoCountryPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'ISO_COUNTRY';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.IsoCountry';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 3;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the IC_UID field */
- const IC_UID = 'ISO_COUNTRY.IC_UID';
-
- /** the column name for the IC_NAME field */
- const IC_NAME = 'ISO_COUNTRY.IC_NAME';
-
- /** the column name for the IC_SORT_ORDER field */
- const IC_SORT_ORDER = 'ISO_COUNTRY.IC_SORT_ORDER';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('IcUid', 'IcName', 'IcSortOrder', ),
- BasePeer::TYPE_COLNAME => array (IsoCountryPeer::IC_UID, IsoCountryPeer::IC_NAME, IsoCountryPeer::IC_SORT_ORDER, ),
- BasePeer::TYPE_FIELDNAME => array ('IC_UID', 'IC_NAME', 'IC_SORT_ORDER', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('IcUid' => 0, 'IcName' => 1, 'IcSortOrder' => 2, ),
- BasePeer::TYPE_COLNAME => array (IsoCountryPeer::IC_UID => 0, IsoCountryPeer::IC_NAME => 1, IsoCountryPeer::IC_SORT_ORDER => 2, ),
- BasePeer::TYPE_FIELDNAME => array ('IC_UID' => 0, 'IC_NAME' => 1, 'IC_SORT_ORDER' => 2, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/IsoCountryMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.IsoCountryMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = IsoCountryPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. IsoCountryPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(IsoCountryPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(IsoCountryPeer::IC_UID);
-
- $criteria->addSelectColumn(IsoCountryPeer::IC_NAME);
-
- $criteria->addSelectColumn(IsoCountryPeer::IC_SORT_ORDER);
-
- }
-
- const COUNT = 'COUNT(ISO_COUNTRY.IC_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT ISO_COUNTRY.IC_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(IsoCountryPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(IsoCountryPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = IsoCountryPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return IsoCountry
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = IsoCountryPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return IsoCountryPeer::populateObjects(IsoCountryPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- IsoCountryPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = IsoCountryPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return IsoCountryPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a IsoCountry or Criteria object.
- *
- * @param mixed $values Criteria or IsoCountry object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from IsoCountry object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a IsoCountry or Criteria object.
- *
- * @param mixed $values Criteria or IsoCountry object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(IsoCountryPeer::IC_UID);
- $selectCriteria->add(IsoCountryPeer::IC_UID, $criteria->remove(IsoCountryPeer::IC_UID), $comparison);
-
- } else { // $values is IsoCountry object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the ISO_COUNTRY table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(IsoCountryPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a IsoCountry or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or IsoCountry object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(IsoCountryPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof IsoCountry) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(IsoCountryPeer::IC_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given IsoCountry object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param IsoCountry $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(IsoCountry $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(IsoCountryPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(IsoCountryPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(IsoCountryPeer::DATABASE_NAME, IsoCountryPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return IsoCountry
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(IsoCountryPeer::DATABASE_NAME);
-
- $criteria->add(IsoCountryPeer::IC_UID, $pk);
-
-
- $v = IsoCountryPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(IsoCountryPeer::IC_UID, $pks, Criteria::IN);
- $objs = IsoCountryPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseIsoCountryPeer
+abstract class BaseIsoCountryPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'ISO_COUNTRY';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.IsoCountry';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 3;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the IC_UID field */
+ const IC_UID = 'ISO_COUNTRY.IC_UID';
+
+ /** the column name for the IC_NAME field */
+ const IC_NAME = 'ISO_COUNTRY.IC_NAME';
+
+ /** the column name for the IC_SORT_ORDER field */
+ const IC_SORT_ORDER = 'ISO_COUNTRY.IC_SORT_ORDER';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('IcUid', 'IcName', 'IcSortOrder', ),
+ BasePeer::TYPE_COLNAME => array (IsoCountryPeer::IC_UID, IsoCountryPeer::IC_NAME, IsoCountryPeer::IC_SORT_ORDER, ),
+ BasePeer::TYPE_FIELDNAME => array ('IC_UID', 'IC_NAME', 'IC_SORT_ORDER', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('IcUid' => 0, 'IcName' => 1, 'IcSortOrder' => 2, ),
+ BasePeer::TYPE_COLNAME => array (IsoCountryPeer::IC_UID => 0, IsoCountryPeer::IC_NAME => 1, IsoCountryPeer::IC_SORT_ORDER => 2, ),
+ BasePeer::TYPE_FIELDNAME => array ('IC_UID' => 0, 'IC_NAME' => 1, 'IC_SORT_ORDER' => 2, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/IsoCountryMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.IsoCountryMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = IsoCountryPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. IsoCountryPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(IsoCountryPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(IsoCountryPeer::IC_UID);
+
+ $criteria->addSelectColumn(IsoCountryPeer::IC_NAME);
+
+ $criteria->addSelectColumn(IsoCountryPeer::IC_SORT_ORDER);
+
+ }
+
+ const COUNT = 'COUNT(ISO_COUNTRY.IC_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT ISO_COUNTRY.IC_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(IsoCountryPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(IsoCountryPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = IsoCountryPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return IsoCountry
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = IsoCountryPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return IsoCountryPeer::populateObjects(IsoCountryPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ IsoCountryPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = IsoCountryPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return IsoCountryPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a IsoCountry or Criteria object.
+ *
+ * @param mixed $values Criteria or IsoCountry object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from IsoCountry object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a IsoCountry or Criteria object.
+ *
+ * @param mixed $values Criteria or IsoCountry object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(IsoCountryPeer::IC_UID);
+ $selectCriteria->add(IsoCountryPeer::IC_UID, $criteria->remove(IsoCountryPeer::IC_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the ISO_COUNTRY table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(IsoCountryPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a IsoCountry or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or IsoCountry object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(IsoCountryPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof IsoCountry) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(IsoCountryPeer::IC_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given IsoCountry object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param IsoCountry $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(IsoCountry $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(IsoCountryPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(IsoCountryPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(IsoCountryPeer::DATABASE_NAME, IsoCountryPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return IsoCountry
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(IsoCountryPeer::DATABASE_NAME);
+
+ $criteria->add(IsoCountryPeer::IC_UID, $pk);
+
+
+ $v = IsoCountryPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(IsoCountryPeer::IC_UID, $pks, Criteria::IN);
+ $objs = IsoCountryPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseIsoCountryPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseIsoCountryPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/IsoCountryMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.IsoCountryMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/IsoCountryMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.IsoCountryMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseIsoLocation.php b/workflow/engine/classes/model/om/BaseIsoLocation.php
index 1fb8393d7..f60863923 100755
--- a/workflow/engine/classes/model/om/BaseIsoLocation.php
+++ b/workflow/engine/classes/model/om/BaseIsoLocation.php
@@ -16,713 +16,739 @@ include_once 'classes/model/IsoLocationPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseIsoLocation extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var IsoLocationPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the ic_uid field.
- * @var string
- */
- protected $ic_uid = '';
-
-
- /**
- * The value for the il_uid field.
- * @var string
- */
- protected $il_uid = '';
-
-
- /**
- * The value for the il_name field.
- * @var string
- */
- protected $il_name;
-
-
- /**
- * The value for the il_normal_name field.
- * @var string
- */
- protected $il_normal_name;
-
-
- /**
- * The value for the is_uid field.
- * @var string
- */
- protected $is_uid;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [ic_uid] column value.
- *
- * @return string
- */
- public function getIcUid()
- {
-
- return $this->ic_uid;
- }
-
- /**
- * Get the [il_uid] column value.
- *
- * @return string
- */
- public function getIlUid()
- {
-
- return $this->il_uid;
- }
-
- /**
- * Get the [il_name] column value.
- *
- * @return string
- */
- public function getIlName()
- {
-
- return $this->il_name;
- }
-
- /**
- * Get the [il_normal_name] column value.
- *
- * @return string
- */
- public function getIlNormalName()
- {
-
- return $this->il_normal_name;
- }
-
- /**
- * Get the [is_uid] column value.
- *
- * @return string
- */
- public function getIsUid()
- {
-
- return $this->is_uid;
- }
-
- /**
- * Set the value of [ic_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIcUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ic_uid !== $v || $v === '') {
- $this->ic_uid = $v;
- $this->modifiedColumns[] = IsoLocationPeer::IC_UID;
- }
-
- } // setIcUid()
-
- /**
- * Set the value of [il_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIlUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->il_uid !== $v || $v === '') {
- $this->il_uid = $v;
- $this->modifiedColumns[] = IsoLocationPeer::IL_UID;
- }
-
- } // setIlUid()
-
- /**
- * Set the value of [il_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIlName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->il_name !== $v) {
- $this->il_name = $v;
- $this->modifiedColumns[] = IsoLocationPeer::IL_NAME;
- }
-
- } // setIlName()
-
- /**
- * Set the value of [il_normal_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIlNormalName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->il_normal_name !== $v) {
- $this->il_normal_name = $v;
- $this->modifiedColumns[] = IsoLocationPeer::IL_NORMAL_NAME;
- }
-
- } // setIlNormalName()
-
- /**
- * Set the value of [is_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIsUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->is_uid !== $v) {
- $this->is_uid = $v;
- $this->modifiedColumns[] = IsoLocationPeer::IS_UID;
- }
-
- } // setIsUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->ic_uid = $rs->getString($startcol + 0);
-
- $this->il_uid = $rs->getString($startcol + 1);
-
- $this->il_name = $rs->getString($startcol + 2);
-
- $this->il_normal_name = $rs->getString($startcol + 3);
-
- $this->is_uid = $rs->getString($startcol + 4);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = IsoLocationPeer::NUM_COLUMNS - IsoLocationPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating IsoLocation object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(IsoLocationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- IsoLocationPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(IsoLocationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = IsoLocationPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += IsoLocationPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = IsoLocationPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = IsoLocationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getIcUid();
- break;
- case 1:
- return $this->getIlUid();
- break;
- case 2:
- return $this->getIlName();
- break;
- case 3:
- return $this->getIlNormalName();
- break;
- case 4:
- return $this->getIsUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = IsoLocationPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getIcUid(),
- $keys[1] => $this->getIlUid(),
- $keys[2] => $this->getIlName(),
- $keys[3] => $this->getIlNormalName(),
- $keys[4] => $this->getIsUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = IsoLocationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setIcUid($value);
- break;
- case 1:
- $this->setIlUid($value);
- break;
- case 2:
- $this->setIlName($value);
- break;
- case 3:
- $this->setIlNormalName($value);
- break;
- case 4:
- $this->setIsUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = IsoLocationPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setIcUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setIlUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setIlName($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setIlNormalName($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setIsUid($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(IsoLocationPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(IsoLocationPeer::IC_UID)) $criteria->add(IsoLocationPeer::IC_UID, $this->ic_uid);
- if ($this->isColumnModified(IsoLocationPeer::IL_UID)) $criteria->add(IsoLocationPeer::IL_UID, $this->il_uid);
- if ($this->isColumnModified(IsoLocationPeer::IL_NAME)) $criteria->add(IsoLocationPeer::IL_NAME, $this->il_name);
- if ($this->isColumnModified(IsoLocationPeer::IL_NORMAL_NAME)) $criteria->add(IsoLocationPeer::IL_NORMAL_NAME, $this->il_normal_name);
- if ($this->isColumnModified(IsoLocationPeer::IS_UID)) $criteria->add(IsoLocationPeer::IS_UID, $this->is_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(IsoLocationPeer::DATABASE_NAME);
-
- $criteria->add(IsoLocationPeer::IC_UID, $this->ic_uid);
- $criteria->add(IsoLocationPeer::IL_UID, $this->il_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getIcUid();
-
- $pks[1] = $this->getIlUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setIcUid($keys[0]);
-
- $this->setIlUid($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of IsoLocation (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setIlName($this->il_name);
-
- $copyObj->setIlNormalName($this->il_normal_name);
-
- $copyObj->setIsUid($this->is_uid);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setIcUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setIlUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return IsoLocation Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return IsoLocationPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new IsoLocationPeer();
- }
- return self::$peer;
- }
-
-} // BaseIsoLocation
+abstract class BaseIsoLocation extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var IsoLocationPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the ic_uid field.
+ * @var string
+ */
+ protected $ic_uid = '';
+
+ /**
+ * The value for the il_uid field.
+ * @var string
+ */
+ protected $il_uid = '';
+
+ /**
+ * The value for the il_name field.
+ * @var string
+ */
+ protected $il_name;
+
+ /**
+ * The value for the il_normal_name field.
+ * @var string
+ */
+ protected $il_normal_name;
+
+ /**
+ * The value for the is_uid field.
+ * @var string
+ */
+ protected $is_uid;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [ic_uid] column value.
+ *
+ * @return string
+ */
+ public function getIcUid()
+ {
+
+ return $this->ic_uid;
+ }
+
+ /**
+ * Get the [il_uid] column value.
+ *
+ * @return string
+ */
+ public function getIlUid()
+ {
+
+ return $this->il_uid;
+ }
+
+ /**
+ * Get the [il_name] column value.
+ *
+ * @return string
+ */
+ public function getIlName()
+ {
+
+ return $this->il_name;
+ }
+
+ /**
+ * Get the [il_normal_name] column value.
+ *
+ * @return string
+ */
+ public function getIlNormalName()
+ {
+
+ return $this->il_normal_name;
+ }
+
+ /**
+ * Get the [is_uid] column value.
+ *
+ * @return string
+ */
+ public function getIsUid()
+ {
+
+ return $this->is_uid;
+ }
+
+ /**
+ * Set the value of [ic_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIcUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ic_uid !== $v || $v === '') {
+ $this->ic_uid = $v;
+ $this->modifiedColumns[] = IsoLocationPeer::IC_UID;
+ }
+
+ } // setIcUid()
+
+ /**
+ * Set the value of [il_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIlUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->il_uid !== $v || $v === '') {
+ $this->il_uid = $v;
+ $this->modifiedColumns[] = IsoLocationPeer::IL_UID;
+ }
+
+ } // setIlUid()
+
+ /**
+ * Set the value of [il_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIlName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->il_name !== $v) {
+ $this->il_name = $v;
+ $this->modifiedColumns[] = IsoLocationPeer::IL_NAME;
+ }
+
+ } // setIlName()
+
+ /**
+ * Set the value of [il_normal_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIlNormalName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->il_normal_name !== $v) {
+ $this->il_normal_name = $v;
+ $this->modifiedColumns[] = IsoLocationPeer::IL_NORMAL_NAME;
+ }
+
+ } // setIlNormalName()
+
+ /**
+ * Set the value of [is_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIsUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->is_uid !== $v) {
+ $this->is_uid = $v;
+ $this->modifiedColumns[] = IsoLocationPeer::IS_UID;
+ }
+
+ } // setIsUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->ic_uid = $rs->getString($startcol + 0);
+
+ $this->il_uid = $rs->getString($startcol + 1);
+
+ $this->il_name = $rs->getString($startcol + 2);
+
+ $this->il_normal_name = $rs->getString($startcol + 3);
+
+ $this->is_uid = $rs->getString($startcol + 4);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = IsoLocationPeer::NUM_COLUMNS - IsoLocationPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating IsoLocation object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(IsoLocationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ IsoLocationPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(IsoLocationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = IsoLocationPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += IsoLocationPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = IsoLocationPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = IsoLocationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getIcUid();
+ break;
+ case 1:
+ return $this->getIlUid();
+ break;
+ case 2:
+ return $this->getIlName();
+ break;
+ case 3:
+ return $this->getIlNormalName();
+ break;
+ case 4:
+ return $this->getIsUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = IsoLocationPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getIcUid(),
+ $keys[1] => $this->getIlUid(),
+ $keys[2] => $this->getIlName(),
+ $keys[3] => $this->getIlNormalName(),
+ $keys[4] => $this->getIsUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = IsoLocationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setIcUid($value);
+ break;
+ case 1:
+ $this->setIlUid($value);
+ break;
+ case 2:
+ $this->setIlName($value);
+ break;
+ case 3:
+ $this->setIlNormalName($value);
+ break;
+ case 4:
+ $this->setIsUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = IsoLocationPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setIcUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setIlUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setIlName($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setIlNormalName($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setIsUid($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(IsoLocationPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(IsoLocationPeer::IC_UID)) {
+ $criteria->add(IsoLocationPeer::IC_UID, $this->ic_uid);
+ }
+
+ if ($this->isColumnModified(IsoLocationPeer::IL_UID)) {
+ $criteria->add(IsoLocationPeer::IL_UID, $this->il_uid);
+ }
+
+ if ($this->isColumnModified(IsoLocationPeer::IL_NAME)) {
+ $criteria->add(IsoLocationPeer::IL_NAME, $this->il_name);
+ }
+
+ if ($this->isColumnModified(IsoLocationPeer::IL_NORMAL_NAME)) {
+ $criteria->add(IsoLocationPeer::IL_NORMAL_NAME, $this->il_normal_name);
+ }
+
+ if ($this->isColumnModified(IsoLocationPeer::IS_UID)) {
+ $criteria->add(IsoLocationPeer::IS_UID, $this->is_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(IsoLocationPeer::DATABASE_NAME);
+
+ $criteria->add(IsoLocationPeer::IC_UID, $this->ic_uid);
+ $criteria->add(IsoLocationPeer::IL_UID, $this->il_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getIcUid();
+
+ $pks[1] = $this->getIlUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setIcUid($keys[0]);
+
+ $this->setIlUid($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of IsoLocation (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setIlName($this->il_name);
+
+ $copyObj->setIlNormalName($this->il_normal_name);
+
+ $copyObj->setIsUid($this->is_uid);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setIcUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setIlUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return IsoLocation Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return IsoLocationPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new IsoLocationPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseIsoLocationPeer.php b/workflow/engine/classes/model/om/BaseIsoLocationPeer.php
index a4f8de5b3..ff4a712de 100755
--- a/workflow/engine/classes/model/om/BaseIsoLocationPeer.php
+++ b/workflow/engine/classes/model/om/BaseIsoLocationPeer.php
@@ -12,565 +12,566 @@ include_once 'classes/model/IsoLocation.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseIsoLocationPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'ISO_LOCATION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.IsoLocation';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the IC_UID field */
- const IC_UID = 'ISO_LOCATION.IC_UID';
-
- /** the column name for the IL_UID field */
- const IL_UID = 'ISO_LOCATION.IL_UID';
-
- /** the column name for the IL_NAME field */
- const IL_NAME = 'ISO_LOCATION.IL_NAME';
-
- /** the column name for the IL_NORMAL_NAME field */
- const IL_NORMAL_NAME = 'ISO_LOCATION.IL_NORMAL_NAME';
-
- /** the column name for the IS_UID field */
- const IS_UID = 'ISO_LOCATION.IS_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('IcUid', 'IlUid', 'IlName', 'IlNormalName', 'IsUid', ),
- BasePeer::TYPE_COLNAME => array (IsoLocationPeer::IC_UID, IsoLocationPeer::IL_UID, IsoLocationPeer::IL_NAME, IsoLocationPeer::IL_NORMAL_NAME, IsoLocationPeer::IS_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('IC_UID', 'IL_UID', 'IL_NAME', 'IL_NORMAL_NAME', 'IS_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('IcUid' => 0, 'IlUid' => 1, 'IlName' => 2, 'IlNormalName' => 3, 'IsUid' => 4, ),
- BasePeer::TYPE_COLNAME => array (IsoLocationPeer::IC_UID => 0, IsoLocationPeer::IL_UID => 1, IsoLocationPeer::IL_NAME => 2, IsoLocationPeer::IL_NORMAL_NAME => 3, IsoLocationPeer::IS_UID => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('IC_UID' => 0, 'IL_UID' => 1, 'IL_NAME' => 2, 'IL_NORMAL_NAME' => 3, 'IS_UID' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/IsoLocationMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.IsoLocationMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = IsoLocationPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. IsoLocationPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(IsoLocationPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(IsoLocationPeer::IC_UID);
-
- $criteria->addSelectColumn(IsoLocationPeer::IL_UID);
-
- $criteria->addSelectColumn(IsoLocationPeer::IL_NAME);
-
- $criteria->addSelectColumn(IsoLocationPeer::IL_NORMAL_NAME);
-
- $criteria->addSelectColumn(IsoLocationPeer::IS_UID);
-
- }
-
- const COUNT = 'COUNT(ISO_LOCATION.IC_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT ISO_LOCATION.IC_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(IsoLocationPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(IsoLocationPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = IsoLocationPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return IsoLocation
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = IsoLocationPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return IsoLocationPeer::populateObjects(IsoLocationPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- IsoLocationPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = IsoLocationPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return IsoLocationPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a IsoLocation or Criteria object.
- *
- * @param mixed $values Criteria or IsoLocation object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from IsoLocation object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a IsoLocation or Criteria object.
- *
- * @param mixed $values Criteria or IsoLocation object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(IsoLocationPeer::IC_UID);
- $selectCriteria->add(IsoLocationPeer::IC_UID, $criteria->remove(IsoLocationPeer::IC_UID), $comparison);
-
- $comparison = $criteria->getComparison(IsoLocationPeer::IL_UID);
- $selectCriteria->add(IsoLocationPeer::IL_UID, $criteria->remove(IsoLocationPeer::IL_UID), $comparison);
-
- } else { // $values is IsoLocation object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the ISO_LOCATION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(IsoLocationPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a IsoLocation or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or IsoLocation object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(IsoLocationPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof IsoLocation) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
-
- $criteria->add(IsoLocationPeer::IC_UID, $vals[0], Criteria::IN);
- $criteria->add(IsoLocationPeer::IL_UID, $vals[1], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given IsoLocation object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param IsoLocation $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(IsoLocation $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(IsoLocationPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(IsoLocationPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(IsoLocationPeer::DATABASE_NAME, IsoLocationPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $ic_uid
- @param string $il_uid
-
- * @param Connection $con
- * @return IsoLocation
- */
- public static function retrieveByPK( $ic_uid, $il_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(IsoLocationPeer::IC_UID, $ic_uid);
- $criteria->add(IsoLocationPeer::IL_UID, $il_uid);
- $v = IsoLocationPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseIsoLocationPeer
+abstract class BaseIsoLocationPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'ISO_LOCATION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.IsoLocation';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the IC_UID field */
+ const IC_UID = 'ISO_LOCATION.IC_UID';
+
+ /** the column name for the IL_UID field */
+ const IL_UID = 'ISO_LOCATION.IL_UID';
+
+ /** the column name for the IL_NAME field */
+ const IL_NAME = 'ISO_LOCATION.IL_NAME';
+
+ /** the column name for the IL_NORMAL_NAME field */
+ const IL_NORMAL_NAME = 'ISO_LOCATION.IL_NORMAL_NAME';
+
+ /** the column name for the IS_UID field */
+ const IS_UID = 'ISO_LOCATION.IS_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('IcUid', 'IlUid', 'IlName', 'IlNormalName', 'IsUid', ),
+ BasePeer::TYPE_COLNAME => array (IsoLocationPeer::IC_UID, IsoLocationPeer::IL_UID, IsoLocationPeer::IL_NAME, IsoLocationPeer::IL_NORMAL_NAME, IsoLocationPeer::IS_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('IC_UID', 'IL_UID', 'IL_NAME', 'IL_NORMAL_NAME', 'IS_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('IcUid' => 0, 'IlUid' => 1, 'IlName' => 2, 'IlNormalName' => 3, 'IsUid' => 4, ),
+ BasePeer::TYPE_COLNAME => array (IsoLocationPeer::IC_UID => 0, IsoLocationPeer::IL_UID => 1, IsoLocationPeer::IL_NAME => 2, IsoLocationPeer::IL_NORMAL_NAME => 3, IsoLocationPeer::IS_UID => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('IC_UID' => 0, 'IL_UID' => 1, 'IL_NAME' => 2, 'IL_NORMAL_NAME' => 3, 'IS_UID' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/IsoLocationMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.IsoLocationMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = IsoLocationPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. IsoLocationPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(IsoLocationPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(IsoLocationPeer::IC_UID);
+
+ $criteria->addSelectColumn(IsoLocationPeer::IL_UID);
+
+ $criteria->addSelectColumn(IsoLocationPeer::IL_NAME);
+
+ $criteria->addSelectColumn(IsoLocationPeer::IL_NORMAL_NAME);
+
+ $criteria->addSelectColumn(IsoLocationPeer::IS_UID);
+
+ }
+
+ const COUNT = 'COUNT(ISO_LOCATION.IC_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT ISO_LOCATION.IC_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(IsoLocationPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(IsoLocationPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = IsoLocationPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return IsoLocation
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = IsoLocationPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return IsoLocationPeer::populateObjects(IsoLocationPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ IsoLocationPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = IsoLocationPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return IsoLocationPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a IsoLocation or Criteria object.
+ *
+ * @param mixed $values Criteria or IsoLocation object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from IsoLocation object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a IsoLocation or Criteria object.
+ *
+ * @param mixed $values Criteria or IsoLocation object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(IsoLocationPeer::IC_UID);
+ $selectCriteria->add(IsoLocationPeer::IC_UID, $criteria->remove(IsoLocationPeer::IC_UID), $comparison);
+
+ $comparison = $criteria->getComparison(IsoLocationPeer::IL_UID);
+ $selectCriteria->add(IsoLocationPeer::IL_UID, $criteria->remove(IsoLocationPeer::IL_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the ISO_LOCATION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(IsoLocationPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a IsoLocation or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or IsoLocation object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(IsoLocationPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof IsoLocation) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
+
+ $criteria->add(IsoLocationPeer::IC_UID, $vals[0], Criteria::IN);
+ $criteria->add(IsoLocationPeer::IL_UID, $vals[1], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given IsoLocation object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param IsoLocation $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(IsoLocation $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(IsoLocationPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(IsoLocationPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(IsoLocationPeer::DATABASE_NAME, IsoLocationPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $ic_uid
+ * @param string $il_uid
+ * @param Connection $con
+ * @return IsoLocation
+ */
+ public static function retrieveByPK($ic_uid, $il_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(IsoLocationPeer::IC_UID, $ic_uid);
+ $criteria->add(IsoLocationPeer::IL_UID, $il_uid);
+ $v = IsoLocationPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseIsoLocationPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseIsoLocationPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/IsoLocationMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.IsoLocationMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/IsoLocationMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.IsoLocationMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseIsoSubdivision.php b/workflow/engine/classes/model/om/BaseIsoSubdivision.php
index 2cc9f4880..a349c3989 100755
--- a/workflow/engine/classes/model/om/BaseIsoSubdivision.php
+++ b/workflow/engine/classes/model/om/BaseIsoSubdivision.php
@@ -16,607 +16,623 @@ include_once 'classes/model/IsoSubdivisionPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseIsoSubdivision extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var IsoSubdivisionPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the ic_uid field.
- * @var string
- */
- protected $ic_uid = '';
-
-
- /**
- * The value for the is_uid field.
- * @var string
- */
- protected $is_uid = '';
-
-
- /**
- * The value for the is_name field.
- * @var string
- */
- protected $is_name = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [ic_uid] column value.
- *
- * @return string
- */
- public function getIcUid()
- {
-
- return $this->ic_uid;
- }
-
- /**
- * Get the [is_uid] column value.
- *
- * @return string
- */
- public function getIsUid()
- {
-
- return $this->is_uid;
- }
-
- /**
- * Get the [is_name] column value.
- *
- * @return string
- */
- public function getIsName()
- {
-
- return $this->is_name;
- }
-
- /**
- * Set the value of [ic_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIcUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ic_uid !== $v || $v === '') {
- $this->ic_uid = $v;
- $this->modifiedColumns[] = IsoSubdivisionPeer::IC_UID;
- }
-
- } // setIcUid()
-
- /**
- * Set the value of [is_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIsUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->is_uid !== $v || $v === '') {
- $this->is_uid = $v;
- $this->modifiedColumns[] = IsoSubdivisionPeer::IS_UID;
- }
-
- } // setIsUid()
-
- /**
- * Set the value of [is_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setIsName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->is_name !== $v || $v === '') {
- $this->is_name = $v;
- $this->modifiedColumns[] = IsoSubdivisionPeer::IS_NAME;
- }
-
- } // setIsName()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->ic_uid = $rs->getString($startcol + 0);
-
- $this->is_uid = $rs->getString($startcol + 1);
-
- $this->is_name = $rs->getString($startcol + 2);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 3; // 3 = IsoSubdivisionPeer::NUM_COLUMNS - IsoSubdivisionPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating IsoSubdivision object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(IsoSubdivisionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- IsoSubdivisionPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(IsoSubdivisionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = IsoSubdivisionPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += IsoSubdivisionPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = IsoSubdivisionPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = IsoSubdivisionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getIcUid();
- break;
- case 1:
- return $this->getIsUid();
- break;
- case 2:
- return $this->getIsName();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = IsoSubdivisionPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getIcUid(),
- $keys[1] => $this->getIsUid(),
- $keys[2] => $this->getIsName(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = IsoSubdivisionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setIcUid($value);
- break;
- case 1:
- $this->setIsUid($value);
- break;
- case 2:
- $this->setIsName($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = IsoSubdivisionPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setIcUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setIsUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setIsName($arr[$keys[2]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(IsoSubdivisionPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(IsoSubdivisionPeer::IC_UID)) $criteria->add(IsoSubdivisionPeer::IC_UID, $this->ic_uid);
- if ($this->isColumnModified(IsoSubdivisionPeer::IS_UID)) $criteria->add(IsoSubdivisionPeer::IS_UID, $this->is_uid);
- if ($this->isColumnModified(IsoSubdivisionPeer::IS_NAME)) $criteria->add(IsoSubdivisionPeer::IS_NAME, $this->is_name);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(IsoSubdivisionPeer::DATABASE_NAME);
-
- $criteria->add(IsoSubdivisionPeer::IC_UID, $this->ic_uid);
- $criteria->add(IsoSubdivisionPeer::IS_UID, $this->is_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getIcUid();
-
- $pks[1] = $this->getIsUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setIcUid($keys[0]);
-
- $this->setIsUid($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of IsoSubdivision (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setIsName($this->is_name);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setIcUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setIsUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return IsoSubdivision Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return IsoSubdivisionPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new IsoSubdivisionPeer();
- }
- return self::$peer;
- }
-
-} // BaseIsoSubdivision
+abstract class BaseIsoSubdivision extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var IsoSubdivisionPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the ic_uid field.
+ * @var string
+ */
+ protected $ic_uid = '';
+
+ /**
+ * The value for the is_uid field.
+ * @var string
+ */
+ protected $is_uid = '';
+
+ /**
+ * The value for the is_name field.
+ * @var string
+ */
+ protected $is_name = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [ic_uid] column value.
+ *
+ * @return string
+ */
+ public function getIcUid()
+ {
+
+ return $this->ic_uid;
+ }
+
+ /**
+ * Get the [is_uid] column value.
+ *
+ * @return string
+ */
+ public function getIsUid()
+ {
+
+ return $this->is_uid;
+ }
+
+ /**
+ * Get the [is_name] column value.
+ *
+ * @return string
+ */
+ public function getIsName()
+ {
+
+ return $this->is_name;
+ }
+
+ /**
+ * Set the value of [ic_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIcUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ic_uid !== $v || $v === '') {
+ $this->ic_uid = $v;
+ $this->modifiedColumns[] = IsoSubdivisionPeer::IC_UID;
+ }
+
+ } // setIcUid()
+
+ /**
+ * Set the value of [is_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIsUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->is_uid !== $v || $v === '') {
+ $this->is_uid = $v;
+ $this->modifiedColumns[] = IsoSubdivisionPeer::IS_UID;
+ }
+
+ } // setIsUid()
+
+ /**
+ * Set the value of [is_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setIsName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->is_name !== $v || $v === '') {
+ $this->is_name = $v;
+ $this->modifiedColumns[] = IsoSubdivisionPeer::IS_NAME;
+ }
+
+ } // setIsName()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->ic_uid = $rs->getString($startcol + 0);
+
+ $this->is_uid = $rs->getString($startcol + 1);
+
+ $this->is_name = $rs->getString($startcol + 2);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 3; // 3 = IsoSubdivisionPeer::NUM_COLUMNS - IsoSubdivisionPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating IsoSubdivision object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(IsoSubdivisionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ IsoSubdivisionPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(IsoSubdivisionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = IsoSubdivisionPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += IsoSubdivisionPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = IsoSubdivisionPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = IsoSubdivisionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getIcUid();
+ break;
+ case 1:
+ return $this->getIsUid();
+ break;
+ case 2:
+ return $this->getIsName();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = IsoSubdivisionPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getIcUid(),
+ $keys[1] => $this->getIsUid(),
+ $keys[2] => $this->getIsName(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = IsoSubdivisionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setIcUid($value);
+ break;
+ case 1:
+ $this->setIsUid($value);
+ break;
+ case 2:
+ $this->setIsName($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = IsoSubdivisionPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setIcUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setIsUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setIsName($arr[$keys[2]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(IsoSubdivisionPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(IsoSubdivisionPeer::IC_UID)) {
+ $criteria->add(IsoSubdivisionPeer::IC_UID, $this->ic_uid);
+ }
+
+ if ($this->isColumnModified(IsoSubdivisionPeer::IS_UID)) {
+ $criteria->add(IsoSubdivisionPeer::IS_UID, $this->is_uid);
+ }
+
+ if ($this->isColumnModified(IsoSubdivisionPeer::IS_NAME)) {
+ $criteria->add(IsoSubdivisionPeer::IS_NAME, $this->is_name);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(IsoSubdivisionPeer::DATABASE_NAME);
+
+ $criteria->add(IsoSubdivisionPeer::IC_UID, $this->ic_uid);
+ $criteria->add(IsoSubdivisionPeer::IS_UID, $this->is_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getIcUid();
+
+ $pks[1] = $this->getIsUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setIcUid($keys[0]);
+
+ $this->setIsUid($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of IsoSubdivision (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setIsName($this->is_name);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setIcUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setIsUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return IsoSubdivision Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return IsoSubdivisionPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new IsoSubdivisionPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseIsoSubdivisionPeer.php b/workflow/engine/classes/model/om/BaseIsoSubdivisionPeer.php
index e80765db1..46fa2e3d8 100755
--- a/workflow/engine/classes/model/om/BaseIsoSubdivisionPeer.php
+++ b/workflow/engine/classes/model/om/BaseIsoSubdivisionPeer.php
@@ -12,555 +12,556 @@ include_once 'classes/model/IsoSubdivision.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseIsoSubdivisionPeer {
+abstract class BaseIsoSubdivisionPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'ISO_SUBDIVISION';
+ /** the table name for this class */
+ const TABLE_NAME = 'ISO_SUBDIVISION';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.IsoSubdivision';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.IsoSubdivision';
- /** The total number of columns. */
- const NUM_COLUMNS = 3;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 3;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the IC_UID field */
- const IC_UID = 'ISO_SUBDIVISION.IC_UID';
+ /** the column name for the IC_UID field */
+ const IC_UID = 'ISO_SUBDIVISION.IC_UID';
- /** the column name for the IS_UID field */
- const IS_UID = 'ISO_SUBDIVISION.IS_UID';
+ /** the column name for the IS_UID field */
+ const IS_UID = 'ISO_SUBDIVISION.IS_UID';
- /** the column name for the IS_NAME field */
- const IS_NAME = 'ISO_SUBDIVISION.IS_NAME';
+ /** the column name for the IS_NAME field */
+ const IS_NAME = 'ISO_SUBDIVISION.IS_NAME';
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('IcUid', 'IsUid', 'IsName', ),
- BasePeer::TYPE_COLNAME => array (IsoSubdivisionPeer::IC_UID, IsoSubdivisionPeer::IS_UID, IsoSubdivisionPeer::IS_NAME, ),
- BasePeer::TYPE_FIELDNAME => array ('IC_UID', 'IS_UID', 'IS_NAME', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('IcUid', 'IsUid', 'IsName', ),
+ BasePeer::TYPE_COLNAME => array (IsoSubdivisionPeer::IC_UID, IsoSubdivisionPeer::IS_UID, IsoSubdivisionPeer::IS_NAME, ),
+ BasePeer::TYPE_FIELDNAME => array ('IC_UID', 'IS_UID', 'IS_NAME', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('IcUid' => 0, 'IsUid' => 1, 'IsName' => 2, ),
- BasePeer::TYPE_COLNAME => array (IsoSubdivisionPeer::IC_UID => 0, IsoSubdivisionPeer::IS_UID => 1, IsoSubdivisionPeer::IS_NAME => 2, ),
- BasePeer::TYPE_FIELDNAME => array ('IC_UID' => 0, 'IS_UID' => 1, 'IS_NAME' => 2, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, )
- );
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('IcUid' => 0, 'IsUid' => 1, 'IsName' => 2, ),
+ BasePeer::TYPE_COLNAME => array (IsoSubdivisionPeer::IC_UID => 0, IsoSubdivisionPeer::IS_UID => 1, IsoSubdivisionPeer::IS_NAME => 2, ),
+ BasePeer::TYPE_FIELDNAME => array ('IC_UID' => 0, 'IS_UID' => 1, 'IS_NAME' => 2, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, )
+ );
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/IsoSubdivisionMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.IsoSubdivisionMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = IsoSubdivisionPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/IsoSubdivisionMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.IsoSubdivisionMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = IsoSubdivisionPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. IsoSubdivisionPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(IsoSubdivisionPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. IsoSubdivisionPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(IsoSubdivisionPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(IsoSubdivisionPeer::IC_UID);
+ $criteria->addSelectColumn(IsoSubdivisionPeer::IC_UID);
- $criteria->addSelectColumn(IsoSubdivisionPeer::IS_UID);
+ $criteria->addSelectColumn(IsoSubdivisionPeer::IS_UID);
- $criteria->addSelectColumn(IsoSubdivisionPeer::IS_NAME);
+ $criteria->addSelectColumn(IsoSubdivisionPeer::IS_NAME);
- }
+ }
- const COUNT = 'COUNT(ISO_SUBDIVISION.IC_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT ISO_SUBDIVISION.IC_UID)';
+ const COUNT = 'COUNT(ISO_SUBDIVISION.IC_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT ISO_SUBDIVISION.IC_UID)';
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(IsoSubdivisionPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(IsoSubdivisionPeer::COUNT);
- }
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(IsoSubdivisionPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(IsoSubdivisionPeer::COUNT);
+ }
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
- $rs = IsoSubdivisionPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return IsoSubdivision
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = IsoSubdivisionPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return IsoSubdivisionPeer::populateObjects(IsoSubdivisionPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $rs = IsoSubdivisionPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return IsoSubdivision
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = IsoSubdivisionPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return IsoSubdivisionPeer::populateObjects(IsoSubdivisionPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- IsoSubdivisionPeer::addSelectColumns($criteria);
- }
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ IsoSubdivisionPeer::addSelectColumns($criteria);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = IsoSubdivisionPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return IsoSubdivisionPeer::CLASS_DEFAULT;
- }
+ // set the class once to avoid overhead in the loop
+ $cls = IsoSubdivisionPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
- /**
- * Method perform an INSERT on the database, given a IsoSubdivision or Criteria object.
- *
- * @param mixed $values Criteria or IsoSubdivision object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from IsoSubdivision object
- }
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return IsoSubdivisionPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a IsoSubdivision or Criteria object.
+ *
+ * @param mixed $values Criteria or IsoSubdivision object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from IsoSubdivision object
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
- return $pk;
- }
+ return $pk;
+ }
- /**
- * Method perform an UPDATE on the database, given a IsoSubdivision or Criteria object.
- *
- * @param mixed $values Criteria or IsoSubdivision object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Method perform an UPDATE on the database, given a IsoSubdivision or Criteria object.
+ *
+ * @param mixed $values Criteria or IsoSubdivision object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $selectCriteria = new Criteria(self::DATABASE_NAME);
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
- $comparison = $criteria->getComparison(IsoSubdivisionPeer::IC_UID);
- $selectCriteria->add(IsoSubdivisionPeer::IC_UID, $criteria->remove(IsoSubdivisionPeer::IC_UID), $comparison);
+ $comparison = $criteria->getComparison(IsoSubdivisionPeer::IC_UID);
+ $selectCriteria->add(IsoSubdivisionPeer::IC_UID, $criteria->remove(IsoSubdivisionPeer::IC_UID), $comparison);
- $comparison = $criteria->getComparison(IsoSubdivisionPeer::IS_UID);
- $selectCriteria->add(IsoSubdivisionPeer::IS_UID, $criteria->remove(IsoSubdivisionPeer::IS_UID), $comparison);
+ $comparison = $criteria->getComparison(IsoSubdivisionPeer::IS_UID);
+ $selectCriteria->add(IsoSubdivisionPeer::IS_UID, $criteria->remove(IsoSubdivisionPeer::IS_UID), $comparison);
- } else { // $values is IsoSubdivision object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
- /**
- * Method to DELETE all rows from the ISO_SUBDIVISION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(IsoSubdivisionPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ /**
+ * Method to DELETE all rows from the ISO_SUBDIVISION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(IsoSubdivisionPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- /**
- * Method perform a DELETE on the database, given a IsoSubdivision or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or IsoSubdivision object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(IsoSubdivisionPeer::DATABASE_NAME);
- }
+ /**
+ * Method perform a DELETE on the database, given a IsoSubdivision or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or IsoSubdivision object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(IsoSubdivisionPeer::DATABASE_NAME);
+ }
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof IsoSubdivision) {
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof IsoSubdivision) {
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
- $criteria->add(IsoSubdivisionPeer::IC_UID, $vals[0], Criteria::IN);
- $criteria->add(IsoSubdivisionPeer::IS_UID, $vals[1], Criteria::IN);
- }
+ $criteria->add(IsoSubdivisionPeer::IC_UID, $vals[0], Criteria::IN);
+ $criteria->add(IsoSubdivisionPeer::IS_UID, $vals[1], Criteria::IN);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- $affectedRows = 0; // initialize var to track total num of affected rows
+ $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
- /**
- * Validates all modified columns of given IsoSubdivision object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param IsoSubdivision $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(IsoSubdivision $obj, $cols = null)
- {
- $columns = array();
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(IsoSubdivisionPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(IsoSubdivisionPeer::TABLE_NAME);
+ /**
+ * Validates all modified columns of given IsoSubdivision object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param IsoSubdivision $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(IsoSubdivision $obj, $cols = null)
+ {
+ $columns = array();
- if (! is_array($cols)) {
- $cols = array($cols);
- }
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(IsoSubdivisionPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(IsoSubdivisionPeer::TABLE_NAME);
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
- }
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
- return BasePeer::doValidate(IsoSubdivisionPeer::DATABASE_NAME, IsoSubdivisionPeer::TABLE_NAME, $columns);
- }
+ }
- /**
- * Retrieve object using using composite pkey values.
- * @param string $ic_uid
- @param string $is_uid
-
- * @param Connection $con
- * @return IsoSubdivision
- */
- public static function retrieveByPK( $ic_uid, $is_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(IsoSubdivisionPeer::IC_UID, $ic_uid);
- $criteria->add(IsoSubdivisionPeer::IS_UID, $is_uid);
- $v = IsoSubdivisionPeer::doSelect($criteria, $con);
+ return BasePeer::doValidate(IsoSubdivisionPeer::DATABASE_NAME, IsoSubdivisionPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $ic_uid
+ * @param string $is_uid
+ * @param Connection $con
+ * @return IsoSubdivision
+ */
+ public static function retrieveByPK($ic_uid, $is_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(IsoSubdivisionPeer::IC_UID, $ic_uid);
+ $criteria->add(IsoSubdivisionPeer::IS_UID, $is_uid);
+ $v = IsoSubdivisionPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- return !empty($v) ? $v[0] : null;
- }
-} // BaseIsoSubdivisionPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseIsoSubdivisionPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseIsoSubdivisionPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/IsoSubdivisionMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.IsoSubdivisionMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/IsoSubdivisionMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.IsoSubdivisionMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseLanguage.php b/workflow/engine/classes/model/om/BaseLanguage.php
index 33e257cd6..e2ec33125 100755
--- a/workflow/engine/classes/model/om/BaseLanguage.php
+++ b/workflow/engine/classes/model/om/BaseLanguage.php
@@ -16,807 +16,843 @@ include_once 'classes/model/LanguagePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLanguage extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var LanguagePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the lan_id field.
- * @var string
- */
- protected $lan_id = '';
-
-
- /**
- * The value for the lan_name field.
- * @var string
- */
- protected $lan_name = '';
-
-
- /**
- * The value for the lan_native_name field.
- * @var string
- */
- protected $lan_native_name = '';
-
-
- /**
- * The value for the lan_direction field.
- * @var string
- */
- protected $lan_direction = 'L';
-
-
- /**
- * The value for the lan_weight field.
- * @var int
- */
- protected $lan_weight = 0;
-
-
- /**
- * The value for the lan_enabled field.
- * @var string
- */
- protected $lan_enabled = '1';
-
-
- /**
- * The value for the lan_calendar field.
- * @var string
- */
- protected $lan_calendar = 'GREGORIAN';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [lan_id] column value.
- *
- * @return string
- */
- public function getLanId()
- {
-
- return $this->lan_id;
- }
-
- /**
- * Get the [lan_name] column value.
- *
- * @return string
- */
- public function getLanName()
- {
-
- return $this->lan_name;
- }
-
- /**
- * Get the [lan_native_name] column value.
- *
- * @return string
- */
- public function getLanNativeName()
- {
-
- return $this->lan_native_name;
- }
-
- /**
- * Get the [lan_direction] column value.
- *
- * @return string
- */
- public function getLanDirection()
- {
-
- return $this->lan_direction;
- }
-
- /**
- * Get the [lan_weight] column value.
- *
- * @return int
- */
- public function getLanWeight()
- {
-
- return $this->lan_weight;
- }
-
- /**
- * Get the [lan_enabled] column value.
- *
- * @return string
- */
- public function getLanEnabled()
- {
-
- return $this->lan_enabled;
- }
-
- /**
- * Get the [lan_calendar] column value.
- *
- * @return string
- */
- public function getLanCalendar()
- {
-
- return $this->lan_calendar;
- }
-
- /**
- * Set the value of [lan_id] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLanId($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lan_id !== $v || $v === '') {
- $this->lan_id = $v;
- $this->modifiedColumns[] = LanguagePeer::LAN_ID;
- }
-
- } // setLanId()
-
- /**
- * Set the value of [lan_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLanName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lan_name !== $v || $v === '') {
- $this->lan_name = $v;
- $this->modifiedColumns[] = LanguagePeer::LAN_NAME;
- }
-
- } // setLanName()
-
- /**
- * Set the value of [lan_native_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLanNativeName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lan_native_name !== $v || $v === '') {
- $this->lan_native_name = $v;
- $this->modifiedColumns[] = LanguagePeer::LAN_NATIVE_NAME;
- }
-
- } // setLanNativeName()
-
- /**
- * Set the value of [lan_direction] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLanDirection($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lan_direction !== $v || $v === 'L') {
- $this->lan_direction = $v;
- $this->modifiedColumns[] = LanguagePeer::LAN_DIRECTION;
- }
-
- } // setLanDirection()
-
- /**
- * Set the value of [lan_weight] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setLanWeight($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->lan_weight !== $v || $v === 0) {
- $this->lan_weight = $v;
- $this->modifiedColumns[] = LanguagePeer::LAN_WEIGHT;
- }
-
- } // setLanWeight()
-
- /**
- * Set the value of [lan_enabled] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLanEnabled($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lan_enabled !== $v || $v === '1') {
- $this->lan_enabled = $v;
- $this->modifiedColumns[] = LanguagePeer::LAN_ENABLED;
- }
-
- } // setLanEnabled()
-
- /**
- * Set the value of [lan_calendar] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLanCalendar($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lan_calendar !== $v || $v === 'GREGORIAN') {
- $this->lan_calendar = $v;
- $this->modifiedColumns[] = LanguagePeer::LAN_CALENDAR;
- }
-
- } // setLanCalendar()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->lan_id = $rs->getString($startcol + 0);
-
- $this->lan_name = $rs->getString($startcol + 1);
-
- $this->lan_native_name = $rs->getString($startcol + 2);
-
- $this->lan_direction = $rs->getString($startcol + 3);
-
- $this->lan_weight = $rs->getInt($startcol + 4);
-
- $this->lan_enabled = $rs->getString($startcol + 5);
-
- $this->lan_calendar = $rs->getString($startcol + 6);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 7; // 7 = LanguagePeer::NUM_COLUMNS - LanguagePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Language object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LanguagePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- LanguagePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LanguagePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = LanguagePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += LanguagePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = LanguagePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LanguagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getLanId();
- break;
- case 1:
- return $this->getLanName();
- break;
- case 2:
- return $this->getLanNativeName();
- break;
- case 3:
- return $this->getLanDirection();
- break;
- case 4:
- return $this->getLanWeight();
- break;
- case 5:
- return $this->getLanEnabled();
- break;
- case 6:
- return $this->getLanCalendar();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LanguagePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getLanId(),
- $keys[1] => $this->getLanName(),
- $keys[2] => $this->getLanNativeName(),
- $keys[3] => $this->getLanDirection(),
- $keys[4] => $this->getLanWeight(),
- $keys[5] => $this->getLanEnabled(),
- $keys[6] => $this->getLanCalendar(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LanguagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setLanId($value);
- break;
- case 1:
- $this->setLanName($value);
- break;
- case 2:
- $this->setLanNativeName($value);
- break;
- case 3:
- $this->setLanDirection($value);
- break;
- case 4:
- $this->setLanWeight($value);
- break;
- case 5:
- $this->setLanEnabled($value);
- break;
- case 6:
- $this->setLanCalendar($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LanguagePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setLanId($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setLanName($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setLanNativeName($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setLanDirection($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setLanWeight($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setLanEnabled($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setLanCalendar($arr[$keys[6]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(LanguagePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(LanguagePeer::LAN_ID)) $criteria->add(LanguagePeer::LAN_ID, $this->lan_id);
- if ($this->isColumnModified(LanguagePeer::LAN_NAME)) $criteria->add(LanguagePeer::LAN_NAME, $this->lan_name);
- if ($this->isColumnModified(LanguagePeer::LAN_NATIVE_NAME)) $criteria->add(LanguagePeer::LAN_NATIVE_NAME, $this->lan_native_name);
- if ($this->isColumnModified(LanguagePeer::LAN_DIRECTION)) $criteria->add(LanguagePeer::LAN_DIRECTION, $this->lan_direction);
- if ($this->isColumnModified(LanguagePeer::LAN_WEIGHT)) $criteria->add(LanguagePeer::LAN_WEIGHT, $this->lan_weight);
- if ($this->isColumnModified(LanguagePeer::LAN_ENABLED)) $criteria->add(LanguagePeer::LAN_ENABLED, $this->lan_enabled);
- if ($this->isColumnModified(LanguagePeer::LAN_CALENDAR)) $criteria->add(LanguagePeer::LAN_CALENDAR, $this->lan_calendar);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(LanguagePeer::DATABASE_NAME);
-
- $criteria->add(LanguagePeer::LAN_ID, $this->lan_id);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getLanId();
- }
-
- /**
- * Generic method to set the primary key (lan_id column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setLanId($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Language (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setLanName($this->lan_name);
-
- $copyObj->setLanNativeName($this->lan_native_name);
-
- $copyObj->setLanDirection($this->lan_direction);
-
- $copyObj->setLanWeight($this->lan_weight);
-
- $copyObj->setLanEnabled($this->lan_enabled);
-
- $copyObj->setLanCalendar($this->lan_calendar);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setLanId(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Language Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return LanguagePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new LanguagePeer();
- }
- return self::$peer;
- }
-
-} // BaseLanguage
+abstract class BaseLanguage extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var LanguagePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the lan_id field.
+ * @var string
+ */
+ protected $lan_id = '';
+
+ /**
+ * The value for the lan_name field.
+ * @var string
+ */
+ protected $lan_name = '';
+
+ /**
+ * The value for the lan_native_name field.
+ * @var string
+ */
+ protected $lan_native_name = '';
+
+ /**
+ * The value for the lan_direction field.
+ * @var string
+ */
+ protected $lan_direction = 'L';
+
+ /**
+ * The value for the lan_weight field.
+ * @var int
+ */
+ protected $lan_weight = 0;
+
+ /**
+ * The value for the lan_enabled field.
+ * @var string
+ */
+ protected $lan_enabled = '1';
+
+ /**
+ * The value for the lan_calendar field.
+ * @var string
+ */
+ protected $lan_calendar = 'GREGORIAN';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [lan_id] column value.
+ *
+ * @return string
+ */
+ public function getLanId()
+ {
+
+ return $this->lan_id;
+ }
+
+ /**
+ * Get the [lan_name] column value.
+ *
+ * @return string
+ */
+ public function getLanName()
+ {
+
+ return $this->lan_name;
+ }
+
+ /**
+ * Get the [lan_native_name] column value.
+ *
+ * @return string
+ */
+ public function getLanNativeName()
+ {
+
+ return $this->lan_native_name;
+ }
+
+ /**
+ * Get the [lan_direction] column value.
+ *
+ * @return string
+ */
+ public function getLanDirection()
+ {
+
+ return $this->lan_direction;
+ }
+
+ /**
+ * Get the [lan_weight] column value.
+ *
+ * @return int
+ */
+ public function getLanWeight()
+ {
+
+ return $this->lan_weight;
+ }
+
+ /**
+ * Get the [lan_enabled] column value.
+ *
+ * @return string
+ */
+ public function getLanEnabled()
+ {
+
+ return $this->lan_enabled;
+ }
+
+ /**
+ * Get the [lan_calendar] column value.
+ *
+ * @return string
+ */
+ public function getLanCalendar()
+ {
+
+ return $this->lan_calendar;
+ }
+
+ /**
+ * Set the value of [lan_id] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLanId($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lan_id !== $v || $v === '') {
+ $this->lan_id = $v;
+ $this->modifiedColumns[] = LanguagePeer::LAN_ID;
+ }
+
+ } // setLanId()
+
+ /**
+ * Set the value of [lan_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLanName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lan_name !== $v || $v === '') {
+ $this->lan_name = $v;
+ $this->modifiedColumns[] = LanguagePeer::LAN_NAME;
+ }
+
+ } // setLanName()
+
+ /**
+ * Set the value of [lan_native_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLanNativeName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lan_native_name !== $v || $v === '') {
+ $this->lan_native_name = $v;
+ $this->modifiedColumns[] = LanguagePeer::LAN_NATIVE_NAME;
+ }
+
+ } // setLanNativeName()
+
+ /**
+ * Set the value of [lan_direction] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLanDirection($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lan_direction !== $v || $v === 'L') {
+ $this->lan_direction = $v;
+ $this->modifiedColumns[] = LanguagePeer::LAN_DIRECTION;
+ }
+
+ } // setLanDirection()
+
+ /**
+ * Set the value of [lan_weight] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setLanWeight($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->lan_weight !== $v || $v === 0) {
+ $this->lan_weight = $v;
+ $this->modifiedColumns[] = LanguagePeer::LAN_WEIGHT;
+ }
+
+ } // setLanWeight()
+
+ /**
+ * Set the value of [lan_enabled] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLanEnabled($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lan_enabled !== $v || $v === '1') {
+ $this->lan_enabled = $v;
+ $this->modifiedColumns[] = LanguagePeer::LAN_ENABLED;
+ }
+
+ } // setLanEnabled()
+
+ /**
+ * Set the value of [lan_calendar] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLanCalendar($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lan_calendar !== $v || $v === 'GREGORIAN') {
+ $this->lan_calendar = $v;
+ $this->modifiedColumns[] = LanguagePeer::LAN_CALENDAR;
+ }
+
+ } // setLanCalendar()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->lan_id = $rs->getString($startcol + 0);
+
+ $this->lan_name = $rs->getString($startcol + 1);
+
+ $this->lan_native_name = $rs->getString($startcol + 2);
+
+ $this->lan_direction = $rs->getString($startcol + 3);
+
+ $this->lan_weight = $rs->getInt($startcol + 4);
+
+ $this->lan_enabled = $rs->getString($startcol + 5);
+
+ $this->lan_calendar = $rs->getString($startcol + 6);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 7; // 7 = LanguagePeer::NUM_COLUMNS - LanguagePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Language object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LanguagePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ LanguagePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LanguagePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = LanguagePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += LanguagePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = LanguagePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LanguagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getLanId();
+ break;
+ case 1:
+ return $this->getLanName();
+ break;
+ case 2:
+ return $this->getLanNativeName();
+ break;
+ case 3:
+ return $this->getLanDirection();
+ break;
+ case 4:
+ return $this->getLanWeight();
+ break;
+ case 5:
+ return $this->getLanEnabled();
+ break;
+ case 6:
+ return $this->getLanCalendar();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LanguagePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getLanId(),
+ $keys[1] => $this->getLanName(),
+ $keys[2] => $this->getLanNativeName(),
+ $keys[3] => $this->getLanDirection(),
+ $keys[4] => $this->getLanWeight(),
+ $keys[5] => $this->getLanEnabled(),
+ $keys[6] => $this->getLanCalendar(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LanguagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setLanId($value);
+ break;
+ case 1:
+ $this->setLanName($value);
+ break;
+ case 2:
+ $this->setLanNativeName($value);
+ break;
+ case 3:
+ $this->setLanDirection($value);
+ break;
+ case 4:
+ $this->setLanWeight($value);
+ break;
+ case 5:
+ $this->setLanEnabled($value);
+ break;
+ case 6:
+ $this->setLanCalendar($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LanguagePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setLanId($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setLanName($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setLanNativeName($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setLanDirection($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setLanWeight($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setLanEnabled($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setLanCalendar($arr[$keys[6]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(LanguagePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(LanguagePeer::LAN_ID)) {
+ $criteria->add(LanguagePeer::LAN_ID, $this->lan_id);
+ }
+
+ if ($this->isColumnModified(LanguagePeer::LAN_NAME)) {
+ $criteria->add(LanguagePeer::LAN_NAME, $this->lan_name);
+ }
+
+ if ($this->isColumnModified(LanguagePeer::LAN_NATIVE_NAME)) {
+ $criteria->add(LanguagePeer::LAN_NATIVE_NAME, $this->lan_native_name);
+ }
+
+ if ($this->isColumnModified(LanguagePeer::LAN_DIRECTION)) {
+ $criteria->add(LanguagePeer::LAN_DIRECTION, $this->lan_direction);
+ }
+
+ if ($this->isColumnModified(LanguagePeer::LAN_WEIGHT)) {
+ $criteria->add(LanguagePeer::LAN_WEIGHT, $this->lan_weight);
+ }
+
+ if ($this->isColumnModified(LanguagePeer::LAN_ENABLED)) {
+ $criteria->add(LanguagePeer::LAN_ENABLED, $this->lan_enabled);
+ }
+
+ if ($this->isColumnModified(LanguagePeer::LAN_CALENDAR)) {
+ $criteria->add(LanguagePeer::LAN_CALENDAR, $this->lan_calendar);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(LanguagePeer::DATABASE_NAME);
+
+ $criteria->add(LanguagePeer::LAN_ID, $this->lan_id);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getLanId();
+ }
+
+ /**
+ * Generic method to set the primary key (lan_id column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setLanId($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Language (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setLanName($this->lan_name);
+
+ $copyObj->setLanNativeName($this->lan_native_name);
+
+ $copyObj->setLanDirection($this->lan_direction);
+
+ $copyObj->setLanWeight($this->lan_weight);
+
+ $copyObj->setLanEnabled($this->lan_enabled);
+
+ $copyObj->setLanCalendar($this->lan_calendar);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setLanId(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Language Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return LanguagePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new LanguagePeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseLanguagePeer.php b/workflow/engine/classes/model/om/BaseLanguagePeer.php
index a7d1850d5..460414a16 100755
--- a/workflow/engine/classes/model/om/BaseLanguagePeer.php
+++ b/workflow/engine/classes/model/om/BaseLanguagePeer.php
@@ -12,590 +12,592 @@ include_once 'classes/model/Language.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLanguagePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'LANGUAGE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Language';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 7;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the LAN_ID field */
- const LAN_ID = 'LANGUAGE.LAN_ID';
-
- /** the column name for the LAN_NAME field */
- const LAN_NAME = 'LANGUAGE.LAN_NAME';
-
- /** the column name for the LAN_NATIVE_NAME field */
- const LAN_NATIVE_NAME = 'LANGUAGE.LAN_NATIVE_NAME';
-
- /** the column name for the LAN_DIRECTION field */
- const LAN_DIRECTION = 'LANGUAGE.LAN_DIRECTION';
-
- /** the column name for the LAN_WEIGHT field */
- const LAN_WEIGHT = 'LANGUAGE.LAN_WEIGHT';
-
- /** the column name for the LAN_ENABLED field */
- const LAN_ENABLED = 'LANGUAGE.LAN_ENABLED';
-
- /** the column name for the LAN_CALENDAR field */
- const LAN_CALENDAR = 'LANGUAGE.LAN_CALENDAR';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('LanId', 'LanName', 'LanNativeName', 'LanDirection', 'LanWeight', 'LanEnabled', 'LanCalendar', ),
- BasePeer::TYPE_COLNAME => array (LanguagePeer::LAN_ID, LanguagePeer::LAN_NAME, LanguagePeer::LAN_NATIVE_NAME, LanguagePeer::LAN_DIRECTION, LanguagePeer::LAN_WEIGHT, LanguagePeer::LAN_ENABLED, LanguagePeer::LAN_CALENDAR, ),
- BasePeer::TYPE_FIELDNAME => array ('LAN_ID', 'LAN_NAME', 'LAN_NATIVE_NAME', 'LAN_DIRECTION', 'LAN_WEIGHT', 'LAN_ENABLED', 'LAN_CALENDAR', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('LanId' => 0, 'LanName' => 1, 'LanNativeName' => 2, 'LanDirection' => 3, 'LanWeight' => 4, 'LanEnabled' => 5, 'LanCalendar' => 6, ),
- BasePeer::TYPE_COLNAME => array (LanguagePeer::LAN_ID => 0, LanguagePeer::LAN_NAME => 1, LanguagePeer::LAN_NATIVE_NAME => 2, LanguagePeer::LAN_DIRECTION => 3, LanguagePeer::LAN_WEIGHT => 4, LanguagePeer::LAN_ENABLED => 5, LanguagePeer::LAN_CALENDAR => 6, ),
- BasePeer::TYPE_FIELDNAME => array ('LAN_ID' => 0, 'LAN_NAME' => 1, 'LAN_NATIVE_NAME' => 2, 'LAN_DIRECTION' => 3, 'LAN_WEIGHT' => 4, 'LAN_ENABLED' => 5, 'LAN_CALENDAR' => 6, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/LanguageMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.LanguageMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = LanguagePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. LanguagePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(LanguagePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(LanguagePeer::LAN_ID);
-
- $criteria->addSelectColumn(LanguagePeer::LAN_NAME);
-
- $criteria->addSelectColumn(LanguagePeer::LAN_NATIVE_NAME);
-
- $criteria->addSelectColumn(LanguagePeer::LAN_DIRECTION);
-
- $criteria->addSelectColumn(LanguagePeer::LAN_WEIGHT);
-
- $criteria->addSelectColumn(LanguagePeer::LAN_ENABLED);
-
- $criteria->addSelectColumn(LanguagePeer::LAN_CALENDAR);
-
- }
-
- const COUNT = 'COUNT(LANGUAGE.LAN_ID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT LANGUAGE.LAN_ID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(LanguagePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(LanguagePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = LanguagePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Language
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = LanguagePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return LanguagePeer::populateObjects(LanguagePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- LanguagePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = LanguagePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return LanguagePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Language or Criteria object.
- *
- * @param mixed $values Criteria or Language object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Language object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Language or Criteria object.
- *
- * @param mixed $values Criteria or Language object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(LanguagePeer::LAN_ID);
- $selectCriteria->add(LanguagePeer::LAN_ID, $criteria->remove(LanguagePeer::LAN_ID), $comparison);
-
- } else { // $values is Language object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the LANGUAGE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(LanguagePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Language or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Language object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(LanguagePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Language) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(LanguagePeer::LAN_ID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Language object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Language $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Language $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(LanguagePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(LanguagePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(LanguagePeer::LAN_DIRECTION))
- $columns[LanguagePeer::LAN_DIRECTION] = $obj->getLanDirection();
-
- if ($obj->isNew() || $obj->isColumnModified(LanguagePeer::LAN_ENABLED))
- $columns[LanguagePeer::LAN_ENABLED] = $obj->getLanEnabled();
-
- }
-
- return BasePeer::doValidate(LanguagePeer::DATABASE_NAME, LanguagePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Language
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(LanguagePeer::DATABASE_NAME);
-
- $criteria->add(LanguagePeer::LAN_ID, $pk);
-
-
- $v = LanguagePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(LanguagePeer::LAN_ID, $pks, Criteria::IN);
- $objs = LanguagePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseLanguagePeer
+abstract class BaseLanguagePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'LANGUAGE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Language';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 7;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the LAN_ID field */
+ const LAN_ID = 'LANGUAGE.LAN_ID';
+
+ /** the column name for the LAN_NAME field */
+ const LAN_NAME = 'LANGUAGE.LAN_NAME';
+
+ /** the column name for the LAN_NATIVE_NAME field */
+ const LAN_NATIVE_NAME = 'LANGUAGE.LAN_NATIVE_NAME';
+
+ /** the column name for the LAN_DIRECTION field */
+ const LAN_DIRECTION = 'LANGUAGE.LAN_DIRECTION';
+
+ /** the column name for the LAN_WEIGHT field */
+ const LAN_WEIGHT = 'LANGUAGE.LAN_WEIGHT';
+
+ /** the column name for the LAN_ENABLED field */
+ const LAN_ENABLED = 'LANGUAGE.LAN_ENABLED';
+
+ /** the column name for the LAN_CALENDAR field */
+ const LAN_CALENDAR = 'LANGUAGE.LAN_CALENDAR';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('LanId', 'LanName', 'LanNativeName', 'LanDirection', 'LanWeight', 'LanEnabled', 'LanCalendar', ),
+ BasePeer::TYPE_COLNAME => array (LanguagePeer::LAN_ID, LanguagePeer::LAN_NAME, LanguagePeer::LAN_NATIVE_NAME, LanguagePeer::LAN_DIRECTION, LanguagePeer::LAN_WEIGHT, LanguagePeer::LAN_ENABLED, LanguagePeer::LAN_CALENDAR, ),
+ BasePeer::TYPE_FIELDNAME => array ('LAN_ID', 'LAN_NAME', 'LAN_NATIVE_NAME', 'LAN_DIRECTION', 'LAN_WEIGHT', 'LAN_ENABLED', 'LAN_CALENDAR', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('LanId' => 0, 'LanName' => 1, 'LanNativeName' => 2, 'LanDirection' => 3, 'LanWeight' => 4, 'LanEnabled' => 5, 'LanCalendar' => 6, ),
+ BasePeer::TYPE_COLNAME => array (LanguagePeer::LAN_ID => 0, LanguagePeer::LAN_NAME => 1, LanguagePeer::LAN_NATIVE_NAME => 2, LanguagePeer::LAN_DIRECTION => 3, LanguagePeer::LAN_WEIGHT => 4, LanguagePeer::LAN_ENABLED => 5, LanguagePeer::LAN_CALENDAR => 6, ),
+ BasePeer::TYPE_FIELDNAME => array ('LAN_ID' => 0, 'LAN_NAME' => 1, 'LAN_NATIVE_NAME' => 2, 'LAN_DIRECTION' => 3, 'LAN_WEIGHT' => 4, 'LAN_ENABLED' => 5, 'LAN_CALENDAR' => 6, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/LanguageMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.LanguageMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = LanguagePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. LanguagePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(LanguagePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(LanguagePeer::LAN_ID);
+
+ $criteria->addSelectColumn(LanguagePeer::LAN_NAME);
+
+ $criteria->addSelectColumn(LanguagePeer::LAN_NATIVE_NAME);
+
+ $criteria->addSelectColumn(LanguagePeer::LAN_DIRECTION);
+
+ $criteria->addSelectColumn(LanguagePeer::LAN_WEIGHT);
+
+ $criteria->addSelectColumn(LanguagePeer::LAN_ENABLED);
+
+ $criteria->addSelectColumn(LanguagePeer::LAN_CALENDAR);
+
+ }
+
+ const COUNT = 'COUNT(LANGUAGE.LAN_ID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT LANGUAGE.LAN_ID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(LanguagePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(LanguagePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = LanguagePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Language
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = LanguagePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return LanguagePeer::populateObjects(LanguagePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ LanguagePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = LanguagePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return LanguagePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Language or Criteria object.
+ *
+ * @param mixed $values Criteria or Language object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Language object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Language or Criteria object.
+ *
+ * @param mixed $values Criteria or Language object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(LanguagePeer::LAN_ID);
+ $selectCriteria->add(LanguagePeer::LAN_ID, $criteria->remove(LanguagePeer::LAN_ID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the LANGUAGE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(LanguagePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Language or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Language object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(LanguagePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Language) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(LanguagePeer::LAN_ID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Language object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Language $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Language $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(LanguagePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(LanguagePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(LanguagePeer::LAN_DIRECTION))
+ $columns[LanguagePeer::LAN_DIRECTION] = $obj->getLanDirection();
+
+ if ($obj->isNew() || $obj->isColumnModified(LanguagePeer::LAN_ENABLED))
+ $columns[LanguagePeer::LAN_ENABLED] = $obj->getLanEnabled();
+
+ }
+
+ return BasePeer::doValidate(LanguagePeer::DATABASE_NAME, LanguagePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Language
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(LanguagePeer::DATABASE_NAME);
+
+ $criteria->add(LanguagePeer::LAN_ID, $pk);
+
+
+ $v = LanguagePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(LanguagePeer::LAN_ID, $pks, Criteria::IN);
+ $objs = LanguagePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseLanguagePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseLanguagePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/LanguageMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.LanguageMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/LanguageMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.LanguageMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseLexico.php b/workflow/engine/classes/model/om/BaseLexico.php
index f772c1402..236f3812d 100755
--- a/workflow/engine/classes/model/om/BaseLexico.php
+++ b/workflow/engine/classes/model/om/BaseLexico.php
@@ -16,660 +16,681 @@ include_once 'classes/model/LexicoPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLexico extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var LexicoPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the lex_topic field.
- * @var string
- */
- protected $lex_topic = '';
-
-
- /**
- * The value for the lex_key field.
- * @var string
- */
- protected $lex_key = '';
-
-
- /**
- * The value for the lex_value field.
- * @var string
- */
- protected $lex_value = '';
-
-
- /**
- * The value for the lex_caption field.
- * @var string
- */
- protected $lex_caption = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [lex_topic] column value.
- *
- * @return string
- */
- public function getLexTopic()
- {
-
- return $this->lex_topic;
- }
-
- /**
- * Get the [lex_key] column value.
- *
- * @return string
- */
- public function getLexKey()
- {
-
- return $this->lex_key;
- }
-
- /**
- * Get the [lex_value] column value.
- *
- * @return string
- */
- public function getLexValue()
- {
-
- return $this->lex_value;
- }
-
- /**
- * Get the [lex_caption] column value.
- *
- * @return string
- */
- public function getLexCaption()
- {
-
- return $this->lex_caption;
- }
-
- /**
- * Set the value of [lex_topic] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLexTopic($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lex_topic !== $v || $v === '') {
- $this->lex_topic = $v;
- $this->modifiedColumns[] = LexicoPeer::LEX_TOPIC;
- }
-
- } // setLexTopic()
-
- /**
- * Set the value of [lex_key] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLexKey($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lex_key !== $v || $v === '') {
- $this->lex_key = $v;
- $this->modifiedColumns[] = LexicoPeer::LEX_KEY;
- }
-
- } // setLexKey()
-
- /**
- * Set the value of [lex_value] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLexValue($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lex_value !== $v || $v === '') {
- $this->lex_value = $v;
- $this->modifiedColumns[] = LexicoPeer::LEX_VALUE;
- }
-
- } // setLexValue()
-
- /**
- * Set the value of [lex_caption] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLexCaption($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->lex_caption !== $v || $v === '') {
- $this->lex_caption = $v;
- $this->modifiedColumns[] = LexicoPeer::LEX_CAPTION;
- }
-
- } // setLexCaption()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->lex_topic = $rs->getString($startcol + 0);
-
- $this->lex_key = $rs->getString($startcol + 1);
-
- $this->lex_value = $rs->getString($startcol + 2);
-
- $this->lex_caption = $rs->getString($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = LexicoPeer::NUM_COLUMNS - LexicoPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Lexico object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LexicoPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- LexicoPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LexicoPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = LexicoPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += LexicoPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = LexicoPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LexicoPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getLexTopic();
- break;
- case 1:
- return $this->getLexKey();
- break;
- case 2:
- return $this->getLexValue();
- break;
- case 3:
- return $this->getLexCaption();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LexicoPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getLexTopic(),
- $keys[1] => $this->getLexKey(),
- $keys[2] => $this->getLexValue(),
- $keys[3] => $this->getLexCaption(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LexicoPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setLexTopic($value);
- break;
- case 1:
- $this->setLexKey($value);
- break;
- case 2:
- $this->setLexValue($value);
- break;
- case 3:
- $this->setLexCaption($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LexicoPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setLexTopic($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setLexKey($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setLexValue($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setLexCaption($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(LexicoPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(LexicoPeer::LEX_TOPIC)) $criteria->add(LexicoPeer::LEX_TOPIC, $this->lex_topic);
- if ($this->isColumnModified(LexicoPeer::LEX_KEY)) $criteria->add(LexicoPeer::LEX_KEY, $this->lex_key);
- if ($this->isColumnModified(LexicoPeer::LEX_VALUE)) $criteria->add(LexicoPeer::LEX_VALUE, $this->lex_value);
- if ($this->isColumnModified(LexicoPeer::LEX_CAPTION)) $criteria->add(LexicoPeer::LEX_CAPTION, $this->lex_caption);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(LexicoPeer::DATABASE_NAME);
-
- $criteria->add(LexicoPeer::LEX_TOPIC, $this->lex_topic);
- $criteria->add(LexicoPeer::LEX_KEY, $this->lex_key);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getLexTopic();
-
- $pks[1] = $this->getLexKey();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setLexTopic($keys[0]);
-
- $this->setLexKey($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Lexico (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setLexValue($this->lex_value);
-
- $copyObj->setLexCaption($this->lex_caption);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setLexTopic(''); // this is a pkey column, so set to default value
-
- $copyObj->setLexKey(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Lexico Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return LexicoPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new LexicoPeer();
- }
- return self::$peer;
- }
-
-} // BaseLexico
+abstract class BaseLexico extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var LexicoPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the lex_topic field.
+ * @var string
+ */
+ protected $lex_topic = '';
+
+ /**
+ * The value for the lex_key field.
+ * @var string
+ */
+ protected $lex_key = '';
+
+ /**
+ * The value for the lex_value field.
+ * @var string
+ */
+ protected $lex_value = '';
+
+ /**
+ * The value for the lex_caption field.
+ * @var string
+ */
+ protected $lex_caption = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [lex_topic] column value.
+ *
+ * @return string
+ */
+ public function getLexTopic()
+ {
+
+ return $this->lex_topic;
+ }
+
+ /**
+ * Get the [lex_key] column value.
+ *
+ * @return string
+ */
+ public function getLexKey()
+ {
+
+ return $this->lex_key;
+ }
+
+ /**
+ * Get the [lex_value] column value.
+ *
+ * @return string
+ */
+ public function getLexValue()
+ {
+
+ return $this->lex_value;
+ }
+
+ /**
+ * Get the [lex_caption] column value.
+ *
+ * @return string
+ */
+ public function getLexCaption()
+ {
+
+ return $this->lex_caption;
+ }
+
+ /**
+ * Set the value of [lex_topic] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLexTopic($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lex_topic !== $v || $v === '') {
+ $this->lex_topic = $v;
+ $this->modifiedColumns[] = LexicoPeer::LEX_TOPIC;
+ }
+
+ } // setLexTopic()
+
+ /**
+ * Set the value of [lex_key] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLexKey($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lex_key !== $v || $v === '') {
+ $this->lex_key = $v;
+ $this->modifiedColumns[] = LexicoPeer::LEX_KEY;
+ }
+
+ } // setLexKey()
+
+ /**
+ * Set the value of [lex_value] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLexValue($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lex_value !== $v || $v === '') {
+ $this->lex_value = $v;
+ $this->modifiedColumns[] = LexicoPeer::LEX_VALUE;
+ }
+
+ } // setLexValue()
+
+ /**
+ * Set the value of [lex_caption] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLexCaption($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->lex_caption !== $v || $v === '') {
+ $this->lex_caption = $v;
+ $this->modifiedColumns[] = LexicoPeer::LEX_CAPTION;
+ }
+
+ } // setLexCaption()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->lex_topic = $rs->getString($startcol + 0);
+
+ $this->lex_key = $rs->getString($startcol + 1);
+
+ $this->lex_value = $rs->getString($startcol + 2);
+
+ $this->lex_caption = $rs->getString($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = LexicoPeer::NUM_COLUMNS - LexicoPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Lexico object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LexicoPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ LexicoPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LexicoPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = LexicoPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += LexicoPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = LexicoPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LexicoPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getLexTopic();
+ break;
+ case 1:
+ return $this->getLexKey();
+ break;
+ case 2:
+ return $this->getLexValue();
+ break;
+ case 3:
+ return $this->getLexCaption();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LexicoPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getLexTopic(),
+ $keys[1] => $this->getLexKey(),
+ $keys[2] => $this->getLexValue(),
+ $keys[3] => $this->getLexCaption(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LexicoPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setLexTopic($value);
+ break;
+ case 1:
+ $this->setLexKey($value);
+ break;
+ case 2:
+ $this->setLexValue($value);
+ break;
+ case 3:
+ $this->setLexCaption($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LexicoPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setLexTopic($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setLexKey($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setLexValue($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setLexCaption($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(LexicoPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(LexicoPeer::LEX_TOPIC)) {
+ $criteria->add(LexicoPeer::LEX_TOPIC, $this->lex_topic);
+ }
+
+ if ($this->isColumnModified(LexicoPeer::LEX_KEY)) {
+ $criteria->add(LexicoPeer::LEX_KEY, $this->lex_key);
+ }
+
+ if ($this->isColumnModified(LexicoPeer::LEX_VALUE)) {
+ $criteria->add(LexicoPeer::LEX_VALUE, $this->lex_value);
+ }
+
+ if ($this->isColumnModified(LexicoPeer::LEX_CAPTION)) {
+ $criteria->add(LexicoPeer::LEX_CAPTION, $this->lex_caption);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(LexicoPeer::DATABASE_NAME);
+
+ $criteria->add(LexicoPeer::LEX_TOPIC, $this->lex_topic);
+ $criteria->add(LexicoPeer::LEX_KEY, $this->lex_key);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getLexTopic();
+
+ $pks[1] = $this->getLexKey();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setLexTopic($keys[0]);
+
+ $this->setLexKey($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Lexico (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setLexValue($this->lex_value);
+
+ $copyObj->setLexCaption($this->lex_caption);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setLexTopic(''); // this is a pkey column, so set to default value
+
+ $copyObj->setLexKey(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Lexico Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return LexicoPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new LexicoPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseLexicoPeer.php b/workflow/engine/classes/model/om/BaseLexicoPeer.php
index 5afc9a5fe..949ec4243 100755
--- a/workflow/engine/classes/model/om/BaseLexicoPeer.php
+++ b/workflow/engine/classes/model/om/BaseLexicoPeer.php
@@ -12,560 +12,561 @@ include_once 'classes/model/Lexico.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLexicoPeer {
+abstract class BaseLexicoPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'LEXICO';
+ /** the table name for this class */
+ const TABLE_NAME = 'LEXICO';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Lexico';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Lexico';
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the LEX_TOPIC field */
- const LEX_TOPIC = 'LEXICO.LEX_TOPIC';
+ /** the column name for the LEX_TOPIC field */
+ const LEX_TOPIC = 'LEXICO.LEX_TOPIC';
- /** the column name for the LEX_KEY field */
- const LEX_KEY = 'LEXICO.LEX_KEY';
+ /** the column name for the LEX_KEY field */
+ const LEX_KEY = 'LEXICO.LEX_KEY';
- /** the column name for the LEX_VALUE field */
- const LEX_VALUE = 'LEXICO.LEX_VALUE';
+ /** the column name for the LEX_VALUE field */
+ const LEX_VALUE = 'LEXICO.LEX_VALUE';
- /** the column name for the LEX_CAPTION field */
- const LEX_CAPTION = 'LEXICO.LEX_CAPTION';
+ /** the column name for the LEX_CAPTION field */
+ const LEX_CAPTION = 'LEXICO.LEX_CAPTION';
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('LexTopic', 'LexKey', 'LexValue', 'LexCaption', ),
- BasePeer::TYPE_COLNAME => array (LexicoPeer::LEX_TOPIC, LexicoPeer::LEX_KEY, LexicoPeer::LEX_VALUE, LexicoPeer::LEX_CAPTION, ),
- BasePeer::TYPE_FIELDNAME => array ('LEX_TOPIC', 'LEX_KEY', 'LEX_VALUE', 'LEX_CAPTION', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('LexTopic', 'LexKey', 'LexValue', 'LexCaption', ),
+ BasePeer::TYPE_COLNAME => array (LexicoPeer::LEX_TOPIC, LexicoPeer::LEX_KEY, LexicoPeer::LEX_VALUE, LexicoPeer::LEX_CAPTION, ),
+ BasePeer::TYPE_FIELDNAME => array ('LEX_TOPIC', 'LEX_KEY', 'LEX_VALUE', 'LEX_CAPTION', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('LexTopic' => 0, 'LexKey' => 1, 'LexValue' => 2, 'LexCaption' => 3, ),
- BasePeer::TYPE_COLNAME => array (LexicoPeer::LEX_TOPIC => 0, LexicoPeer::LEX_KEY => 1, LexicoPeer::LEX_VALUE => 2, LexicoPeer::LEX_CAPTION => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('LEX_TOPIC' => 0, 'LEX_KEY' => 1, 'LEX_VALUE' => 2, 'LEX_CAPTION' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('LexTopic' => 0, 'LexKey' => 1, 'LexValue' => 2, 'LexCaption' => 3, ),
+ BasePeer::TYPE_COLNAME => array (LexicoPeer::LEX_TOPIC => 0, LexicoPeer::LEX_KEY => 1, LexicoPeer::LEX_VALUE => 2, LexicoPeer::LEX_CAPTION => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('LEX_TOPIC' => 0, 'LEX_KEY' => 1, 'LEX_VALUE' => 2, 'LEX_CAPTION' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/LexicoMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.LexicoMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = LexicoPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/LexicoMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.LexicoMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = LexicoPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. LexicoPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(LexicoPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. LexicoPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(LexicoPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(LexicoPeer::LEX_TOPIC);
+ $criteria->addSelectColumn(LexicoPeer::LEX_TOPIC);
- $criteria->addSelectColumn(LexicoPeer::LEX_KEY);
+ $criteria->addSelectColumn(LexicoPeer::LEX_KEY);
- $criteria->addSelectColumn(LexicoPeer::LEX_VALUE);
+ $criteria->addSelectColumn(LexicoPeer::LEX_VALUE);
- $criteria->addSelectColumn(LexicoPeer::LEX_CAPTION);
+ $criteria->addSelectColumn(LexicoPeer::LEX_CAPTION);
- }
+ }
- const COUNT = 'COUNT(LEXICO.LEX_TOPIC)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT LEXICO.LEX_TOPIC)';
+ const COUNT = 'COUNT(LEXICO.LEX_TOPIC)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT LEXICO.LEX_TOPIC)';
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(LexicoPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(LexicoPeer::COUNT);
- }
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(LexicoPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(LexicoPeer::COUNT);
+ }
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
- $rs = LexicoPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Lexico
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = LexicoPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return LexicoPeer::populateObjects(LexicoPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $rs = LexicoPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Lexico
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = LexicoPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return LexicoPeer::populateObjects(LexicoPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- LexicoPeer::addSelectColumns($criteria);
- }
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ LexicoPeer::addSelectColumns($criteria);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = LexicoPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return LexicoPeer::CLASS_DEFAULT;
- }
+ // set the class once to avoid overhead in the loop
+ $cls = LexicoPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
- /**
- * Method perform an INSERT on the database, given a Lexico or Criteria object.
- *
- * @param mixed $values Criteria or Lexico object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Lexico object
- }
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return LexicoPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Lexico or Criteria object.
+ *
+ * @param mixed $values Criteria or Lexico object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Lexico object
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
- return $pk;
- }
+ return $pk;
+ }
- /**
- * Method perform an UPDATE on the database, given a Lexico or Criteria object.
- *
- * @param mixed $values Criteria or Lexico object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Method perform an UPDATE on the database, given a Lexico or Criteria object.
+ *
+ * @param mixed $values Criteria or Lexico object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $selectCriteria = new Criteria(self::DATABASE_NAME);
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
- $comparison = $criteria->getComparison(LexicoPeer::LEX_TOPIC);
- $selectCriteria->add(LexicoPeer::LEX_TOPIC, $criteria->remove(LexicoPeer::LEX_TOPIC), $comparison);
+ $comparison = $criteria->getComparison(LexicoPeer::LEX_TOPIC);
+ $selectCriteria->add(LexicoPeer::LEX_TOPIC, $criteria->remove(LexicoPeer::LEX_TOPIC), $comparison);
- $comparison = $criteria->getComparison(LexicoPeer::LEX_KEY);
- $selectCriteria->add(LexicoPeer::LEX_KEY, $criteria->remove(LexicoPeer::LEX_KEY), $comparison);
+ $comparison = $criteria->getComparison(LexicoPeer::LEX_KEY);
+ $selectCriteria->add(LexicoPeer::LEX_KEY, $criteria->remove(LexicoPeer::LEX_KEY), $comparison);
- } else { // $values is Lexico object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
- /**
- * Method to DELETE all rows from the LEXICO table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(LexicoPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ /**
+ * Method to DELETE all rows from the LEXICO table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(LexicoPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- /**
- * Method perform a DELETE on the database, given a Lexico or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Lexico object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(LexicoPeer::DATABASE_NAME);
- }
+ /**
+ * Method perform a DELETE on the database, given a Lexico or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Lexico object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(LexicoPeer::DATABASE_NAME);
+ }
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Lexico) {
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Lexico) {
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
- $criteria->add(LexicoPeer::LEX_TOPIC, $vals[0], Criteria::IN);
- $criteria->add(LexicoPeer::LEX_KEY, $vals[1], Criteria::IN);
- }
+ $criteria->add(LexicoPeer::LEX_TOPIC, $vals[0], Criteria::IN);
+ $criteria->add(LexicoPeer::LEX_KEY, $vals[1], Criteria::IN);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- $affectedRows = 0; // initialize var to track total num of affected rows
+ $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
- /**
- * Validates all modified columns of given Lexico object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Lexico $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Lexico $obj, $cols = null)
- {
- $columns = array();
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(LexicoPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(LexicoPeer::TABLE_NAME);
+ /**
+ * Validates all modified columns of given Lexico object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Lexico $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Lexico $obj, $cols = null)
+ {
+ $columns = array();
- if (! is_array($cols)) {
- $cols = array($cols);
- }
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(LexicoPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(LexicoPeer::TABLE_NAME);
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
- }
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
- return BasePeer::doValidate(LexicoPeer::DATABASE_NAME, LexicoPeer::TABLE_NAME, $columns);
- }
+ }
- /**
- * Retrieve object using using composite pkey values.
- * @param string $lex_topic
- @param string $lex_key
-
- * @param Connection $con
- * @return Lexico
- */
- public static function retrieveByPK( $lex_topic, $lex_key, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(LexicoPeer::LEX_TOPIC, $lex_topic);
- $criteria->add(LexicoPeer::LEX_KEY, $lex_key);
- $v = LexicoPeer::doSelect($criteria, $con);
+ return BasePeer::doValidate(LexicoPeer::DATABASE_NAME, LexicoPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $lex_topic
+ * @param string $lex_key
+ * @param Connection $con
+ * @return Lexico
+ */
+ public static function retrieveByPK($lex_topic, $lex_key, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(LexicoPeer::LEX_TOPIC, $lex_topic);
+ $criteria->add(LexicoPeer::LEX_KEY, $lex_key);
+ $v = LexicoPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- return !empty($v) ? $v[0] : null;
- }
-} // BaseLexicoPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseLexicoPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseLexicoPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/LexicoMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.LexicoMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/LexicoMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.LexicoMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseLogCasesScheduler.php b/workflow/engine/classes/model/om/BaseLogCasesScheduler.php
index d059f175a..27ffc9f72 100755
--- a/workflow/engine/classes/model/om/BaseLogCasesScheduler.php
+++ b/workflow/engine/classes/model/om/BaseLogCasesScheduler.php
@@ -16,988 +16,1041 @@ include_once 'classes/model/LogCasesSchedulerPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLogCasesScheduler extends BaseObject implements Persistent {
+abstract class BaseLogCasesScheduler extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var LogCasesSchedulerPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the log_case_uid field.
+ * @var string
+ */
+ protected $log_case_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the usr_name field.
+ * @var string
+ */
+ protected $usr_name = '';
+
+ /**
+ * The value for the exec_date field.
+ * @var int
+ */
+ protected $exec_date;
+
+ /**
+ * The value for the exec_hour field.
+ * @var string
+ */
+ protected $exec_hour = '12:00';
+
+ /**
+ * The value for the result field.
+ * @var string
+ */
+ protected $result = 'SUCCESS';
+
+ /**
+ * The value for the sch_uid field.
+ * @var string
+ */
+ protected $sch_uid = 'OPEN';
+
+ /**
+ * The value for the ws_create_case_status field.
+ * @var string
+ */
+ protected $ws_create_case_status;
+
+ /**
+ * The value for the ws_route_case_status field.
+ * @var string
+ */
+ protected $ws_route_case_status;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [log_case_uid] column value.
+ *
+ * @return string
+ */
+ public function getLogCaseUid()
+ {
+
+ return $this->log_case_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [usr_name] column value.
+ *
+ * @return string
+ */
+ public function getUsrName()
+ {
+
+ return $this->usr_name;
+ }
+
+ /**
+ * Get the [optionally formatted] [exec_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getExecDate($format = 'Y-m-d')
+ {
+
+ if ($this->exec_date === null || $this->exec_date === '') {
+ return null;
+ } elseif (!is_int($this->exec_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->exec_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [exec_date] as date/time value: " .
+ var_export($this->exec_date, true));
+ }
+ } else {
+ $ts = $this->exec_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [exec_hour] column value.
+ *
+ * @return string
+ */
+ public function getExecHour()
+ {
+
+ return $this->exec_hour;
+ }
+
+ /**
+ * Get the [result] column value.
+ *
+ * @return string
+ */
+ public function getResult()
+ {
+
+ return $this->result;
+ }
+
+ /**
+ * Get the [sch_uid] column value.
+ *
+ * @return string
+ */
+ public function getSchUid()
+ {
+
+ return $this->sch_uid;
+ }
+
+ /**
+ * Get the [ws_create_case_status] column value.
+ *
+ * @return string
+ */
+ public function getWsCreateCaseStatus()
+ {
+
+ return $this->ws_create_case_status;
+ }
+
+ /**
+ * Get the [ws_route_case_status] column value.
+ *
+ * @return string
+ */
+ public function getWsRouteCaseStatus()
+ {
+
+ return $this->ws_route_case_status;
+ }
+
+ /**
+ * Set the value of [log_case_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLogCaseUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->log_case_uid !== $v || $v === '') {
+ $this->log_case_uid = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::LOG_CASE_UID;
+ }
+
+ } // setLogCaseUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [usr_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_name !== $v || $v === '') {
+ $this->usr_name = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::USR_NAME;
+ }
+
+ } // setUsrName()
+
+ /**
+ * Set the value of [exec_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setExecDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [exec_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->exec_date !== $ts) {
+ $this->exec_date = $ts;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::EXEC_DATE;
+ }
+
+ } // setExecDate()
+
+ /**
+ * Set the value of [exec_hour] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setExecHour($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->exec_hour !== $v || $v === '12:00') {
+ $this->exec_hour = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::EXEC_HOUR;
+ }
+
+ } // setExecHour()
+
+ /**
+ * Set the value of [result] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setResult($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->result !== $v || $v === 'SUCCESS') {
+ $this->result = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::RESULT;
+ }
+
+ } // setResult()
+
+ /**
+ * Set the value of [sch_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSchUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sch_uid !== $v || $v === 'OPEN') {
+ $this->sch_uid = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::SCH_UID;
+ }
+
+ } // setSchUid()
+
+ /**
+ * Set the value of [ws_create_case_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setWsCreateCaseStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ws_create_case_status !== $v) {
+ $this->ws_create_case_status = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS;
+ }
+
+ } // setWsCreateCaseStatus()
+
+ /**
+ * Set the value of [ws_route_case_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setWsRouteCaseStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ws_route_case_status !== $v) {
+ $this->ws_route_case_status = $v;
+ $this->modifiedColumns[] = LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS;
+ }
+
+ } // setWsRouteCaseStatus()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->log_case_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->tas_uid = $rs->getString($startcol + 2);
+
+ $this->usr_name = $rs->getString($startcol + 3);
+
+ $this->exec_date = $rs->getDate($startcol + 4, null);
+
+ $this->exec_hour = $rs->getString($startcol + 5);
+
+ $this->result = $rs->getString($startcol + 6);
+
+ $this->sch_uid = $rs->getString($startcol + 7);
+
+ $this->ws_create_case_status = $rs->getString($startcol + 8);
+
+ $this->ws_route_case_status = $rs->getString($startcol + 9);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 10; // 10 = LogCasesSchedulerPeer::NUM_COLUMNS - LogCasesSchedulerPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating LogCasesScheduler object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LogCasesSchedulerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ LogCasesSchedulerPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LogCasesSchedulerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = LogCasesSchedulerPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += LogCasesSchedulerPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = LogCasesSchedulerPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LogCasesSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getLogCaseUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getTasUid();
+ break;
+ case 3:
+ return $this->getUsrName();
+ break;
+ case 4:
+ return $this->getExecDate();
+ break;
+ case 5:
+ return $this->getExecHour();
+ break;
+ case 6:
+ return $this->getResult();
+ break;
+ case 7:
+ return $this->getSchUid();
+ break;
+ case 8:
+ return $this->getWsCreateCaseStatus();
+ break;
+ case 9:
+ return $this->getWsRouteCaseStatus();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LogCasesSchedulerPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getLogCaseUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getTasUid(),
+ $keys[3] => $this->getUsrName(),
+ $keys[4] => $this->getExecDate(),
+ $keys[5] => $this->getExecHour(),
+ $keys[6] => $this->getResult(),
+ $keys[7] => $this->getSchUid(),
+ $keys[8] => $this->getWsCreateCaseStatus(),
+ $keys[9] => $this->getWsRouteCaseStatus(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LogCasesSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setLogCaseUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setTasUid($value);
+ break;
+ case 3:
+ $this->setUsrName($value);
+ break;
+ case 4:
+ $this->setExecDate($value);
+ break;
+ case 5:
+ $this->setExecHour($value);
+ break;
+ case 6:
+ $this->setResult($value);
+ break;
+ case 7:
+ $this->setSchUid($value);
+ break;
+ case 8:
+ $this->setWsCreateCaseStatus($value);
+ break;
+ case 9:
+ $this->setWsRouteCaseStatus($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LogCasesSchedulerPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setLogCaseUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTasUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setUsrName($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setExecDate($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setExecHour($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setResult($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setSchUid($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setWsCreateCaseStatus($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setWsRouteCaseStatus($arr[$keys[9]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(LogCasesSchedulerPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::LOG_CASE_UID)) {
+ $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $this->log_case_uid);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::PRO_UID)) {
+ $criteria->add(LogCasesSchedulerPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::TAS_UID)) {
+ $criteria->add(LogCasesSchedulerPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::USR_NAME)) {
+ $criteria->add(LogCasesSchedulerPeer::USR_NAME, $this->usr_name);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::EXEC_DATE)) {
+ $criteria->add(LogCasesSchedulerPeer::EXEC_DATE, $this->exec_date);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::EXEC_HOUR)) {
+ $criteria->add(LogCasesSchedulerPeer::EXEC_HOUR, $this->exec_hour);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::RESULT)) {
+ $criteria->add(LogCasesSchedulerPeer::RESULT, $this->result);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::SCH_UID)) {
+ $criteria->add(LogCasesSchedulerPeer::SCH_UID, $this->sch_uid);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS)) {
+ $criteria->add(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, $this->ws_create_case_status);
+ }
+
+ if ($this->isColumnModified(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS)) {
+ $criteria->add(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS, $this->ws_route_case_status);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(LogCasesSchedulerPeer::DATABASE_NAME);
+
+ $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $this->log_case_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getLogCaseUid();
+ }
+
+ /**
+ * Generic method to set the primary key (log_case_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setLogCaseUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of LogCasesScheduler (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTasUid($this->tas_uid);
+
+ $copyObj->setUsrName($this->usr_name);
+
+ $copyObj->setExecDate($this->exec_date);
+
+ $copyObj->setExecHour($this->exec_hour);
+
+ $copyObj->setResult($this->result);
+
+ $copyObj->setSchUid($this->sch_uid);
+
+ $copyObj->setWsCreateCaseStatus($this->ws_create_case_status);
+
+ $copyObj->setWsRouteCaseStatus($this->ws_route_case_status);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setLogCaseUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return LogCasesScheduler Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return LogCasesSchedulerPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new LogCasesSchedulerPeer();
+ }
+ return self::$peer;
+ }
+}
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var LogCasesSchedulerPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the log_case_uid field.
- * @var string
- */
- protected $log_case_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
-
-
- /**
- * The value for the usr_name field.
- * @var string
- */
- protected $usr_name = '';
-
-
- /**
- * The value for the exec_date field.
- * @var int
- */
- protected $exec_date;
-
-
- /**
- * The value for the exec_hour field.
- * @var string
- */
- protected $exec_hour = '12:00';
-
-
- /**
- * The value for the result field.
- * @var string
- */
- protected $result = 'SUCCESS';
-
-
- /**
- * The value for the sch_uid field.
- * @var string
- */
- protected $sch_uid = 'OPEN';
-
-
- /**
- * The value for the ws_create_case_status field.
- * @var string
- */
- protected $ws_create_case_status;
-
-
- /**
- * The value for the ws_route_case_status field.
- * @var string
- */
- protected $ws_route_case_status;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [log_case_uid] column value.
- *
- * @return string
- */
- public function getLogCaseUid()
- {
-
- return $this->log_case_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [usr_name] column value.
- *
- * @return string
- */
- public function getUsrName()
- {
-
- return $this->usr_name;
- }
-
- /**
- * Get the [optionally formatted] [exec_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getExecDate($format = 'Y-m-d')
- {
-
- if ($this->exec_date === null || $this->exec_date === '') {
- return null;
- } elseif (!is_int($this->exec_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->exec_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [exec_date] as date/time value: " . var_export($this->exec_date, true));
- }
- } else {
- $ts = $this->exec_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [exec_hour] column value.
- *
- * @return string
- */
- public function getExecHour()
- {
-
- return $this->exec_hour;
- }
-
- /**
- * Get the [result] column value.
- *
- * @return string
- */
- public function getResult()
- {
-
- return $this->result;
- }
-
- /**
- * Get the [sch_uid] column value.
- *
- * @return string
- */
- public function getSchUid()
- {
-
- return $this->sch_uid;
- }
-
- /**
- * Get the [ws_create_case_status] column value.
- *
- * @return string
- */
- public function getWsCreateCaseStatus()
- {
-
- return $this->ws_create_case_status;
- }
-
- /**
- * Get the [ws_route_case_status] column value.
- *
- * @return string
- */
- public function getWsRouteCaseStatus()
- {
-
- return $this->ws_route_case_status;
- }
-
- /**
- * Set the value of [log_case_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLogCaseUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->log_case_uid !== $v || $v === '') {
- $this->log_case_uid = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::LOG_CASE_UID;
- }
-
- } // setLogCaseUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [usr_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_name !== $v || $v === '') {
- $this->usr_name = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::USR_NAME;
- }
-
- } // setUsrName()
-
- /**
- * Set the value of [exec_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setExecDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [exec_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->exec_date !== $ts) {
- $this->exec_date = $ts;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::EXEC_DATE;
- }
-
- } // setExecDate()
-
- /**
- * Set the value of [exec_hour] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setExecHour($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->exec_hour !== $v || $v === '12:00') {
- $this->exec_hour = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::EXEC_HOUR;
- }
-
- } // setExecHour()
-
- /**
- * Set the value of [result] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setResult($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->result !== $v || $v === 'SUCCESS') {
- $this->result = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::RESULT;
- }
-
- } // setResult()
-
- /**
- * Set the value of [sch_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSchUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sch_uid !== $v || $v === 'OPEN') {
- $this->sch_uid = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::SCH_UID;
- }
-
- } // setSchUid()
-
- /**
- * Set the value of [ws_create_case_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setWsCreateCaseStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ws_create_case_status !== $v) {
- $this->ws_create_case_status = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS;
- }
-
- } // setWsCreateCaseStatus()
-
- /**
- * Set the value of [ws_route_case_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setWsRouteCaseStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ws_route_case_status !== $v) {
- $this->ws_route_case_status = $v;
- $this->modifiedColumns[] = LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS;
- }
-
- } // setWsRouteCaseStatus()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->log_case_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->tas_uid = $rs->getString($startcol + 2);
-
- $this->usr_name = $rs->getString($startcol + 3);
-
- $this->exec_date = $rs->getDate($startcol + 4, null);
-
- $this->exec_hour = $rs->getString($startcol + 5);
-
- $this->result = $rs->getString($startcol + 6);
-
- $this->sch_uid = $rs->getString($startcol + 7);
-
- $this->ws_create_case_status = $rs->getString($startcol + 8);
-
- $this->ws_route_case_status = $rs->getString($startcol + 9);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 10; // 10 = LogCasesSchedulerPeer::NUM_COLUMNS - LogCasesSchedulerPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating LogCasesScheduler object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LogCasesSchedulerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- LogCasesSchedulerPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LogCasesSchedulerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = LogCasesSchedulerPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += LogCasesSchedulerPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = LogCasesSchedulerPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LogCasesSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getLogCaseUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getTasUid();
- break;
- case 3:
- return $this->getUsrName();
- break;
- case 4:
- return $this->getExecDate();
- break;
- case 5:
- return $this->getExecHour();
- break;
- case 6:
- return $this->getResult();
- break;
- case 7:
- return $this->getSchUid();
- break;
- case 8:
- return $this->getWsCreateCaseStatus();
- break;
- case 9:
- return $this->getWsRouteCaseStatus();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LogCasesSchedulerPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getLogCaseUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getTasUid(),
- $keys[3] => $this->getUsrName(),
- $keys[4] => $this->getExecDate(),
- $keys[5] => $this->getExecHour(),
- $keys[6] => $this->getResult(),
- $keys[7] => $this->getSchUid(),
- $keys[8] => $this->getWsCreateCaseStatus(),
- $keys[9] => $this->getWsRouteCaseStatus(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LogCasesSchedulerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setLogCaseUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setTasUid($value);
- break;
- case 3:
- $this->setUsrName($value);
- break;
- case 4:
- $this->setExecDate($value);
- break;
- case 5:
- $this->setExecHour($value);
- break;
- case 6:
- $this->setResult($value);
- break;
- case 7:
- $this->setSchUid($value);
- break;
- case 8:
- $this->setWsCreateCaseStatus($value);
- break;
- case 9:
- $this->setWsRouteCaseStatus($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LogCasesSchedulerPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setLogCaseUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTasUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setUsrName($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setExecDate($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setExecHour($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setResult($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setSchUid($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setWsCreateCaseStatus($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setWsRouteCaseStatus($arr[$keys[9]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(LogCasesSchedulerPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(LogCasesSchedulerPeer::LOG_CASE_UID)) $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $this->log_case_uid);
- if ($this->isColumnModified(LogCasesSchedulerPeer::PRO_UID)) $criteria->add(LogCasesSchedulerPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(LogCasesSchedulerPeer::TAS_UID)) $criteria->add(LogCasesSchedulerPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(LogCasesSchedulerPeer::USR_NAME)) $criteria->add(LogCasesSchedulerPeer::USR_NAME, $this->usr_name);
- if ($this->isColumnModified(LogCasesSchedulerPeer::EXEC_DATE)) $criteria->add(LogCasesSchedulerPeer::EXEC_DATE, $this->exec_date);
- if ($this->isColumnModified(LogCasesSchedulerPeer::EXEC_HOUR)) $criteria->add(LogCasesSchedulerPeer::EXEC_HOUR, $this->exec_hour);
- if ($this->isColumnModified(LogCasesSchedulerPeer::RESULT)) $criteria->add(LogCasesSchedulerPeer::RESULT, $this->result);
- if ($this->isColumnModified(LogCasesSchedulerPeer::SCH_UID)) $criteria->add(LogCasesSchedulerPeer::SCH_UID, $this->sch_uid);
- if ($this->isColumnModified(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS)) $criteria->add(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, $this->ws_create_case_status);
- if ($this->isColumnModified(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS)) $criteria->add(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS, $this->ws_route_case_status);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(LogCasesSchedulerPeer::DATABASE_NAME);
-
- $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $this->log_case_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getLogCaseUid();
- }
-
- /**
- * Generic method to set the primary key (log_case_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setLogCaseUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of LogCasesScheduler (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setUsrName($this->usr_name);
-
- $copyObj->setExecDate($this->exec_date);
-
- $copyObj->setExecHour($this->exec_hour);
-
- $copyObj->setResult($this->result);
-
- $copyObj->setSchUid($this->sch_uid);
-
- $copyObj->setWsCreateCaseStatus($this->ws_create_case_status);
-
- $copyObj->setWsRouteCaseStatus($this->ws_route_case_status);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setLogCaseUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return LogCasesScheduler Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return LogCasesSchedulerPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new LogCasesSchedulerPeer();
- }
- return self::$peer;
- }
-
-} // BaseLogCasesScheduler
diff --git a/workflow/engine/classes/model/om/BaseLogCasesSchedulerPeer.php b/workflow/engine/classes/model/om/BaseLogCasesSchedulerPeer.php
index ca5c92612..b1226310b 100755
--- a/workflow/engine/classes/model/om/BaseLogCasesSchedulerPeer.php
+++ b/workflow/engine/classes/model/om/BaseLogCasesSchedulerPeer.php
@@ -12,599 +12,601 @@ include_once 'classes/model/LogCasesScheduler.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLogCasesSchedulerPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'LOG_CASES_SCHEDULER';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.LogCasesScheduler';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 10;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the LOG_CASE_UID field */
- const LOG_CASE_UID = 'LOG_CASES_SCHEDULER.LOG_CASE_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'LOG_CASES_SCHEDULER.PRO_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'LOG_CASES_SCHEDULER.TAS_UID';
-
- /** the column name for the USR_NAME field */
- const USR_NAME = 'LOG_CASES_SCHEDULER.USR_NAME';
-
- /** the column name for the EXEC_DATE field */
- const EXEC_DATE = 'LOG_CASES_SCHEDULER.EXEC_DATE';
-
- /** the column name for the EXEC_HOUR field */
- const EXEC_HOUR = 'LOG_CASES_SCHEDULER.EXEC_HOUR';
-
- /** the column name for the RESULT field */
- const RESULT = 'LOG_CASES_SCHEDULER.RESULT';
-
- /** the column name for the SCH_UID field */
- const SCH_UID = 'LOG_CASES_SCHEDULER.SCH_UID';
-
- /** the column name for the WS_CREATE_CASE_STATUS field */
- const WS_CREATE_CASE_STATUS = 'LOG_CASES_SCHEDULER.WS_CREATE_CASE_STATUS';
-
- /** the column name for the WS_ROUTE_CASE_STATUS field */
- const WS_ROUTE_CASE_STATUS = 'LOG_CASES_SCHEDULER.WS_ROUTE_CASE_STATUS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('LogCaseUid', 'ProUid', 'TasUid', 'UsrName', 'ExecDate', 'ExecHour', 'Result', 'SchUid', 'WsCreateCaseStatus', 'WsRouteCaseStatus', ),
- BasePeer::TYPE_COLNAME => array (LogCasesSchedulerPeer::LOG_CASE_UID, LogCasesSchedulerPeer::PRO_UID, LogCasesSchedulerPeer::TAS_UID, LogCasesSchedulerPeer::USR_NAME, LogCasesSchedulerPeer::EXEC_DATE, LogCasesSchedulerPeer::EXEC_HOUR, LogCasesSchedulerPeer::RESULT, LogCasesSchedulerPeer::SCH_UID, LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS, ),
- BasePeer::TYPE_FIELDNAME => array ('LOG_CASE_UID', 'PRO_UID', 'TAS_UID', 'USR_NAME', 'EXEC_DATE', 'EXEC_HOUR', 'RESULT', 'SCH_UID', 'WS_CREATE_CASE_STATUS', 'WS_ROUTE_CASE_STATUS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('LogCaseUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'UsrName' => 3, 'ExecDate' => 4, 'ExecHour' => 5, 'Result' => 6, 'SchUid' => 7, 'WsCreateCaseStatus' => 8, 'WsRouteCaseStatus' => 9, ),
- BasePeer::TYPE_COLNAME => array (LogCasesSchedulerPeer::LOG_CASE_UID => 0, LogCasesSchedulerPeer::PRO_UID => 1, LogCasesSchedulerPeer::TAS_UID => 2, LogCasesSchedulerPeer::USR_NAME => 3, LogCasesSchedulerPeer::EXEC_DATE => 4, LogCasesSchedulerPeer::EXEC_HOUR => 5, LogCasesSchedulerPeer::RESULT => 6, LogCasesSchedulerPeer::SCH_UID => 7, LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS => 8, LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS => 9, ),
- BasePeer::TYPE_FIELDNAME => array ('LOG_CASE_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'USR_NAME' => 3, 'EXEC_DATE' => 4, 'EXEC_HOUR' => 5, 'RESULT' => 6, 'SCH_UID' => 7, 'WS_CREATE_CASE_STATUS' => 8, 'WS_ROUTE_CASE_STATUS' => 9, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/LogCasesSchedulerMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.LogCasesSchedulerMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = LogCasesSchedulerPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. LogCasesSchedulerPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(LogCasesSchedulerPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::LOG_CASE_UID);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::PRO_UID);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::TAS_UID);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::USR_NAME);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_DATE);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_HOUR);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::RESULT);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::SCH_UID);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS);
-
- $criteria->addSelectColumn(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS);
-
- }
-
- const COUNT = 'COUNT(LOG_CASES_SCHEDULER.LOG_CASE_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT LOG_CASES_SCHEDULER.LOG_CASE_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(LogCasesSchedulerPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(LogCasesSchedulerPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = LogCasesSchedulerPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return LogCasesScheduler
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = LogCasesSchedulerPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return LogCasesSchedulerPeer::populateObjects(LogCasesSchedulerPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- LogCasesSchedulerPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = LogCasesSchedulerPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return LogCasesSchedulerPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a LogCasesScheduler or Criteria object.
- *
- * @param mixed $values Criteria or LogCasesScheduler object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from LogCasesScheduler object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a LogCasesScheduler or Criteria object.
- *
- * @param mixed $values Criteria or LogCasesScheduler object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(LogCasesSchedulerPeer::LOG_CASE_UID);
- $selectCriteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $criteria->remove(LogCasesSchedulerPeer::LOG_CASE_UID), $comparison);
-
- } else { // $values is LogCasesScheduler object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the LOG_CASES_SCHEDULER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(LogCasesSchedulerPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a LogCasesScheduler or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or LogCasesScheduler object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(LogCasesSchedulerPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof LogCasesScheduler) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given LogCasesScheduler object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param LogCasesScheduler $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(LogCasesScheduler $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(LogCasesSchedulerPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(LogCasesSchedulerPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(LogCasesSchedulerPeer::DATABASE_NAME, LogCasesSchedulerPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return LogCasesScheduler
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(LogCasesSchedulerPeer::DATABASE_NAME);
-
- $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $pk);
-
-
- $v = LogCasesSchedulerPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $pks, Criteria::IN);
- $objs = LogCasesSchedulerPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseLogCasesSchedulerPeer
+abstract class BaseLogCasesSchedulerPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'LOG_CASES_SCHEDULER';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.LogCasesScheduler';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 10;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the LOG_CASE_UID field */
+ const LOG_CASE_UID = 'LOG_CASES_SCHEDULER.LOG_CASE_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'LOG_CASES_SCHEDULER.PRO_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'LOG_CASES_SCHEDULER.TAS_UID';
+
+ /** the column name for the USR_NAME field */
+ const USR_NAME = 'LOG_CASES_SCHEDULER.USR_NAME';
+
+ /** the column name for the EXEC_DATE field */
+ const EXEC_DATE = 'LOG_CASES_SCHEDULER.EXEC_DATE';
+
+ /** the column name for the EXEC_HOUR field */
+ const EXEC_HOUR = 'LOG_CASES_SCHEDULER.EXEC_HOUR';
+
+ /** the column name for the RESULT field */
+ const RESULT = 'LOG_CASES_SCHEDULER.RESULT';
+
+ /** the column name for the SCH_UID field */
+ const SCH_UID = 'LOG_CASES_SCHEDULER.SCH_UID';
+
+ /** the column name for the WS_CREATE_CASE_STATUS field */
+ const WS_CREATE_CASE_STATUS = 'LOG_CASES_SCHEDULER.WS_CREATE_CASE_STATUS';
+
+ /** the column name for the WS_ROUTE_CASE_STATUS field */
+ const WS_ROUTE_CASE_STATUS = 'LOG_CASES_SCHEDULER.WS_ROUTE_CASE_STATUS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('LogCaseUid', 'ProUid', 'TasUid', 'UsrName', 'ExecDate', 'ExecHour', 'Result', 'SchUid', 'WsCreateCaseStatus', 'WsRouteCaseStatus', ),
+ BasePeer::TYPE_COLNAME => array (LogCasesSchedulerPeer::LOG_CASE_UID, LogCasesSchedulerPeer::PRO_UID, LogCasesSchedulerPeer::TAS_UID, LogCasesSchedulerPeer::USR_NAME, LogCasesSchedulerPeer::EXEC_DATE, LogCasesSchedulerPeer::EXEC_HOUR, LogCasesSchedulerPeer::RESULT, LogCasesSchedulerPeer::SCH_UID, LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS, ),
+ BasePeer::TYPE_FIELDNAME => array ('LOG_CASE_UID', 'PRO_UID', 'TAS_UID', 'USR_NAME', 'EXEC_DATE', 'EXEC_HOUR', 'RESULT', 'SCH_UID', 'WS_CREATE_CASE_STATUS', 'WS_ROUTE_CASE_STATUS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('LogCaseUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'UsrName' => 3, 'ExecDate' => 4, 'ExecHour' => 5, 'Result' => 6, 'SchUid' => 7, 'WsCreateCaseStatus' => 8, 'WsRouteCaseStatus' => 9, ),
+ BasePeer::TYPE_COLNAME => array (LogCasesSchedulerPeer::LOG_CASE_UID => 0, LogCasesSchedulerPeer::PRO_UID => 1, LogCasesSchedulerPeer::TAS_UID => 2, LogCasesSchedulerPeer::USR_NAME => 3, LogCasesSchedulerPeer::EXEC_DATE => 4, LogCasesSchedulerPeer::EXEC_HOUR => 5, LogCasesSchedulerPeer::RESULT => 6, LogCasesSchedulerPeer::SCH_UID => 7, LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS => 8, LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS => 9, ),
+ BasePeer::TYPE_FIELDNAME => array ('LOG_CASE_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'USR_NAME' => 3, 'EXEC_DATE' => 4, 'EXEC_HOUR' => 5, 'RESULT' => 6, 'SCH_UID' => 7, 'WS_CREATE_CASE_STATUS' => 8, 'WS_ROUTE_CASE_STATUS' => 9, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/LogCasesSchedulerMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.LogCasesSchedulerMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = LogCasesSchedulerPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. LogCasesSchedulerPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(LogCasesSchedulerPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::LOG_CASE_UID);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::PRO_UID);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::TAS_UID);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::USR_NAME);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_DATE);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_HOUR);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::RESULT);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::SCH_UID);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS);
+
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS);
+
+ }
+
+ const COUNT = 'COUNT(LOG_CASES_SCHEDULER.LOG_CASE_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT LOG_CASES_SCHEDULER.LOG_CASE_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(LogCasesSchedulerPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = LogCasesSchedulerPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return LogCasesScheduler
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = LogCasesSchedulerPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return LogCasesSchedulerPeer::populateObjects(LogCasesSchedulerPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ LogCasesSchedulerPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = LogCasesSchedulerPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return LogCasesSchedulerPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a LogCasesScheduler or Criteria object.
+ *
+ * @param mixed $values Criteria or LogCasesScheduler object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from LogCasesScheduler object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a LogCasesScheduler or Criteria object.
+ *
+ * @param mixed $values Criteria or LogCasesScheduler object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(LogCasesSchedulerPeer::LOG_CASE_UID);
+ $selectCriteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $criteria->remove(LogCasesSchedulerPeer::LOG_CASE_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the LOG_CASES_SCHEDULER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(LogCasesSchedulerPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a LogCasesScheduler or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or LogCasesScheduler object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(LogCasesSchedulerPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof LogCasesScheduler) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given LogCasesScheduler object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param LogCasesScheduler $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(LogCasesScheduler $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(LogCasesSchedulerPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(LogCasesSchedulerPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(LogCasesSchedulerPeer::DATABASE_NAME, LogCasesSchedulerPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return LogCasesScheduler
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(LogCasesSchedulerPeer::DATABASE_NAME);
+
+ $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $pk);
+
+
+ $v = LogCasesSchedulerPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(LogCasesSchedulerPeer::LOG_CASE_UID, $pks, Criteria::IN);
+ $objs = LogCasesSchedulerPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseLogCasesSchedulerPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseLogCasesSchedulerPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/LogCasesSchedulerMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.LogCasesSchedulerMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/LogCasesSchedulerMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.LogCasesSchedulerMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseLoginLog.php b/workflow/engine/classes/model/om/BaseLoginLog.php
index 9bce2ee5d..7810a8c84 100755
--- a/workflow/engine/classes/model/om/BaseLoginLog.php
+++ b/workflow/engine/classes/model/om/BaseLoginLog.php
@@ -16,904 +16,949 @@ include_once 'classes/model/LoginLogPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLoginLog extends BaseObject implements Persistent {
-
+abstract class BaseLoginLog extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var LoginLogPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the log_uid field.
+ * @var string
+ */
+ protected $log_uid = '';
+
+ /**
+ * The value for the log_status field.
+ * @var string
+ */
+ protected $log_status = '';
+
+ /**
+ * The value for the log_ip field.
+ * @var string
+ */
+ protected $log_ip = '';
+
+ /**
+ * The value for the log_sid field.
+ * @var string
+ */
+ protected $log_sid = '';
+
+ /**
+ * The value for the log_init_date field.
+ * @var int
+ */
+ protected $log_init_date;
+
+ /**
+ * The value for the log_end_date field.
+ * @var int
+ */
+ protected $log_end_date;
+
+ /**
+ * The value for the log_client_hostname field.
+ * @var string
+ */
+ protected $log_client_hostname = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [log_uid] column value.
+ *
+ * @return string
+ */
+ public function getLogUid()
+ {
+
+ return $this->log_uid;
+ }
+
+ /**
+ * Get the [log_status] column value.
+ *
+ * @return string
+ */
+ public function getLogStatus()
+ {
+
+ return $this->log_status;
+ }
+
+ /**
+ * Get the [log_ip] column value.
+ *
+ * @return string
+ */
+ public function getLogIp()
+ {
+
+ return $this->log_ip;
+ }
+
+ /**
+ * Get the [log_sid] column value.
+ *
+ * @return string
+ */
+ public function getLogSid()
+ {
+
+ return $this->log_sid;
+ }
+
+ /**
+ * Get the [optionally formatted] [log_init_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getLogInitDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->log_init_date === null || $this->log_init_date === '') {
+ return null;
+ } elseif (!is_int($this->log_init_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->log_init_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [log_init_date] as date/time value: " .
+ var_export($this->log_init_date, true));
+ }
+ } else {
+ $ts = $this->log_init_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [log_end_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getLogEndDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->log_end_date === null || $this->log_end_date === '') {
+ return null;
+ } elseif (!is_int($this->log_end_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->log_end_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [log_end_date] as date/time value: " .
+ var_export($this->log_end_date, true));
+ }
+ } else {
+ $ts = $this->log_end_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [log_client_hostname] column value.
+ *
+ * @return string
+ */
+ public function getLogClientHostname()
+ {
+
+ return $this->log_client_hostname;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Set the value of [log_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLogUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->log_uid !== $v || $v === '') {
+ $this->log_uid = $v;
+ $this->modifiedColumns[] = LoginLogPeer::LOG_UID;
+ }
+
+ } // setLogUid()
+
+ /**
+ * Set the value of [log_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLogStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->log_status !== $v || $v === '') {
+ $this->log_status = $v;
+ $this->modifiedColumns[] = LoginLogPeer::LOG_STATUS;
+ }
+
+ } // setLogStatus()
+
+ /**
+ * Set the value of [log_ip] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLogIp($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->log_ip !== $v || $v === '') {
+ $this->log_ip = $v;
+ $this->modifiedColumns[] = LoginLogPeer::LOG_IP;
+ }
+
+ } // setLogIp()
+
+ /**
+ * Set the value of [log_sid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLogSid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->log_sid !== $v || $v === '') {
+ $this->log_sid = $v;
+ $this->modifiedColumns[] = LoginLogPeer::LOG_SID;
+ }
+
+ } // setLogSid()
+
+ /**
+ * Set the value of [log_init_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setLogInitDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [log_init_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->log_init_date !== $ts) {
+ $this->log_init_date = $ts;
+ $this->modifiedColumns[] = LoginLogPeer::LOG_INIT_DATE;
+ }
+
+ } // setLogInitDate()
+
+ /**
+ * Set the value of [log_end_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setLogEndDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [log_end_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->log_end_date !== $ts) {
+ $this->log_end_date = $ts;
+ $this->modifiedColumns[] = LoginLogPeer::LOG_END_DATE;
+ }
+
+ } // setLogEndDate()
+
+ /**
+ * Set the value of [log_client_hostname] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setLogClientHostname($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->log_client_hostname !== $v || $v === '') {
+ $this->log_client_hostname = $v;
+ $this->modifiedColumns[] = LoginLogPeer::LOG_CLIENT_HOSTNAME;
+ }
+
+ } // setLogClientHostname()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = LoginLogPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->log_uid = $rs->getString($startcol + 0);
+
+ $this->log_status = $rs->getString($startcol + 1);
+
+ $this->log_ip = $rs->getString($startcol + 2);
+
+ $this->log_sid = $rs->getString($startcol + 3);
+
+ $this->log_init_date = $rs->getTimestamp($startcol + 4, null);
+
+ $this->log_end_date = $rs->getTimestamp($startcol + 5, null);
+
+ $this->log_client_hostname = $rs->getString($startcol + 6);
+
+ $this->usr_uid = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = LoginLogPeer::NUM_COLUMNS - LoginLogPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating LoginLog object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ LoginLogPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = LoginLogPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += LoginLogPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = LoginLogPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LoginLogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getLogUid();
+ break;
+ case 1:
+ return $this->getLogStatus();
+ break;
+ case 2:
+ return $this->getLogIp();
+ break;
+ case 3:
+ return $this->getLogSid();
+ break;
+ case 4:
+ return $this->getLogInitDate();
+ break;
+ case 5:
+ return $this->getLogEndDate();
+ break;
+ case 6:
+ return $this->getLogClientHostname();
+ break;
+ case 7:
+ return $this->getUsrUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LoginLogPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getLogUid(),
+ $keys[1] => $this->getLogStatus(),
+ $keys[2] => $this->getLogIp(),
+ $keys[3] => $this->getLogSid(),
+ $keys[4] => $this->getLogInitDate(),
+ $keys[5] => $this->getLogEndDate(),
+ $keys[6] => $this->getLogClientHostname(),
+ $keys[7] => $this->getUsrUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = LoginLogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setLogUid($value);
+ break;
+ case 1:
+ $this->setLogStatus($value);
+ break;
+ case 2:
+ $this->setLogIp($value);
+ break;
+ case 3:
+ $this->setLogSid($value);
+ break;
+ case 4:
+ $this->setLogInitDate($value);
+ break;
+ case 5:
+ $this->setLogEndDate($value);
+ break;
+ case 6:
+ $this->setLogClientHostname($value);
+ break;
+ case 7:
+ $this->setUsrUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = LoginLogPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setLogUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setLogStatus($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setLogIp($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setLogSid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setLogInitDate($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setLogEndDate($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setLogClientHostname($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setUsrUid($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(LoginLogPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(LoginLogPeer::LOG_UID)) {
+ $criteria->add(LoginLogPeer::LOG_UID, $this->log_uid);
+ }
+
+ if ($this->isColumnModified(LoginLogPeer::LOG_STATUS)) {
+ $criteria->add(LoginLogPeer::LOG_STATUS, $this->log_status);
+ }
+
+ if ($this->isColumnModified(LoginLogPeer::LOG_IP)) {
+ $criteria->add(LoginLogPeer::LOG_IP, $this->log_ip);
+ }
+
+ if ($this->isColumnModified(LoginLogPeer::LOG_SID)) {
+ $criteria->add(LoginLogPeer::LOG_SID, $this->log_sid);
+ }
+
+ if ($this->isColumnModified(LoginLogPeer::LOG_INIT_DATE)) {
+ $criteria->add(LoginLogPeer::LOG_INIT_DATE, $this->log_init_date);
+ }
+
+ if ($this->isColumnModified(LoginLogPeer::LOG_END_DATE)) {
+ $criteria->add(LoginLogPeer::LOG_END_DATE, $this->log_end_date);
+ }
+
+ if ($this->isColumnModified(LoginLogPeer::LOG_CLIENT_HOSTNAME)) {
+ $criteria->add(LoginLogPeer::LOG_CLIENT_HOSTNAME, $this->log_client_hostname);
+ }
+
+ if ($this->isColumnModified(LoginLogPeer::USR_UID)) {
+ $criteria->add(LoginLogPeer::USR_UID, $this->usr_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(LoginLogPeer::DATABASE_NAME);
+
+ $criteria->add(LoginLogPeer::LOG_UID, $this->log_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getLogUid();
+ }
+
+ /**
+ * Generic method to set the primary key (log_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setLogUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of LoginLog (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setLogStatus($this->log_status);
+
+ $copyObj->setLogIp($this->log_ip);
+
+ $copyObj->setLogSid($this->log_sid);
+
+ $copyObj->setLogInitDate($this->log_init_date);
+
+ $copyObj->setLogEndDate($this->log_end_date);
+
+ $copyObj->setLogClientHostname($this->log_client_hostname);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setLogUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return LoginLog Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return LoginLogPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new LoginLogPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var LoginLogPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the log_uid field.
- * @var string
- */
- protected $log_uid = '';
-
-
- /**
- * The value for the log_status field.
- * @var string
- */
- protected $log_status = '';
-
-
- /**
- * The value for the log_ip field.
- * @var string
- */
- protected $log_ip = '';
-
-
- /**
- * The value for the log_sid field.
- * @var string
- */
- protected $log_sid = '';
-
-
- /**
- * The value for the log_init_date field.
- * @var int
- */
- protected $log_init_date;
-
-
- /**
- * The value for the log_end_date field.
- * @var int
- */
- protected $log_end_date;
-
-
- /**
- * The value for the log_client_hostname field.
- * @var string
- */
- protected $log_client_hostname = '';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [log_uid] column value.
- *
- * @return string
- */
- public function getLogUid()
- {
-
- return $this->log_uid;
- }
-
- /**
- * Get the [log_status] column value.
- *
- * @return string
- */
- public function getLogStatus()
- {
-
- return $this->log_status;
- }
-
- /**
- * Get the [log_ip] column value.
- *
- * @return string
- */
- public function getLogIp()
- {
-
- return $this->log_ip;
- }
-
- /**
- * Get the [log_sid] column value.
- *
- * @return string
- */
- public function getLogSid()
- {
-
- return $this->log_sid;
- }
-
- /**
- * Get the [optionally formatted] [log_init_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getLogInitDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->log_init_date === null || $this->log_init_date === '') {
- return null;
- } elseif (!is_int($this->log_init_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->log_init_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [log_init_date] as date/time value: " . var_export($this->log_init_date, true));
- }
- } else {
- $ts = $this->log_init_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [log_end_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getLogEndDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->log_end_date === null || $this->log_end_date === '') {
- return null;
- } elseif (!is_int($this->log_end_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->log_end_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [log_end_date] as date/time value: " . var_export($this->log_end_date, true));
- }
- } else {
- $ts = $this->log_end_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [log_client_hostname] column value.
- *
- * @return string
- */
- public function getLogClientHostname()
- {
-
- return $this->log_client_hostname;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Set the value of [log_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLogUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->log_uid !== $v || $v === '') {
- $this->log_uid = $v;
- $this->modifiedColumns[] = LoginLogPeer::LOG_UID;
- }
-
- } // setLogUid()
-
- /**
- * Set the value of [log_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLogStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->log_status !== $v || $v === '') {
- $this->log_status = $v;
- $this->modifiedColumns[] = LoginLogPeer::LOG_STATUS;
- }
-
- } // setLogStatus()
-
- /**
- * Set the value of [log_ip] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLogIp($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->log_ip !== $v || $v === '') {
- $this->log_ip = $v;
- $this->modifiedColumns[] = LoginLogPeer::LOG_IP;
- }
-
- } // setLogIp()
-
- /**
- * Set the value of [log_sid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLogSid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->log_sid !== $v || $v === '') {
- $this->log_sid = $v;
- $this->modifiedColumns[] = LoginLogPeer::LOG_SID;
- }
-
- } // setLogSid()
-
- /**
- * Set the value of [log_init_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setLogInitDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [log_init_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->log_init_date !== $ts) {
- $this->log_init_date = $ts;
- $this->modifiedColumns[] = LoginLogPeer::LOG_INIT_DATE;
- }
-
- } // setLogInitDate()
-
- /**
- * Set the value of [log_end_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setLogEndDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [log_end_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->log_end_date !== $ts) {
- $this->log_end_date = $ts;
- $this->modifiedColumns[] = LoginLogPeer::LOG_END_DATE;
- }
-
- } // setLogEndDate()
-
- /**
- * Set the value of [log_client_hostname] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setLogClientHostname($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->log_client_hostname !== $v || $v === '') {
- $this->log_client_hostname = $v;
- $this->modifiedColumns[] = LoginLogPeer::LOG_CLIENT_HOSTNAME;
- }
-
- } // setLogClientHostname()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = LoginLogPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->log_uid = $rs->getString($startcol + 0);
-
- $this->log_status = $rs->getString($startcol + 1);
-
- $this->log_ip = $rs->getString($startcol + 2);
-
- $this->log_sid = $rs->getString($startcol + 3);
-
- $this->log_init_date = $rs->getTimestamp($startcol + 4, null);
-
- $this->log_end_date = $rs->getTimestamp($startcol + 5, null);
-
- $this->log_client_hostname = $rs->getString($startcol + 6);
-
- $this->usr_uid = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = LoginLogPeer::NUM_COLUMNS - LoginLogPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating LoginLog object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- LoginLogPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = LoginLogPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += LoginLogPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = LoginLogPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LoginLogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getLogUid();
- break;
- case 1:
- return $this->getLogStatus();
- break;
- case 2:
- return $this->getLogIp();
- break;
- case 3:
- return $this->getLogSid();
- break;
- case 4:
- return $this->getLogInitDate();
- break;
- case 5:
- return $this->getLogEndDate();
- break;
- case 6:
- return $this->getLogClientHostname();
- break;
- case 7:
- return $this->getUsrUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LoginLogPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getLogUid(),
- $keys[1] => $this->getLogStatus(),
- $keys[2] => $this->getLogIp(),
- $keys[3] => $this->getLogSid(),
- $keys[4] => $this->getLogInitDate(),
- $keys[5] => $this->getLogEndDate(),
- $keys[6] => $this->getLogClientHostname(),
- $keys[7] => $this->getUsrUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = LoginLogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setLogUid($value);
- break;
- case 1:
- $this->setLogStatus($value);
- break;
- case 2:
- $this->setLogIp($value);
- break;
- case 3:
- $this->setLogSid($value);
- break;
- case 4:
- $this->setLogInitDate($value);
- break;
- case 5:
- $this->setLogEndDate($value);
- break;
- case 6:
- $this->setLogClientHostname($value);
- break;
- case 7:
- $this->setUsrUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = LoginLogPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setLogUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setLogStatus($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setLogIp($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setLogSid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setLogInitDate($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setLogEndDate($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setLogClientHostname($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setUsrUid($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(LoginLogPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(LoginLogPeer::LOG_UID)) $criteria->add(LoginLogPeer::LOG_UID, $this->log_uid);
- if ($this->isColumnModified(LoginLogPeer::LOG_STATUS)) $criteria->add(LoginLogPeer::LOG_STATUS, $this->log_status);
- if ($this->isColumnModified(LoginLogPeer::LOG_IP)) $criteria->add(LoginLogPeer::LOG_IP, $this->log_ip);
- if ($this->isColumnModified(LoginLogPeer::LOG_SID)) $criteria->add(LoginLogPeer::LOG_SID, $this->log_sid);
- if ($this->isColumnModified(LoginLogPeer::LOG_INIT_DATE)) $criteria->add(LoginLogPeer::LOG_INIT_DATE, $this->log_init_date);
- if ($this->isColumnModified(LoginLogPeer::LOG_END_DATE)) $criteria->add(LoginLogPeer::LOG_END_DATE, $this->log_end_date);
- if ($this->isColumnModified(LoginLogPeer::LOG_CLIENT_HOSTNAME)) $criteria->add(LoginLogPeer::LOG_CLIENT_HOSTNAME, $this->log_client_hostname);
- if ($this->isColumnModified(LoginLogPeer::USR_UID)) $criteria->add(LoginLogPeer::USR_UID, $this->usr_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(LoginLogPeer::DATABASE_NAME);
-
- $criteria->add(LoginLogPeer::LOG_UID, $this->log_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getLogUid();
- }
-
- /**
- * Generic method to set the primary key (log_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setLogUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of LoginLog (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setLogStatus($this->log_status);
-
- $copyObj->setLogIp($this->log_ip);
-
- $copyObj->setLogSid($this->log_sid);
-
- $copyObj->setLogInitDate($this->log_init_date);
-
- $copyObj->setLogEndDate($this->log_end_date);
-
- $copyObj->setLogClientHostname($this->log_client_hostname);
-
- $copyObj->setUsrUid($this->usr_uid);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setLogUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return LoginLog Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return LoginLogPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new LoginLogPeer();
- }
- return self::$peer;
- }
-
-} // BaseLoginLog
diff --git a/workflow/engine/classes/model/om/BaseLoginLogPeer.php b/workflow/engine/classes/model/om/BaseLoginLogPeer.php
index 31a08b181..b5e595779 100755
--- a/workflow/engine/classes/model/om/BaseLoginLogPeer.php
+++ b/workflow/engine/classes/model/om/BaseLoginLogPeer.php
@@ -12,589 +12,591 @@ include_once 'classes/model/LoginLog.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseLoginLogPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'LOGIN_LOG';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.LoginLog';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the LOG_UID field */
- const LOG_UID = 'LOGIN_LOG.LOG_UID';
-
- /** the column name for the LOG_STATUS field */
- const LOG_STATUS = 'LOGIN_LOG.LOG_STATUS';
-
- /** the column name for the LOG_IP field */
- const LOG_IP = 'LOGIN_LOG.LOG_IP';
-
- /** the column name for the LOG_SID field */
- const LOG_SID = 'LOGIN_LOG.LOG_SID';
-
- /** the column name for the LOG_INIT_DATE field */
- const LOG_INIT_DATE = 'LOGIN_LOG.LOG_INIT_DATE';
-
- /** the column name for the LOG_END_DATE field */
- const LOG_END_DATE = 'LOGIN_LOG.LOG_END_DATE';
-
- /** the column name for the LOG_CLIENT_HOSTNAME field */
- const LOG_CLIENT_HOSTNAME = 'LOGIN_LOG.LOG_CLIENT_HOSTNAME';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'LOGIN_LOG.USR_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('LogUid', 'LogStatus', 'LogIp', 'LogSid', 'LogInitDate', 'LogEndDate', 'LogClientHostname', 'UsrUid', ),
- BasePeer::TYPE_COLNAME => array (LoginLogPeer::LOG_UID, LoginLogPeer::LOG_STATUS, LoginLogPeer::LOG_IP, LoginLogPeer::LOG_SID, LoginLogPeer::LOG_INIT_DATE, LoginLogPeer::LOG_END_DATE, LoginLogPeer::LOG_CLIENT_HOSTNAME, LoginLogPeer::USR_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('LOG_UID', 'LOG_STATUS', 'LOG_IP', 'LOG_SID', 'LOG_INIT_DATE', 'LOG_END_DATE', 'LOG_CLIENT_HOSTNAME', 'USR_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('LogUid' => 0, 'LogStatus' => 1, 'LogIp' => 2, 'LogSid' => 3, 'LogInitDate' => 4, 'LogEndDate' => 5, 'LogClientHostname' => 6, 'UsrUid' => 7, ),
- BasePeer::TYPE_COLNAME => array (LoginLogPeer::LOG_UID => 0, LoginLogPeer::LOG_STATUS => 1, LoginLogPeer::LOG_IP => 2, LoginLogPeer::LOG_SID => 3, LoginLogPeer::LOG_INIT_DATE => 4, LoginLogPeer::LOG_END_DATE => 5, LoginLogPeer::LOG_CLIENT_HOSTNAME => 6, LoginLogPeer::USR_UID => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('LOG_UID' => 0, 'LOG_STATUS' => 1, 'LOG_IP' => 2, 'LOG_SID' => 3, 'LOG_INIT_DATE' => 4, 'LOG_END_DATE' => 5, 'LOG_CLIENT_HOSTNAME' => 6, 'USR_UID' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/LoginLogMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.LoginLogMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = LoginLogPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. LoginLogPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(LoginLogPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(LoginLogPeer::LOG_UID);
-
- $criteria->addSelectColumn(LoginLogPeer::LOG_STATUS);
-
- $criteria->addSelectColumn(LoginLogPeer::LOG_IP);
-
- $criteria->addSelectColumn(LoginLogPeer::LOG_SID);
-
- $criteria->addSelectColumn(LoginLogPeer::LOG_INIT_DATE);
-
- $criteria->addSelectColumn(LoginLogPeer::LOG_END_DATE);
-
- $criteria->addSelectColumn(LoginLogPeer::LOG_CLIENT_HOSTNAME);
-
- $criteria->addSelectColumn(LoginLogPeer::USR_UID);
-
- }
-
- const COUNT = 'COUNT(LOGIN_LOG.LOG_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT LOGIN_LOG.LOG_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(LoginLogPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(LoginLogPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = LoginLogPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return LoginLog
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = LoginLogPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return LoginLogPeer::populateObjects(LoginLogPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- LoginLogPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = LoginLogPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return LoginLogPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a LoginLog or Criteria object.
- *
- * @param mixed $values Criteria or LoginLog object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from LoginLog object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a LoginLog or Criteria object.
- *
- * @param mixed $values Criteria or LoginLog object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(LoginLogPeer::LOG_UID);
- $selectCriteria->add(LoginLogPeer::LOG_UID, $criteria->remove(LoginLogPeer::LOG_UID), $comparison);
-
- } else { // $values is LoginLog object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the LOGIN_LOG table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(LoginLogPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a LoginLog or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or LoginLog object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof LoginLog) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(LoginLogPeer::LOG_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given LoginLog object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param LoginLog $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(LoginLog $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(LoginLogPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(LoginLogPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(LoginLogPeer::DATABASE_NAME, LoginLogPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return LoginLog
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(LoginLogPeer::DATABASE_NAME);
-
- $criteria->add(LoginLogPeer::LOG_UID, $pk);
-
-
- $v = LoginLogPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(LoginLogPeer::LOG_UID, $pks, Criteria::IN);
- $objs = LoginLogPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseLoginLogPeer
+abstract class BaseLoginLogPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'LOGIN_LOG';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.LoginLog';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the LOG_UID field */
+ const LOG_UID = 'LOGIN_LOG.LOG_UID';
+
+ /** the column name for the LOG_STATUS field */
+ const LOG_STATUS = 'LOGIN_LOG.LOG_STATUS';
+
+ /** the column name for the LOG_IP field */
+ const LOG_IP = 'LOGIN_LOG.LOG_IP';
+
+ /** the column name for the LOG_SID field */
+ const LOG_SID = 'LOGIN_LOG.LOG_SID';
+
+ /** the column name for the LOG_INIT_DATE field */
+ const LOG_INIT_DATE = 'LOGIN_LOG.LOG_INIT_DATE';
+
+ /** the column name for the LOG_END_DATE field */
+ const LOG_END_DATE = 'LOGIN_LOG.LOG_END_DATE';
+
+ /** the column name for the LOG_CLIENT_HOSTNAME field */
+ const LOG_CLIENT_HOSTNAME = 'LOGIN_LOG.LOG_CLIENT_HOSTNAME';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'LOGIN_LOG.USR_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('LogUid', 'LogStatus', 'LogIp', 'LogSid', 'LogInitDate', 'LogEndDate', 'LogClientHostname', 'UsrUid', ),
+ BasePeer::TYPE_COLNAME => array (LoginLogPeer::LOG_UID, LoginLogPeer::LOG_STATUS, LoginLogPeer::LOG_IP, LoginLogPeer::LOG_SID, LoginLogPeer::LOG_INIT_DATE, LoginLogPeer::LOG_END_DATE, LoginLogPeer::LOG_CLIENT_HOSTNAME, LoginLogPeer::USR_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('LOG_UID', 'LOG_STATUS', 'LOG_IP', 'LOG_SID', 'LOG_INIT_DATE', 'LOG_END_DATE', 'LOG_CLIENT_HOSTNAME', 'USR_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('LogUid' => 0, 'LogStatus' => 1, 'LogIp' => 2, 'LogSid' => 3, 'LogInitDate' => 4, 'LogEndDate' => 5, 'LogClientHostname' => 6, 'UsrUid' => 7, ),
+ BasePeer::TYPE_COLNAME => array (LoginLogPeer::LOG_UID => 0, LoginLogPeer::LOG_STATUS => 1, LoginLogPeer::LOG_IP => 2, LoginLogPeer::LOG_SID => 3, LoginLogPeer::LOG_INIT_DATE => 4, LoginLogPeer::LOG_END_DATE => 5, LoginLogPeer::LOG_CLIENT_HOSTNAME => 6, LoginLogPeer::USR_UID => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('LOG_UID' => 0, 'LOG_STATUS' => 1, 'LOG_IP' => 2, 'LOG_SID' => 3, 'LOG_INIT_DATE' => 4, 'LOG_END_DATE' => 5, 'LOG_CLIENT_HOSTNAME' => 6, 'USR_UID' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/LoginLogMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.LoginLogMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = LoginLogPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. LoginLogPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(LoginLogPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(LoginLogPeer::LOG_UID);
+
+ $criteria->addSelectColumn(LoginLogPeer::LOG_STATUS);
+
+ $criteria->addSelectColumn(LoginLogPeer::LOG_IP);
+
+ $criteria->addSelectColumn(LoginLogPeer::LOG_SID);
+
+ $criteria->addSelectColumn(LoginLogPeer::LOG_INIT_DATE);
+
+ $criteria->addSelectColumn(LoginLogPeer::LOG_END_DATE);
+
+ $criteria->addSelectColumn(LoginLogPeer::LOG_CLIENT_HOSTNAME);
+
+ $criteria->addSelectColumn(LoginLogPeer::USR_UID);
+
+ }
+
+ const COUNT = 'COUNT(LOGIN_LOG.LOG_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT LOGIN_LOG.LOG_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(LoginLogPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(LoginLogPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = LoginLogPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return LoginLog
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = LoginLogPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return LoginLogPeer::populateObjects(LoginLogPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ LoginLogPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = LoginLogPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return LoginLogPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a LoginLog or Criteria object.
+ *
+ * @param mixed $values Criteria or LoginLog object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from LoginLog object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a LoginLog or Criteria object.
+ *
+ * @param mixed $values Criteria or LoginLog object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(LoginLogPeer::LOG_UID);
+ $selectCriteria->add(LoginLogPeer::LOG_UID, $criteria->remove(LoginLogPeer::LOG_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the LOGIN_LOG table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(LoginLogPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a LoginLog or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or LoginLog object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof LoginLog) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(LoginLogPeer::LOG_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given LoginLog object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param LoginLog $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(LoginLog $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(LoginLogPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(LoginLogPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(LoginLogPeer::DATABASE_NAME, LoginLogPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return LoginLog
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(LoginLogPeer::DATABASE_NAME);
+
+ $criteria->add(LoginLogPeer::LOG_UID, $pk);
+
+
+ $v = LoginLogPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(LoginLogPeer::LOG_UID, $pks, Criteria::IN);
+ $objs = LoginLogPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseLoginLogPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseLoginLogPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/LoginLogMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.LoginLogMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/LoginLogMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.LoginLogMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseObjectPermission.php b/workflow/engine/classes/model/om/BaseObjectPermission.php
index a945d769f..07601ce0f 100755
--- a/workflow/engine/classes/model/om/BaseObjectPermission.php
+++ b/workflow/engine/classes/model/om/BaseObjectPermission.php
@@ -16,1019 +16,1075 @@ include_once 'classes/model/ObjectPermissionPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseObjectPermission extends BaseObject implements Persistent {
+abstract class BaseObjectPermission extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ObjectPermissionPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the op_uid field.
+ * @var string
+ */
+ protected $op_uid = '0';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '0';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '0';
+
+ /**
+ * The value for the op_user_relation field.
+ * @var int
+ */
+ protected $op_user_relation = 0;
+
+ /**
+ * The value for the op_task_source field.
+ * @var string
+ */
+ protected $op_task_source = '0';
+
+ /**
+ * The value for the op_participate field.
+ * @var int
+ */
+ protected $op_participate = 0;
+
+ /**
+ * The value for the op_obj_type field.
+ * @var string
+ */
+ protected $op_obj_type = '0';
+
+ /**
+ * The value for the op_obj_uid field.
+ * @var string
+ */
+ protected $op_obj_uid = '0';
+
+ /**
+ * The value for the op_action field.
+ * @var string
+ */
+ protected $op_action = '0';
+
+ /**
+ * The value for the op_case_status field.
+ * @var string
+ */
+ protected $op_case_status = '0';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [op_uid] column value.
+ *
+ * @return string
+ */
+ public function getOpUid()
+ {
+
+ return $this->op_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [op_user_relation] column value.
+ *
+ * @return int
+ */
+ public function getOpUserRelation()
+ {
+
+ return $this->op_user_relation;
+ }
+
+ /**
+ * Get the [op_task_source] column value.
+ *
+ * @return string
+ */
+ public function getOpTaskSource()
+ {
+
+ return $this->op_task_source;
+ }
+
+ /**
+ * Get the [op_participate] column value.
+ *
+ * @return int
+ */
+ public function getOpParticipate()
+ {
+
+ return $this->op_participate;
+ }
+
+ /**
+ * Get the [op_obj_type] column value.
+ *
+ * @return string
+ */
+ public function getOpObjType()
+ {
+
+ return $this->op_obj_type;
+ }
+
+ /**
+ * Get the [op_obj_uid] column value.
+ *
+ * @return string
+ */
+ public function getOpObjUid()
+ {
+
+ return $this->op_obj_uid;
+ }
+
+ /**
+ * Get the [op_action] column value.
+ *
+ * @return string
+ */
+ public function getOpAction()
+ {
+
+ return $this->op_action;
+ }
+
+ /**
+ * Get the [op_case_status] column value.
+ *
+ * @return string
+ */
+ public function getOpCaseStatus()
+ {
+
+ return $this->op_case_status;
+ }
+
+ /**
+ * Set the value of [op_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOpUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->op_uid !== $v || $v === '0') {
+ $this->op_uid = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_UID;
+ }
+
+ } // setOpUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '0') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '0') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [op_user_relation] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOpUserRelation($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->op_user_relation !== $v || $v === 0) {
+ $this->op_user_relation = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_USER_RELATION;
+ }
+
+ } // setOpUserRelation()
+
+ /**
+ * Set the value of [op_task_source] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOpTaskSource($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->op_task_source !== $v || $v === '0') {
+ $this->op_task_source = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_TASK_SOURCE;
+ }
+
+ } // setOpTaskSource()
+
+ /**
+ * Set the value of [op_participate] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOpParticipate($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->op_participate !== $v || $v === 0) {
+ $this->op_participate = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_PARTICIPATE;
+ }
+
+ } // setOpParticipate()
+
+ /**
+ * Set the value of [op_obj_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOpObjType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->op_obj_type !== $v || $v === '0') {
+ $this->op_obj_type = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_OBJ_TYPE;
+ }
+
+ } // setOpObjType()
+
+ /**
+ * Set the value of [op_obj_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOpObjUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->op_obj_uid !== $v || $v === '0') {
+ $this->op_obj_uid = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_OBJ_UID;
+ }
+
+ } // setOpObjUid()
+
+ /**
+ * Set the value of [op_action] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOpAction($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->op_action !== $v || $v === '0') {
+ $this->op_action = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_ACTION;
+ }
+
+ } // setOpAction()
+
+ /**
+ * Set the value of [op_case_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOpCaseStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->op_case_status !== $v || $v === '0') {
+ $this->op_case_status = $v;
+ $this->modifiedColumns[] = ObjectPermissionPeer::OP_CASE_STATUS;
+ }
+
+ } // setOpCaseStatus()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->op_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->tas_uid = $rs->getString($startcol + 2);
+
+ $this->usr_uid = $rs->getString($startcol + 3);
+
+ $this->op_user_relation = $rs->getInt($startcol + 4);
+
+ $this->op_task_source = $rs->getString($startcol + 5);
+
+ $this->op_participate = $rs->getInt($startcol + 6);
+
+ $this->op_obj_type = $rs->getString($startcol + 7);
+
+ $this->op_obj_uid = $rs->getString($startcol + 8);
+
+ $this->op_action = $rs->getString($startcol + 9);
+
+ $this->op_case_status = $rs->getString($startcol + 10);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 11; // 11 = ObjectPermissionPeer::NUM_COLUMNS - ObjectPermissionPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating ObjectPermission object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ObjectPermissionPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ObjectPermissionPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ObjectPermissionPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ObjectPermissionPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ObjectPermissionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getOpUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getTasUid();
+ break;
+ case 3:
+ return $this->getUsrUid();
+ break;
+ case 4:
+ return $this->getOpUserRelation();
+ break;
+ case 5:
+ return $this->getOpTaskSource();
+ break;
+ case 6:
+ return $this->getOpParticipate();
+ break;
+ case 7:
+ return $this->getOpObjType();
+ break;
+ case 8:
+ return $this->getOpObjUid();
+ break;
+ case 9:
+ return $this->getOpAction();
+ break;
+ case 10:
+ return $this->getOpCaseStatus();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ObjectPermissionPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getOpUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getTasUid(),
+ $keys[3] => $this->getUsrUid(),
+ $keys[4] => $this->getOpUserRelation(),
+ $keys[5] => $this->getOpTaskSource(),
+ $keys[6] => $this->getOpParticipate(),
+ $keys[7] => $this->getOpObjType(),
+ $keys[8] => $this->getOpObjUid(),
+ $keys[9] => $this->getOpAction(),
+ $keys[10] => $this->getOpCaseStatus(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ObjectPermissionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setOpUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setTasUid($value);
+ break;
+ case 3:
+ $this->setUsrUid($value);
+ break;
+ case 4:
+ $this->setOpUserRelation($value);
+ break;
+ case 5:
+ $this->setOpTaskSource($value);
+ break;
+ case 6:
+ $this->setOpParticipate($value);
+ break;
+ case 7:
+ $this->setOpObjType($value);
+ break;
+ case 8:
+ $this->setOpObjUid($value);
+ break;
+ case 9:
+ $this->setOpAction($value);
+ break;
+ case 10:
+ $this->setOpCaseStatus($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ObjectPermissionPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setOpUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTasUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setUsrUid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setOpUserRelation($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setOpTaskSource($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setOpParticipate($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setOpObjType($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setOpObjUid($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setOpAction($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setOpCaseStatus($arr[$keys[10]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ObjectPermissionPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_UID)) {
+ $criteria->add(ObjectPermissionPeer::OP_UID, $this->op_uid);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::PRO_UID)) {
+ $criteria->add(ObjectPermissionPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::TAS_UID)) {
+ $criteria->add(ObjectPermissionPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::USR_UID)) {
+ $criteria->add(ObjectPermissionPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_USER_RELATION)) {
+ $criteria->add(ObjectPermissionPeer::OP_USER_RELATION, $this->op_user_relation);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_TASK_SOURCE)) {
+ $criteria->add(ObjectPermissionPeer::OP_TASK_SOURCE, $this->op_task_source);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_PARTICIPATE)) {
+ $criteria->add(ObjectPermissionPeer::OP_PARTICIPATE, $this->op_participate);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_OBJ_TYPE)) {
+ $criteria->add(ObjectPermissionPeer::OP_OBJ_TYPE, $this->op_obj_type);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_OBJ_UID)) {
+ $criteria->add(ObjectPermissionPeer::OP_OBJ_UID, $this->op_obj_uid);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_ACTION)) {
+ $criteria->add(ObjectPermissionPeer::OP_ACTION, $this->op_action);
+ }
+
+ if ($this->isColumnModified(ObjectPermissionPeer::OP_CASE_STATUS)) {
+ $criteria->add(ObjectPermissionPeer::OP_CASE_STATUS, $this->op_case_status);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ObjectPermissionPeer::DATABASE_NAME);
+
+ $criteria->add(ObjectPermissionPeer::OP_UID, $this->op_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getOpUid();
+ }
+
+ /**
+ * Generic method to set the primary key (op_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setOpUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of ObjectPermission (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTasUid($this->tas_uid);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+ $copyObj->setOpUserRelation($this->op_user_relation);
+
+ $copyObj->setOpTaskSource($this->op_task_source);
+
+ $copyObj->setOpParticipate($this->op_participate);
+
+ $copyObj->setOpObjType($this->op_obj_type);
+
+ $copyObj->setOpObjUid($this->op_obj_uid);
+
+ $copyObj->setOpAction($this->op_action);
+
+ $copyObj->setOpCaseStatus($this->op_case_status);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setOpUid('0'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return ObjectPermission Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ObjectPermissionPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ObjectPermissionPeer();
+ }
+ return self::$peer;
+ }
+}
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ObjectPermissionPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the op_uid field.
- * @var string
- */
- protected $op_uid = '0';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '0';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '0';
-
-
- /**
- * The value for the op_user_relation field.
- * @var int
- */
- protected $op_user_relation = 0;
-
-
- /**
- * The value for the op_task_source field.
- * @var string
- */
- protected $op_task_source = '0';
-
-
- /**
- * The value for the op_participate field.
- * @var int
- */
- protected $op_participate = 0;
-
-
- /**
- * The value for the op_obj_type field.
- * @var string
- */
- protected $op_obj_type = '0';
-
-
- /**
- * The value for the op_obj_uid field.
- * @var string
- */
- protected $op_obj_uid = '0';
-
-
- /**
- * The value for the op_action field.
- * @var string
- */
- protected $op_action = '0';
-
-
- /**
- * The value for the op_case_status field.
- * @var string
- */
- protected $op_case_status = '0';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [op_uid] column value.
- *
- * @return string
- */
- public function getOpUid()
- {
-
- return $this->op_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [op_user_relation] column value.
- *
- * @return int
- */
- public function getOpUserRelation()
- {
-
- return $this->op_user_relation;
- }
-
- /**
- * Get the [op_task_source] column value.
- *
- * @return string
- */
- public function getOpTaskSource()
- {
-
- return $this->op_task_source;
- }
-
- /**
- * Get the [op_participate] column value.
- *
- * @return int
- */
- public function getOpParticipate()
- {
-
- return $this->op_participate;
- }
-
- /**
- * Get the [op_obj_type] column value.
- *
- * @return string
- */
- public function getOpObjType()
- {
-
- return $this->op_obj_type;
- }
-
- /**
- * Get the [op_obj_uid] column value.
- *
- * @return string
- */
- public function getOpObjUid()
- {
-
- return $this->op_obj_uid;
- }
-
- /**
- * Get the [op_action] column value.
- *
- * @return string
- */
- public function getOpAction()
- {
-
- return $this->op_action;
- }
-
- /**
- * Get the [op_case_status] column value.
- *
- * @return string
- */
- public function getOpCaseStatus()
- {
-
- return $this->op_case_status;
- }
-
- /**
- * Set the value of [op_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOpUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->op_uid !== $v || $v === '0') {
- $this->op_uid = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_UID;
- }
-
- } // setOpUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '0') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '0') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [op_user_relation] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOpUserRelation($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->op_user_relation !== $v || $v === 0) {
- $this->op_user_relation = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_USER_RELATION;
- }
-
- } // setOpUserRelation()
-
- /**
- * Set the value of [op_task_source] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOpTaskSource($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->op_task_source !== $v || $v === '0') {
- $this->op_task_source = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_TASK_SOURCE;
- }
-
- } // setOpTaskSource()
-
- /**
- * Set the value of [op_participate] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOpParticipate($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->op_participate !== $v || $v === 0) {
- $this->op_participate = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_PARTICIPATE;
- }
-
- } // setOpParticipate()
-
- /**
- * Set the value of [op_obj_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOpObjType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->op_obj_type !== $v || $v === '0') {
- $this->op_obj_type = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_OBJ_TYPE;
- }
-
- } // setOpObjType()
-
- /**
- * Set the value of [op_obj_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOpObjUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->op_obj_uid !== $v || $v === '0') {
- $this->op_obj_uid = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_OBJ_UID;
- }
-
- } // setOpObjUid()
-
- /**
- * Set the value of [op_action] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOpAction($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->op_action !== $v || $v === '0') {
- $this->op_action = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_ACTION;
- }
-
- } // setOpAction()
-
- /**
- * Set the value of [op_case_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOpCaseStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->op_case_status !== $v || $v === '0') {
- $this->op_case_status = $v;
- $this->modifiedColumns[] = ObjectPermissionPeer::OP_CASE_STATUS;
- }
-
- } // setOpCaseStatus()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->op_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->tas_uid = $rs->getString($startcol + 2);
-
- $this->usr_uid = $rs->getString($startcol + 3);
-
- $this->op_user_relation = $rs->getInt($startcol + 4);
-
- $this->op_task_source = $rs->getString($startcol + 5);
-
- $this->op_participate = $rs->getInt($startcol + 6);
-
- $this->op_obj_type = $rs->getString($startcol + 7);
-
- $this->op_obj_uid = $rs->getString($startcol + 8);
-
- $this->op_action = $rs->getString($startcol + 9);
-
- $this->op_case_status = $rs->getString($startcol + 10);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 11; // 11 = ObjectPermissionPeer::NUM_COLUMNS - ObjectPermissionPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating ObjectPermission object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ObjectPermissionPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ObjectPermissionPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ObjectPermissionPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ObjectPermissionPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ObjectPermissionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getOpUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getTasUid();
- break;
- case 3:
- return $this->getUsrUid();
- break;
- case 4:
- return $this->getOpUserRelation();
- break;
- case 5:
- return $this->getOpTaskSource();
- break;
- case 6:
- return $this->getOpParticipate();
- break;
- case 7:
- return $this->getOpObjType();
- break;
- case 8:
- return $this->getOpObjUid();
- break;
- case 9:
- return $this->getOpAction();
- break;
- case 10:
- return $this->getOpCaseStatus();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ObjectPermissionPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getOpUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getTasUid(),
- $keys[3] => $this->getUsrUid(),
- $keys[4] => $this->getOpUserRelation(),
- $keys[5] => $this->getOpTaskSource(),
- $keys[6] => $this->getOpParticipate(),
- $keys[7] => $this->getOpObjType(),
- $keys[8] => $this->getOpObjUid(),
- $keys[9] => $this->getOpAction(),
- $keys[10] => $this->getOpCaseStatus(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ObjectPermissionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setOpUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setTasUid($value);
- break;
- case 3:
- $this->setUsrUid($value);
- break;
- case 4:
- $this->setOpUserRelation($value);
- break;
- case 5:
- $this->setOpTaskSource($value);
- break;
- case 6:
- $this->setOpParticipate($value);
- break;
- case 7:
- $this->setOpObjType($value);
- break;
- case 8:
- $this->setOpObjUid($value);
- break;
- case 9:
- $this->setOpAction($value);
- break;
- case 10:
- $this->setOpCaseStatus($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ObjectPermissionPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setOpUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTasUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setUsrUid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setOpUserRelation($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setOpTaskSource($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setOpParticipate($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setOpObjType($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setOpObjUid($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setOpAction($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setOpCaseStatus($arr[$keys[10]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ObjectPermissionPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ObjectPermissionPeer::OP_UID)) $criteria->add(ObjectPermissionPeer::OP_UID, $this->op_uid);
- if ($this->isColumnModified(ObjectPermissionPeer::PRO_UID)) $criteria->add(ObjectPermissionPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(ObjectPermissionPeer::TAS_UID)) $criteria->add(ObjectPermissionPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(ObjectPermissionPeer::USR_UID)) $criteria->add(ObjectPermissionPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(ObjectPermissionPeer::OP_USER_RELATION)) $criteria->add(ObjectPermissionPeer::OP_USER_RELATION, $this->op_user_relation);
- if ($this->isColumnModified(ObjectPermissionPeer::OP_TASK_SOURCE)) $criteria->add(ObjectPermissionPeer::OP_TASK_SOURCE, $this->op_task_source);
- if ($this->isColumnModified(ObjectPermissionPeer::OP_PARTICIPATE)) $criteria->add(ObjectPermissionPeer::OP_PARTICIPATE, $this->op_participate);
- if ($this->isColumnModified(ObjectPermissionPeer::OP_OBJ_TYPE)) $criteria->add(ObjectPermissionPeer::OP_OBJ_TYPE, $this->op_obj_type);
- if ($this->isColumnModified(ObjectPermissionPeer::OP_OBJ_UID)) $criteria->add(ObjectPermissionPeer::OP_OBJ_UID, $this->op_obj_uid);
- if ($this->isColumnModified(ObjectPermissionPeer::OP_ACTION)) $criteria->add(ObjectPermissionPeer::OP_ACTION, $this->op_action);
- if ($this->isColumnModified(ObjectPermissionPeer::OP_CASE_STATUS)) $criteria->add(ObjectPermissionPeer::OP_CASE_STATUS, $this->op_case_status);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ObjectPermissionPeer::DATABASE_NAME);
-
- $criteria->add(ObjectPermissionPeer::OP_UID, $this->op_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getOpUid();
- }
-
- /**
- * Generic method to set the primary key (op_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setOpUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of ObjectPermission (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setOpUserRelation($this->op_user_relation);
-
- $copyObj->setOpTaskSource($this->op_task_source);
-
- $copyObj->setOpParticipate($this->op_participate);
-
- $copyObj->setOpObjType($this->op_obj_type);
-
- $copyObj->setOpObjUid($this->op_obj_uid);
-
- $copyObj->setOpAction($this->op_action);
-
- $copyObj->setOpCaseStatus($this->op_case_status);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setOpUid('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return ObjectPermission Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ObjectPermissionPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ObjectPermissionPeer();
- }
- return self::$peer;
- }
-
-} // BaseObjectPermission
diff --git a/workflow/engine/classes/model/om/BaseObjectPermissionPeer.php b/workflow/engine/classes/model/om/BaseObjectPermissionPeer.php
index 5fbbb4d0a..cf20a6d07 100755
--- a/workflow/engine/classes/model/om/BaseObjectPermissionPeer.php
+++ b/workflow/engine/classes/model/om/BaseObjectPermissionPeer.php
@@ -12,634 +12,636 @@ include_once 'classes/model/ObjectPermission.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseObjectPermissionPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'OBJECT_PERMISSION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.ObjectPermission';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 11;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the OP_UID field */
- const OP_UID = 'OBJECT_PERMISSION.OP_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'OBJECT_PERMISSION.PRO_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'OBJECT_PERMISSION.TAS_UID';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'OBJECT_PERMISSION.USR_UID';
-
- /** the column name for the OP_USER_RELATION field */
- const OP_USER_RELATION = 'OBJECT_PERMISSION.OP_USER_RELATION';
-
- /** the column name for the OP_TASK_SOURCE field */
- const OP_TASK_SOURCE = 'OBJECT_PERMISSION.OP_TASK_SOURCE';
-
- /** the column name for the OP_PARTICIPATE field */
- const OP_PARTICIPATE = 'OBJECT_PERMISSION.OP_PARTICIPATE';
-
- /** the column name for the OP_OBJ_TYPE field */
- const OP_OBJ_TYPE = 'OBJECT_PERMISSION.OP_OBJ_TYPE';
-
- /** the column name for the OP_OBJ_UID field */
- const OP_OBJ_UID = 'OBJECT_PERMISSION.OP_OBJ_UID';
-
- /** the column name for the OP_ACTION field */
- const OP_ACTION = 'OBJECT_PERMISSION.OP_ACTION';
-
- /** the column name for the OP_CASE_STATUS field */
- const OP_CASE_STATUS = 'OBJECT_PERMISSION.OP_CASE_STATUS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('OpUid', 'ProUid', 'TasUid', 'UsrUid', 'OpUserRelation', 'OpTaskSource', 'OpParticipate', 'OpObjType', 'OpObjUid', 'OpAction', 'OpCaseStatus', ),
- BasePeer::TYPE_COLNAME => array (ObjectPermissionPeer::OP_UID, ObjectPermissionPeer::PRO_UID, ObjectPermissionPeer::TAS_UID, ObjectPermissionPeer::USR_UID, ObjectPermissionPeer::OP_USER_RELATION, ObjectPermissionPeer::OP_TASK_SOURCE, ObjectPermissionPeer::OP_PARTICIPATE, ObjectPermissionPeer::OP_OBJ_TYPE, ObjectPermissionPeer::OP_OBJ_UID, ObjectPermissionPeer::OP_ACTION, ObjectPermissionPeer::OP_CASE_STATUS, ),
- BasePeer::TYPE_FIELDNAME => array ('OP_UID', 'PRO_UID', 'TAS_UID', 'USR_UID', 'OP_USER_RELATION', 'OP_TASK_SOURCE', 'OP_PARTICIPATE', 'OP_OBJ_TYPE', 'OP_OBJ_UID', 'OP_ACTION', 'OP_CASE_STATUS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('OpUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'UsrUid' => 3, 'OpUserRelation' => 4, 'OpTaskSource' => 5, 'OpParticipate' => 6, 'OpObjType' => 7, 'OpObjUid' => 8, 'OpAction' => 9, 'OpCaseStatus' => 10, ),
- BasePeer::TYPE_COLNAME => array (ObjectPermissionPeer::OP_UID => 0, ObjectPermissionPeer::PRO_UID => 1, ObjectPermissionPeer::TAS_UID => 2, ObjectPermissionPeer::USR_UID => 3, ObjectPermissionPeer::OP_USER_RELATION => 4, ObjectPermissionPeer::OP_TASK_SOURCE => 5, ObjectPermissionPeer::OP_PARTICIPATE => 6, ObjectPermissionPeer::OP_OBJ_TYPE => 7, ObjectPermissionPeer::OP_OBJ_UID => 8, ObjectPermissionPeer::OP_ACTION => 9, ObjectPermissionPeer::OP_CASE_STATUS => 10, ),
- BasePeer::TYPE_FIELDNAME => array ('OP_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'USR_UID' => 3, 'OP_USER_RELATION' => 4, 'OP_TASK_SOURCE' => 5, 'OP_PARTICIPATE' => 6, 'OP_OBJ_TYPE' => 7, 'OP_OBJ_UID' => 8, 'OP_ACTION' => 9, 'OP_CASE_STATUS' => 10, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ObjectPermissionMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ObjectPermissionMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ObjectPermissionPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ObjectPermissionPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ObjectPermissionPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_UID);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::PRO_UID);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::TAS_UID);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::USR_UID);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_USER_RELATION);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_TASK_SOURCE);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_PARTICIPATE);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_OBJ_TYPE);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_OBJ_UID);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_ACTION);
-
- $criteria->addSelectColumn(ObjectPermissionPeer::OP_CASE_STATUS);
-
- }
-
- const COUNT = 'COUNT(OBJECT_PERMISSION.OP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT OBJECT_PERMISSION.OP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ObjectPermissionPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ObjectPermissionPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ObjectPermissionPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return ObjectPermission
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ObjectPermissionPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ObjectPermissionPeer::populateObjects(ObjectPermissionPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ObjectPermissionPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ObjectPermissionPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ObjectPermissionPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a ObjectPermission or Criteria object.
- *
- * @param mixed $values Criteria or ObjectPermission object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from ObjectPermission object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a ObjectPermission or Criteria object.
- *
- * @param mixed $values Criteria or ObjectPermission object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ObjectPermissionPeer::OP_UID);
- $selectCriteria->add(ObjectPermissionPeer::OP_UID, $criteria->remove(ObjectPermissionPeer::OP_UID), $comparison);
-
- } else { // $values is ObjectPermission object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the OBJECT_PERMISSION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ObjectPermissionPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a ObjectPermission or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ObjectPermission object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof ObjectPermission) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ObjectPermissionPeer::OP_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given ObjectPermission object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param ObjectPermission $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(ObjectPermission $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ObjectPermissionPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ObjectPermissionPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_UID))
- $columns[ObjectPermissionPeer::OP_UID] = $obj->getOpUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::PRO_UID))
- $columns[ObjectPermissionPeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::TAS_UID))
- $columns[ObjectPermissionPeer::TAS_UID] = $obj->getTasUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::USR_UID))
- $columns[ObjectPermissionPeer::USR_UID] = $obj->getUsrUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_USER_RELATION))
- $columns[ObjectPermissionPeer::OP_USER_RELATION] = $obj->getOpUserRelation();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_TASK_SOURCE))
- $columns[ObjectPermissionPeer::OP_TASK_SOURCE] = $obj->getOpTaskSource();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_PARTICIPATE))
- $columns[ObjectPermissionPeer::OP_PARTICIPATE] = $obj->getOpParticipate();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_TYPE))
- $columns[ObjectPermissionPeer::OP_OBJ_TYPE] = $obj->getOpObjType();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_UID))
- $columns[ObjectPermissionPeer::OP_OBJ_UID] = $obj->getOpObjUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_ACTION))
- $columns[ObjectPermissionPeer::OP_ACTION] = $obj->getOpAction();
-
- }
-
- return BasePeer::doValidate(ObjectPermissionPeer::DATABASE_NAME, ObjectPermissionPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return ObjectPermission
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ObjectPermissionPeer::DATABASE_NAME);
-
- $criteria->add(ObjectPermissionPeer::OP_UID, $pk);
-
-
- $v = ObjectPermissionPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ObjectPermissionPeer::OP_UID, $pks, Criteria::IN);
- $objs = ObjectPermissionPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseObjectPermissionPeer
+abstract class BaseObjectPermissionPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'OBJECT_PERMISSION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.ObjectPermission';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 11;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the OP_UID field */
+ const OP_UID = 'OBJECT_PERMISSION.OP_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'OBJECT_PERMISSION.PRO_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'OBJECT_PERMISSION.TAS_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'OBJECT_PERMISSION.USR_UID';
+
+ /** the column name for the OP_USER_RELATION field */
+ const OP_USER_RELATION = 'OBJECT_PERMISSION.OP_USER_RELATION';
+
+ /** the column name for the OP_TASK_SOURCE field */
+ const OP_TASK_SOURCE = 'OBJECT_PERMISSION.OP_TASK_SOURCE';
+
+ /** the column name for the OP_PARTICIPATE field */
+ const OP_PARTICIPATE = 'OBJECT_PERMISSION.OP_PARTICIPATE';
+
+ /** the column name for the OP_OBJ_TYPE field */
+ const OP_OBJ_TYPE = 'OBJECT_PERMISSION.OP_OBJ_TYPE';
+
+ /** the column name for the OP_OBJ_UID field */
+ const OP_OBJ_UID = 'OBJECT_PERMISSION.OP_OBJ_UID';
+
+ /** the column name for the OP_ACTION field */
+ const OP_ACTION = 'OBJECT_PERMISSION.OP_ACTION';
+
+ /** the column name for the OP_CASE_STATUS field */
+ const OP_CASE_STATUS = 'OBJECT_PERMISSION.OP_CASE_STATUS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('OpUid', 'ProUid', 'TasUid', 'UsrUid', 'OpUserRelation', 'OpTaskSource', 'OpParticipate', 'OpObjType', 'OpObjUid', 'OpAction', 'OpCaseStatus', ),
+ BasePeer::TYPE_COLNAME => array (ObjectPermissionPeer::OP_UID, ObjectPermissionPeer::PRO_UID, ObjectPermissionPeer::TAS_UID, ObjectPermissionPeer::USR_UID, ObjectPermissionPeer::OP_USER_RELATION, ObjectPermissionPeer::OP_TASK_SOURCE, ObjectPermissionPeer::OP_PARTICIPATE, ObjectPermissionPeer::OP_OBJ_TYPE, ObjectPermissionPeer::OP_OBJ_UID, ObjectPermissionPeer::OP_ACTION, ObjectPermissionPeer::OP_CASE_STATUS, ),
+ BasePeer::TYPE_FIELDNAME => array ('OP_UID', 'PRO_UID', 'TAS_UID', 'USR_UID', 'OP_USER_RELATION', 'OP_TASK_SOURCE', 'OP_PARTICIPATE', 'OP_OBJ_TYPE', 'OP_OBJ_UID', 'OP_ACTION', 'OP_CASE_STATUS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('OpUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'UsrUid' => 3, 'OpUserRelation' => 4, 'OpTaskSource' => 5, 'OpParticipate' => 6, 'OpObjType' => 7, 'OpObjUid' => 8, 'OpAction' => 9, 'OpCaseStatus' => 10, ),
+ BasePeer::TYPE_COLNAME => array (ObjectPermissionPeer::OP_UID => 0, ObjectPermissionPeer::PRO_UID => 1, ObjectPermissionPeer::TAS_UID => 2, ObjectPermissionPeer::USR_UID => 3, ObjectPermissionPeer::OP_USER_RELATION => 4, ObjectPermissionPeer::OP_TASK_SOURCE => 5, ObjectPermissionPeer::OP_PARTICIPATE => 6, ObjectPermissionPeer::OP_OBJ_TYPE => 7, ObjectPermissionPeer::OP_OBJ_UID => 8, ObjectPermissionPeer::OP_ACTION => 9, ObjectPermissionPeer::OP_CASE_STATUS => 10, ),
+ BasePeer::TYPE_FIELDNAME => array ('OP_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'USR_UID' => 3, 'OP_USER_RELATION' => 4, 'OP_TASK_SOURCE' => 5, 'OP_PARTICIPATE' => 6, 'OP_OBJ_TYPE' => 7, 'OP_OBJ_UID' => 8, 'OP_ACTION' => 9, 'OP_CASE_STATUS' => 10, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ObjectPermissionMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ObjectPermissionMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ObjectPermissionPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ObjectPermissionPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ObjectPermissionPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_UID);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::PRO_UID);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::TAS_UID);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::USR_UID);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_USER_RELATION);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_TASK_SOURCE);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_PARTICIPATE);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_OBJ_TYPE);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_OBJ_UID);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_ACTION);
+
+ $criteria->addSelectColumn(ObjectPermissionPeer::OP_CASE_STATUS);
+
+ }
+
+ const COUNT = 'COUNT(OBJECT_PERMISSION.OP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT OBJECT_PERMISSION.OP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ObjectPermissionPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ObjectPermissionPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ObjectPermissionPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return ObjectPermission
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ObjectPermissionPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ObjectPermissionPeer::populateObjects(ObjectPermissionPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ObjectPermissionPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ObjectPermissionPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ObjectPermissionPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a ObjectPermission or Criteria object.
+ *
+ * @param mixed $values Criteria or ObjectPermission object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from ObjectPermission object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a ObjectPermission or Criteria object.
+ *
+ * @param mixed $values Criteria or ObjectPermission object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ObjectPermissionPeer::OP_UID);
+ $selectCriteria->add(ObjectPermissionPeer::OP_UID, $criteria->remove(ObjectPermissionPeer::OP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the OBJECT_PERMISSION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ObjectPermissionPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a ObjectPermission or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ObjectPermission object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof ObjectPermission) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ObjectPermissionPeer::OP_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given ObjectPermission object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param ObjectPermission $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(ObjectPermission $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ObjectPermissionPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ObjectPermissionPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_UID))
+ $columns[ObjectPermissionPeer::OP_UID] = $obj->getOpUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::PRO_UID))
+ $columns[ObjectPermissionPeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::TAS_UID))
+ $columns[ObjectPermissionPeer::TAS_UID] = $obj->getTasUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::USR_UID))
+ $columns[ObjectPermissionPeer::USR_UID] = $obj->getUsrUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_USER_RELATION))
+ $columns[ObjectPermissionPeer::OP_USER_RELATION] = $obj->getOpUserRelation();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_TASK_SOURCE))
+ $columns[ObjectPermissionPeer::OP_TASK_SOURCE] = $obj->getOpTaskSource();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_PARTICIPATE))
+ $columns[ObjectPermissionPeer::OP_PARTICIPATE] = $obj->getOpParticipate();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_TYPE))
+ $columns[ObjectPermissionPeer::OP_OBJ_TYPE] = $obj->getOpObjType();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_UID))
+ $columns[ObjectPermissionPeer::OP_OBJ_UID] = $obj->getOpObjUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_ACTION))
+ $columns[ObjectPermissionPeer::OP_ACTION] = $obj->getOpAction();
+
+ }
+
+ return BasePeer::doValidate(ObjectPermissionPeer::DATABASE_NAME, ObjectPermissionPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return ObjectPermission
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ObjectPermissionPeer::DATABASE_NAME);
+
+ $criteria->add(ObjectPermissionPeer::OP_UID, $pk);
+
+
+ $v = ObjectPermissionPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ObjectPermissionPeer::OP_UID, $pks, Criteria::IN);
+ $objs = ObjectPermissionPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseObjectPermissionPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseObjectPermissionPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ObjectPermissionMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ObjectPermissionMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ObjectPermissionMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ObjectPermissionMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseOutputDocument.php b/workflow/engine/classes/model/om/BaseOutputDocument.php
index 3d48c3b10..eb5e272eb 100755
--- a/workflow/engine/classes/model/om/BaseOutputDocument.php
+++ b/workflow/engine/classes/model/om/BaseOutputDocument.php
@@ -16,1443 +16,1539 @@ include_once 'classes/model/OutputDocumentPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseOutputDocument extends BaseObject implements Persistent {
+abstract class BaseOutputDocument extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var OutputDocumentPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the out_doc_uid field.
+ * @var string
+ */
+ protected $out_doc_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the out_doc_landscape field.
+ * @var int
+ */
+ protected $out_doc_landscape = 0;
+
+ /**
+ * The value for the out_doc_media field.
+ * @var string
+ */
+ protected $out_doc_media = 'Letter';
+
+ /**
+ * The value for the out_doc_left_margin field.
+ * @var int
+ */
+ protected $out_doc_left_margin = 30;
+
+ /**
+ * The value for the out_doc_right_margin field.
+ * @var int
+ */
+ protected $out_doc_right_margin = 15;
+
+ /**
+ * The value for the out_doc_top_margin field.
+ * @var int
+ */
+ protected $out_doc_top_margin = 15;
+
+ /**
+ * The value for the out_doc_bottom_margin field.
+ * @var int
+ */
+ protected $out_doc_bottom_margin = 15;
+
+ /**
+ * The value for the out_doc_generate field.
+ * @var string
+ */
+ protected $out_doc_generate = 'BOTH';
+
+ /**
+ * The value for the out_doc_type field.
+ * @var string
+ */
+ protected $out_doc_type = 'HTML';
+
+ /**
+ * The value for the out_doc_current_revision field.
+ * @var int
+ */
+ protected $out_doc_current_revision = 0;
+
+ /**
+ * The value for the out_doc_field_mapping field.
+ * @var string
+ */
+ protected $out_doc_field_mapping;
+
+ /**
+ * The value for the out_doc_versioning field.
+ * @var int
+ */
+ protected $out_doc_versioning = 0;
+
+ /**
+ * The value for the out_doc_destination_path field.
+ * @var string
+ */
+ protected $out_doc_destination_path;
+
+ /**
+ * The value for the out_doc_tags field.
+ * @var string
+ */
+ protected $out_doc_tags;
+
+ /**
+ * The value for the out_doc_pdf_security_enabled field.
+ * @var int
+ */
+ protected $out_doc_pdf_security_enabled = 0;
+
+ /**
+ * The value for the out_doc_pdf_security_open_password field.
+ * @var string
+ */
+ protected $out_doc_pdf_security_open_password = '';
+
+ /**
+ * The value for the out_doc_pdf_security_owner_password field.
+ * @var string
+ */
+ protected $out_doc_pdf_security_owner_password = '';
+
+ /**
+ * The value for the out_doc_pdf_security_permissions field.
+ * @var string
+ */
+ protected $out_doc_pdf_security_permissions = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [out_doc_uid] column value.
+ *
+ * @return string
+ */
+ public function getOutDocUid()
+ {
+
+ return $this->out_doc_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [out_doc_landscape] column value.
+ *
+ * @return int
+ */
+ public function getOutDocLandscape()
+ {
+
+ return $this->out_doc_landscape;
+ }
+
+ /**
+ * Get the [out_doc_media] column value.
+ *
+ * @return string
+ */
+ public function getOutDocMedia()
+ {
+
+ return $this->out_doc_media;
+ }
+
+ /**
+ * Get the [out_doc_left_margin] column value.
+ *
+ * @return int
+ */
+ public function getOutDocLeftMargin()
+ {
+
+ return $this->out_doc_left_margin;
+ }
+
+ /**
+ * Get the [out_doc_right_margin] column value.
+ *
+ * @return int
+ */
+ public function getOutDocRightMargin()
+ {
+
+ return $this->out_doc_right_margin;
+ }
+
+ /**
+ * Get the [out_doc_top_margin] column value.
+ *
+ * @return int
+ */
+ public function getOutDocTopMargin()
+ {
+
+ return $this->out_doc_top_margin;
+ }
+
+ /**
+ * Get the [out_doc_bottom_margin] column value.
+ *
+ * @return int
+ */
+ public function getOutDocBottomMargin()
+ {
+
+ return $this->out_doc_bottom_margin;
+ }
+
+ /**
+ * Get the [out_doc_generate] column value.
+ *
+ * @return string
+ */
+ public function getOutDocGenerate()
+ {
+
+ return $this->out_doc_generate;
+ }
+
+ /**
+ * Get the [out_doc_type] column value.
+ *
+ * @return string
+ */
+ public function getOutDocType()
+ {
+
+ return $this->out_doc_type;
+ }
+
+ /**
+ * Get the [out_doc_current_revision] column value.
+ *
+ * @return int
+ */
+ public function getOutDocCurrentRevision()
+ {
+
+ return $this->out_doc_current_revision;
+ }
+
+ /**
+ * Get the [out_doc_field_mapping] column value.
+ *
+ * @return string
+ */
+ public function getOutDocFieldMapping()
+ {
+
+ return $this->out_doc_field_mapping;
+ }
+
+ /**
+ * Get the [out_doc_versioning] column value.
+ *
+ * @return int
+ */
+ public function getOutDocVersioning()
+ {
+
+ return $this->out_doc_versioning;
+ }
+
+ /**
+ * Get the [out_doc_destination_path] column value.
+ *
+ * @return string
+ */
+ public function getOutDocDestinationPath()
+ {
+
+ return $this->out_doc_destination_path;
+ }
+
+ /**
+ * Get the [out_doc_tags] column value.
+ *
+ * @return string
+ */
+ public function getOutDocTags()
+ {
+
+ return $this->out_doc_tags;
+ }
+
+ /**
+ * Get the [out_doc_pdf_security_enabled] column value.
+ *
+ * @return int
+ */
+ public function getOutDocPdfSecurityEnabled()
+ {
+
+ return $this->out_doc_pdf_security_enabled;
+ }
+
+ /**
+ * Get the [out_doc_pdf_security_open_password] column value.
+ *
+ * @return string
+ */
+ public function getOutDocPdfSecurityOpenPassword()
+ {
+
+ return $this->out_doc_pdf_security_open_password;
+ }
+
+ /**
+ * Get the [out_doc_pdf_security_owner_password] column value.
+ *
+ * @return string
+ */
+ public function getOutDocPdfSecurityOwnerPassword()
+ {
+
+ return $this->out_doc_pdf_security_owner_password;
+ }
+
+ /**
+ * Get the [out_doc_pdf_security_permissions] column value.
+ *
+ * @return string
+ */
+ public function getOutDocPdfSecurityPermissions()
+ {
+
+ return $this->out_doc_pdf_security_permissions;
+ }
+
+ /**
+ * Set the value of [out_doc_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_uid !== $v || $v === '') {
+ $this->out_doc_uid = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_UID;
+ }
+
+ } // setOutDocUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [out_doc_landscape] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocLandscape($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->out_doc_landscape !== $v || $v === 0) {
+ $this->out_doc_landscape = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_LANDSCAPE;
+ }
+
+ } // setOutDocLandscape()
+
+ /**
+ * Set the value of [out_doc_media] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocMedia($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_media !== $v || $v === 'Letter') {
+ $this->out_doc_media = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_MEDIA;
+ }
+
+ } // setOutDocMedia()
+
+ /**
+ * Set the value of [out_doc_left_margin] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocLeftMargin($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->out_doc_left_margin !== $v || $v === 30) {
+ $this->out_doc_left_margin = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_LEFT_MARGIN;
+ }
+
+ } // setOutDocLeftMargin()
+
+ /**
+ * Set the value of [out_doc_right_margin] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocRightMargin($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->out_doc_right_margin !== $v || $v === 15) {
+ $this->out_doc_right_margin = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN;
+ }
+
+ } // setOutDocRightMargin()
+
+ /**
+ * Set the value of [out_doc_top_margin] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocTopMargin($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->out_doc_top_margin !== $v || $v === 15) {
+ $this->out_doc_top_margin = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_TOP_MARGIN;
+ }
+
+ } // setOutDocTopMargin()
+
+ /**
+ * Set the value of [out_doc_bottom_margin] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocBottomMargin($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->out_doc_bottom_margin !== $v || $v === 15) {
+ $this->out_doc_bottom_margin = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN;
+ }
+
+ } // setOutDocBottomMargin()
+
+ /**
+ * Set the value of [out_doc_generate] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocGenerate($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_generate !== $v || $v === 'BOTH') {
+ $this->out_doc_generate = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_GENERATE;
+ }
+
+ } // setOutDocGenerate()
+
+ /**
+ * Set the value of [out_doc_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_type !== $v || $v === 'HTML') {
+ $this->out_doc_type = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_TYPE;
+ }
+
+ } // setOutDocType()
+
+ /**
+ * Set the value of [out_doc_current_revision] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocCurrentRevision($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->out_doc_current_revision !== $v || $v === 0) {
+ $this->out_doc_current_revision = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_CURRENT_REVISION;
+ }
+
+ } // setOutDocCurrentRevision()
+
+ /**
+ * Set the value of [out_doc_field_mapping] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocFieldMapping($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_field_mapping !== $v) {
+ $this->out_doc_field_mapping = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_FIELD_MAPPING;
+ }
+
+ } // setOutDocFieldMapping()
+
+ /**
+ * Set the value of [out_doc_versioning] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocVersioning($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->out_doc_versioning !== $v || $v === 0) {
+ $this->out_doc_versioning = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_VERSIONING;
+ }
+
+ } // setOutDocVersioning()
+
+ /**
+ * Set the value of [out_doc_destination_path] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocDestinationPath($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_destination_path !== $v) {
+ $this->out_doc_destination_path = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_DESTINATION_PATH;
+ }
+
+ } // setOutDocDestinationPath()
+
+ /**
+ * Set the value of [out_doc_tags] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocTags($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_tags !== $v) {
+ $this->out_doc_tags = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_TAGS;
+ }
+
+ } // setOutDocTags()
+
+ /**
+ * Set the value of [out_doc_pdf_security_enabled] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setOutDocPdfSecurityEnabled($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->out_doc_pdf_security_enabled !== $v || $v === 0) {
+ $this->out_doc_pdf_security_enabled = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED;
+ }
+
+ } // setOutDocPdfSecurityEnabled()
+
+ /**
+ * Set the value of [out_doc_pdf_security_open_password] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocPdfSecurityOpenPassword($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_pdf_security_open_password !== $v || $v === '') {
+ $this->out_doc_pdf_security_open_password = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD;
+ }
+
+ } // setOutDocPdfSecurityOpenPassword()
+
+ /**
+ * Set the value of [out_doc_pdf_security_owner_password] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocPdfSecurityOwnerPassword($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_pdf_security_owner_password !== $v || $v === '') {
+ $this->out_doc_pdf_security_owner_password = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD;
+ }
+
+ } // setOutDocPdfSecurityOwnerPassword()
+
+ /**
+ * Set the value of [out_doc_pdf_security_permissions] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOutDocPdfSecurityPermissions($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->out_doc_pdf_security_permissions !== $v || $v === '') {
+ $this->out_doc_pdf_security_permissions = $v;
+ $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS;
+ }
+
+ } // setOutDocPdfSecurityPermissions()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->out_doc_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->out_doc_landscape = $rs->getInt($startcol + 2);
+
+ $this->out_doc_media = $rs->getString($startcol + 3);
+
+ $this->out_doc_left_margin = $rs->getInt($startcol + 4);
+
+ $this->out_doc_right_margin = $rs->getInt($startcol + 5);
+
+ $this->out_doc_top_margin = $rs->getInt($startcol + 6);
+
+ $this->out_doc_bottom_margin = $rs->getInt($startcol + 7);
+
+ $this->out_doc_generate = $rs->getString($startcol + 8);
+
+ $this->out_doc_type = $rs->getString($startcol + 9);
+
+ $this->out_doc_current_revision = $rs->getInt($startcol + 10);
+
+ $this->out_doc_field_mapping = $rs->getString($startcol + 11);
+
+ $this->out_doc_versioning = $rs->getInt($startcol + 12);
+
+ $this->out_doc_destination_path = $rs->getString($startcol + 13);
+
+ $this->out_doc_tags = $rs->getString($startcol + 14);
+
+ $this->out_doc_pdf_security_enabled = $rs->getInt($startcol + 15);
+
+ $this->out_doc_pdf_security_open_password = $rs->getString($startcol + 16);
+
+ $this->out_doc_pdf_security_owner_password = $rs->getString($startcol + 17);
+
+ $this->out_doc_pdf_security_permissions = $rs->getString($startcol + 18);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 19; // 19 = OutputDocumentPeer::NUM_COLUMNS - OutputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating OutputDocument object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ OutputDocumentPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = OutputDocumentPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += OutputDocumentPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = OutputDocumentPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = OutputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getOutDocUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getOutDocLandscape();
+ break;
+ case 3:
+ return $this->getOutDocMedia();
+ break;
+ case 4:
+ return $this->getOutDocLeftMargin();
+ break;
+ case 5:
+ return $this->getOutDocRightMargin();
+ break;
+ case 6:
+ return $this->getOutDocTopMargin();
+ break;
+ case 7:
+ return $this->getOutDocBottomMargin();
+ break;
+ case 8:
+ return $this->getOutDocGenerate();
+ break;
+ case 9:
+ return $this->getOutDocType();
+ break;
+ case 10:
+ return $this->getOutDocCurrentRevision();
+ break;
+ case 11:
+ return $this->getOutDocFieldMapping();
+ break;
+ case 12:
+ return $this->getOutDocVersioning();
+ break;
+ case 13:
+ return $this->getOutDocDestinationPath();
+ break;
+ case 14:
+ return $this->getOutDocTags();
+ break;
+ case 15:
+ return $this->getOutDocPdfSecurityEnabled();
+ break;
+ case 16:
+ return $this->getOutDocPdfSecurityOpenPassword();
+ break;
+ case 17:
+ return $this->getOutDocPdfSecurityOwnerPassword();
+ break;
+ case 18:
+ return $this->getOutDocPdfSecurityPermissions();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = OutputDocumentPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getOutDocUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getOutDocLandscape(),
+ $keys[3] => $this->getOutDocMedia(),
+ $keys[4] => $this->getOutDocLeftMargin(),
+ $keys[5] => $this->getOutDocRightMargin(),
+ $keys[6] => $this->getOutDocTopMargin(),
+ $keys[7] => $this->getOutDocBottomMargin(),
+ $keys[8] => $this->getOutDocGenerate(),
+ $keys[9] => $this->getOutDocType(),
+ $keys[10] => $this->getOutDocCurrentRevision(),
+ $keys[11] => $this->getOutDocFieldMapping(),
+ $keys[12] => $this->getOutDocVersioning(),
+ $keys[13] => $this->getOutDocDestinationPath(),
+ $keys[14] => $this->getOutDocTags(),
+ $keys[15] => $this->getOutDocPdfSecurityEnabled(),
+ $keys[16] => $this->getOutDocPdfSecurityOpenPassword(),
+ $keys[17] => $this->getOutDocPdfSecurityOwnerPassword(),
+ $keys[18] => $this->getOutDocPdfSecurityPermissions(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = OutputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setOutDocUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setOutDocLandscape($value);
+ break;
+ case 3:
+ $this->setOutDocMedia($value);
+ break;
+ case 4:
+ $this->setOutDocLeftMargin($value);
+ break;
+ case 5:
+ $this->setOutDocRightMargin($value);
+ break;
+ case 6:
+ $this->setOutDocTopMargin($value);
+ break;
+ case 7:
+ $this->setOutDocBottomMargin($value);
+ break;
+ case 8:
+ $this->setOutDocGenerate($value);
+ break;
+ case 9:
+ $this->setOutDocType($value);
+ break;
+ case 10:
+ $this->setOutDocCurrentRevision($value);
+ break;
+ case 11:
+ $this->setOutDocFieldMapping($value);
+ break;
+ case 12:
+ $this->setOutDocVersioning($value);
+ break;
+ case 13:
+ $this->setOutDocDestinationPath($value);
+ break;
+ case 14:
+ $this->setOutDocTags($value);
+ break;
+ case 15:
+ $this->setOutDocPdfSecurityEnabled($value);
+ break;
+ case 16:
+ $this->setOutDocPdfSecurityOpenPassword($value);
+ break;
+ case 17:
+ $this->setOutDocPdfSecurityOwnerPassword($value);
+ break;
+ case 18:
+ $this->setOutDocPdfSecurityPermissions($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = OutputDocumentPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setOutDocUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setOutDocLandscape($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setOutDocMedia($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setOutDocLeftMargin($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setOutDocRightMargin($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setOutDocTopMargin($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setOutDocBottomMargin($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setOutDocGenerate($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setOutDocType($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setOutDocCurrentRevision($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setOutDocFieldMapping($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setOutDocVersioning($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setOutDocDestinationPath($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setOutDocTags($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setOutDocPdfSecurityEnabled($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setOutDocPdfSecurityOpenPassword($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setOutDocPdfSecurityOwnerPassword($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setOutDocPdfSecurityPermissions($arr[$keys[18]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(OutputDocumentPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_UID)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $this->out_doc_uid);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::PRO_UID)) {
+ $criteria->add(OutputDocumentPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_LANDSCAPE)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_LANDSCAPE, $this->out_doc_landscape);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_MEDIA)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_MEDIA, $this->out_doc_media);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_LEFT_MARGIN)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, $this->out_doc_left_margin);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, $this->out_doc_right_margin);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_TOP_MARGIN)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_TOP_MARGIN, $this->out_doc_top_margin);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, $this->out_doc_bottom_margin);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_GENERATE)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_GENERATE, $this->out_doc_generate);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_TYPE)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_TYPE, $this->out_doc_type);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_CURRENT_REVISION)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, $this->out_doc_current_revision);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_FIELD_MAPPING)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, $this->out_doc_field_mapping);
+ }
+
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_VERSIONING)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_VERSIONING, $this->out_doc_versioning);
+ }
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, $this->out_doc_destination_path);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var OutputDocumentPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_TAGS)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_TAGS, $this->out_doc_tags);
+ }
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, $this->out_doc_pdf_security_enabled);
+ }
- /**
- * The value for the out_doc_uid field.
- * @var string
- */
- protected $out_doc_uid = '';
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, $this->out_doc_pdf_security_open_password);
+ }
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, $this->out_doc_pdf_security_owner_password);
+ }
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS)) {
+ $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, $this->out_doc_pdf_security_permissions);
+ }
- /**
- * The value for the out_doc_landscape field.
- * @var int
- */
- protected $out_doc_landscape = 0;
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(OutputDocumentPeer::DATABASE_NAME);
- /**
- * The value for the out_doc_media field.
- * @var string
- */
- protected $out_doc_media = 'Letter';
+ $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $this->out_doc_uid);
+ return $criteria;
+ }
- /**
- * The value for the out_doc_left_margin field.
- * @var int
- */
- protected $out_doc_left_margin = 30;
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getOutDocUid();
+ }
+
+ /**
+ * Generic method to set the primary key (out_doc_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setOutDocUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of OutputDocument (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setOutDocLandscape($this->out_doc_landscape);
+
+ $copyObj->setOutDocMedia($this->out_doc_media);
+
+ $copyObj->setOutDocLeftMargin($this->out_doc_left_margin);
+
+ $copyObj->setOutDocRightMargin($this->out_doc_right_margin);
+
+ $copyObj->setOutDocTopMargin($this->out_doc_top_margin);
+
+ $copyObj->setOutDocBottomMargin($this->out_doc_bottom_margin);
+
+ $copyObj->setOutDocGenerate($this->out_doc_generate);
+
+ $copyObj->setOutDocType($this->out_doc_type);
+
+ $copyObj->setOutDocCurrentRevision($this->out_doc_current_revision);
+
+ $copyObj->setOutDocFieldMapping($this->out_doc_field_mapping);
+
+ $copyObj->setOutDocVersioning($this->out_doc_versioning);
+
+ $copyObj->setOutDocDestinationPath($this->out_doc_destination_path);
+
+ $copyObj->setOutDocTags($this->out_doc_tags);
+
+ $copyObj->setOutDocPdfSecurityEnabled($this->out_doc_pdf_security_enabled);
+
+ $copyObj->setOutDocPdfSecurityOpenPassword($this->out_doc_pdf_security_open_password);
+
+ $copyObj->setOutDocPdfSecurityOwnerPassword($this->out_doc_pdf_security_owner_password);
+
+ $copyObj->setOutDocPdfSecurityPermissions($this->out_doc_pdf_security_permissions);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setOutDocUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return OutputDocument Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return OutputDocumentPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new OutputDocumentPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The value for the out_doc_right_margin field.
- * @var int
- */
- protected $out_doc_right_margin = 15;
-
-
- /**
- * The value for the out_doc_top_margin field.
- * @var int
- */
- protected $out_doc_top_margin = 15;
-
-
- /**
- * The value for the out_doc_bottom_margin field.
- * @var int
- */
- protected $out_doc_bottom_margin = 15;
-
-
- /**
- * The value for the out_doc_generate field.
- * @var string
- */
- protected $out_doc_generate = 'BOTH';
-
-
- /**
- * The value for the out_doc_type field.
- * @var string
- */
- protected $out_doc_type = 'HTML';
-
-
- /**
- * The value for the out_doc_current_revision field.
- * @var int
- */
- protected $out_doc_current_revision = 0;
-
-
- /**
- * The value for the out_doc_field_mapping field.
- * @var string
- */
- protected $out_doc_field_mapping;
-
-
- /**
- * The value for the out_doc_versioning field.
- * @var int
- */
- protected $out_doc_versioning = 0;
-
-
- /**
- * The value for the out_doc_destination_path field.
- * @var string
- */
- protected $out_doc_destination_path;
-
-
- /**
- * The value for the out_doc_tags field.
- * @var string
- */
- protected $out_doc_tags;
-
-
- /**
- * The value for the out_doc_pdf_security_enabled field.
- * @var int
- */
- protected $out_doc_pdf_security_enabled = 0;
-
-
- /**
- * The value for the out_doc_pdf_security_open_password field.
- * @var string
- */
- protected $out_doc_pdf_security_open_password = '';
-
-
- /**
- * The value for the out_doc_pdf_security_owner_password field.
- * @var string
- */
- protected $out_doc_pdf_security_owner_password = '';
-
-
- /**
- * The value for the out_doc_pdf_security_permissions field.
- * @var string
- */
- protected $out_doc_pdf_security_permissions = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [out_doc_uid] column value.
- *
- * @return string
- */
- public function getOutDocUid()
- {
-
- return $this->out_doc_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [out_doc_landscape] column value.
- *
- * @return int
- */
- public function getOutDocLandscape()
- {
-
- return $this->out_doc_landscape;
- }
-
- /**
- * Get the [out_doc_media] column value.
- *
- * @return string
- */
- public function getOutDocMedia()
- {
-
- return $this->out_doc_media;
- }
-
- /**
- * Get the [out_doc_left_margin] column value.
- *
- * @return int
- */
- public function getOutDocLeftMargin()
- {
-
- return $this->out_doc_left_margin;
- }
-
- /**
- * Get the [out_doc_right_margin] column value.
- *
- * @return int
- */
- public function getOutDocRightMargin()
- {
-
- return $this->out_doc_right_margin;
- }
-
- /**
- * Get the [out_doc_top_margin] column value.
- *
- * @return int
- */
- public function getOutDocTopMargin()
- {
-
- return $this->out_doc_top_margin;
- }
-
- /**
- * Get the [out_doc_bottom_margin] column value.
- *
- * @return int
- */
- public function getOutDocBottomMargin()
- {
-
- return $this->out_doc_bottom_margin;
- }
-
- /**
- * Get the [out_doc_generate] column value.
- *
- * @return string
- */
- public function getOutDocGenerate()
- {
-
- return $this->out_doc_generate;
- }
-
- /**
- * Get the [out_doc_type] column value.
- *
- * @return string
- */
- public function getOutDocType()
- {
-
- return $this->out_doc_type;
- }
-
- /**
- * Get the [out_doc_current_revision] column value.
- *
- * @return int
- */
- public function getOutDocCurrentRevision()
- {
-
- return $this->out_doc_current_revision;
- }
-
- /**
- * Get the [out_doc_field_mapping] column value.
- *
- * @return string
- */
- public function getOutDocFieldMapping()
- {
-
- return $this->out_doc_field_mapping;
- }
-
- /**
- * Get the [out_doc_versioning] column value.
- *
- * @return int
- */
- public function getOutDocVersioning()
- {
-
- return $this->out_doc_versioning;
- }
-
- /**
- * Get the [out_doc_destination_path] column value.
- *
- * @return string
- */
- public function getOutDocDestinationPath()
- {
-
- return $this->out_doc_destination_path;
- }
-
- /**
- * Get the [out_doc_tags] column value.
- *
- * @return string
- */
- public function getOutDocTags()
- {
-
- return $this->out_doc_tags;
- }
-
- /**
- * Get the [out_doc_pdf_security_enabled] column value.
- *
- * @return int
- */
- public function getOutDocPdfSecurityEnabled()
- {
-
- return $this->out_doc_pdf_security_enabled;
- }
-
- /**
- * Get the [out_doc_pdf_security_open_password] column value.
- *
- * @return string
- */
- public function getOutDocPdfSecurityOpenPassword()
- {
-
- return $this->out_doc_pdf_security_open_password;
- }
-
- /**
- * Get the [out_doc_pdf_security_owner_password] column value.
- *
- * @return string
- */
- public function getOutDocPdfSecurityOwnerPassword()
- {
-
- return $this->out_doc_pdf_security_owner_password;
- }
-
- /**
- * Get the [out_doc_pdf_security_permissions] column value.
- *
- * @return string
- */
- public function getOutDocPdfSecurityPermissions()
- {
-
- return $this->out_doc_pdf_security_permissions;
- }
-
- /**
- * Set the value of [out_doc_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_uid !== $v || $v === '') {
- $this->out_doc_uid = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_UID;
- }
-
- } // setOutDocUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [out_doc_landscape] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocLandscape($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->out_doc_landscape !== $v || $v === 0) {
- $this->out_doc_landscape = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_LANDSCAPE;
- }
-
- } // setOutDocLandscape()
-
- /**
- * Set the value of [out_doc_media] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocMedia($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_media !== $v || $v === 'Letter') {
- $this->out_doc_media = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_MEDIA;
- }
-
- } // setOutDocMedia()
-
- /**
- * Set the value of [out_doc_left_margin] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocLeftMargin($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->out_doc_left_margin !== $v || $v === 30) {
- $this->out_doc_left_margin = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_LEFT_MARGIN;
- }
-
- } // setOutDocLeftMargin()
-
- /**
- * Set the value of [out_doc_right_margin] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocRightMargin($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->out_doc_right_margin !== $v || $v === 15) {
- $this->out_doc_right_margin = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN;
- }
-
- } // setOutDocRightMargin()
-
- /**
- * Set the value of [out_doc_top_margin] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocTopMargin($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->out_doc_top_margin !== $v || $v === 15) {
- $this->out_doc_top_margin = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_TOP_MARGIN;
- }
-
- } // setOutDocTopMargin()
-
- /**
- * Set the value of [out_doc_bottom_margin] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocBottomMargin($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->out_doc_bottom_margin !== $v || $v === 15) {
- $this->out_doc_bottom_margin = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN;
- }
-
- } // setOutDocBottomMargin()
-
- /**
- * Set the value of [out_doc_generate] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocGenerate($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_generate !== $v || $v === 'BOTH') {
- $this->out_doc_generate = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_GENERATE;
- }
-
- } // setOutDocGenerate()
-
- /**
- * Set the value of [out_doc_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_type !== $v || $v === 'HTML') {
- $this->out_doc_type = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_TYPE;
- }
-
- } // setOutDocType()
-
- /**
- * Set the value of [out_doc_current_revision] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocCurrentRevision($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->out_doc_current_revision !== $v || $v === 0) {
- $this->out_doc_current_revision = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_CURRENT_REVISION;
- }
-
- } // setOutDocCurrentRevision()
-
- /**
- * Set the value of [out_doc_field_mapping] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocFieldMapping($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_field_mapping !== $v) {
- $this->out_doc_field_mapping = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_FIELD_MAPPING;
- }
-
- } // setOutDocFieldMapping()
-
- /**
- * Set the value of [out_doc_versioning] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocVersioning($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->out_doc_versioning !== $v || $v === 0) {
- $this->out_doc_versioning = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_VERSIONING;
- }
-
- } // setOutDocVersioning()
-
- /**
- * Set the value of [out_doc_destination_path] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocDestinationPath($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_destination_path !== $v) {
- $this->out_doc_destination_path = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_DESTINATION_PATH;
- }
-
- } // setOutDocDestinationPath()
-
- /**
- * Set the value of [out_doc_tags] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocTags($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_tags !== $v) {
- $this->out_doc_tags = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_TAGS;
- }
-
- } // setOutDocTags()
-
- /**
- * Set the value of [out_doc_pdf_security_enabled] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setOutDocPdfSecurityEnabled($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->out_doc_pdf_security_enabled !== $v || $v === 0) {
- $this->out_doc_pdf_security_enabled = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED;
- }
-
- } // setOutDocPdfSecurityEnabled()
-
- /**
- * Set the value of [out_doc_pdf_security_open_password] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocPdfSecurityOpenPassword($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_pdf_security_open_password !== $v || $v === '') {
- $this->out_doc_pdf_security_open_password = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD;
- }
-
- } // setOutDocPdfSecurityOpenPassword()
-
- /**
- * Set the value of [out_doc_pdf_security_owner_password] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocPdfSecurityOwnerPassword($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_pdf_security_owner_password !== $v || $v === '') {
- $this->out_doc_pdf_security_owner_password = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD;
- }
-
- } // setOutDocPdfSecurityOwnerPassword()
-
- /**
- * Set the value of [out_doc_pdf_security_permissions] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOutDocPdfSecurityPermissions($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->out_doc_pdf_security_permissions !== $v || $v === '') {
- $this->out_doc_pdf_security_permissions = $v;
- $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS;
- }
-
- } // setOutDocPdfSecurityPermissions()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->out_doc_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->out_doc_landscape = $rs->getInt($startcol + 2);
-
- $this->out_doc_media = $rs->getString($startcol + 3);
-
- $this->out_doc_left_margin = $rs->getInt($startcol + 4);
-
- $this->out_doc_right_margin = $rs->getInt($startcol + 5);
-
- $this->out_doc_top_margin = $rs->getInt($startcol + 6);
-
- $this->out_doc_bottom_margin = $rs->getInt($startcol + 7);
-
- $this->out_doc_generate = $rs->getString($startcol + 8);
-
- $this->out_doc_type = $rs->getString($startcol + 9);
-
- $this->out_doc_current_revision = $rs->getInt($startcol + 10);
-
- $this->out_doc_field_mapping = $rs->getString($startcol + 11);
-
- $this->out_doc_versioning = $rs->getInt($startcol + 12);
-
- $this->out_doc_destination_path = $rs->getString($startcol + 13);
-
- $this->out_doc_tags = $rs->getString($startcol + 14);
-
- $this->out_doc_pdf_security_enabled = $rs->getInt($startcol + 15);
-
- $this->out_doc_pdf_security_open_password = $rs->getString($startcol + 16);
-
- $this->out_doc_pdf_security_owner_password = $rs->getString($startcol + 17);
-
- $this->out_doc_pdf_security_permissions = $rs->getString($startcol + 18);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 19; // 19 = OutputDocumentPeer::NUM_COLUMNS - OutputDocumentPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating OutputDocument object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- OutputDocumentPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = OutputDocumentPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += OutputDocumentPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = OutputDocumentPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = OutputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getOutDocUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getOutDocLandscape();
- break;
- case 3:
- return $this->getOutDocMedia();
- break;
- case 4:
- return $this->getOutDocLeftMargin();
- break;
- case 5:
- return $this->getOutDocRightMargin();
- break;
- case 6:
- return $this->getOutDocTopMargin();
- break;
- case 7:
- return $this->getOutDocBottomMargin();
- break;
- case 8:
- return $this->getOutDocGenerate();
- break;
- case 9:
- return $this->getOutDocType();
- break;
- case 10:
- return $this->getOutDocCurrentRevision();
- break;
- case 11:
- return $this->getOutDocFieldMapping();
- break;
- case 12:
- return $this->getOutDocVersioning();
- break;
- case 13:
- return $this->getOutDocDestinationPath();
- break;
- case 14:
- return $this->getOutDocTags();
- break;
- case 15:
- return $this->getOutDocPdfSecurityEnabled();
- break;
- case 16:
- return $this->getOutDocPdfSecurityOpenPassword();
- break;
- case 17:
- return $this->getOutDocPdfSecurityOwnerPassword();
- break;
- case 18:
- return $this->getOutDocPdfSecurityPermissions();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = OutputDocumentPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getOutDocUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getOutDocLandscape(),
- $keys[3] => $this->getOutDocMedia(),
- $keys[4] => $this->getOutDocLeftMargin(),
- $keys[5] => $this->getOutDocRightMargin(),
- $keys[6] => $this->getOutDocTopMargin(),
- $keys[7] => $this->getOutDocBottomMargin(),
- $keys[8] => $this->getOutDocGenerate(),
- $keys[9] => $this->getOutDocType(),
- $keys[10] => $this->getOutDocCurrentRevision(),
- $keys[11] => $this->getOutDocFieldMapping(),
- $keys[12] => $this->getOutDocVersioning(),
- $keys[13] => $this->getOutDocDestinationPath(),
- $keys[14] => $this->getOutDocTags(),
- $keys[15] => $this->getOutDocPdfSecurityEnabled(),
- $keys[16] => $this->getOutDocPdfSecurityOpenPassword(),
- $keys[17] => $this->getOutDocPdfSecurityOwnerPassword(),
- $keys[18] => $this->getOutDocPdfSecurityPermissions(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = OutputDocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setOutDocUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setOutDocLandscape($value);
- break;
- case 3:
- $this->setOutDocMedia($value);
- break;
- case 4:
- $this->setOutDocLeftMargin($value);
- break;
- case 5:
- $this->setOutDocRightMargin($value);
- break;
- case 6:
- $this->setOutDocTopMargin($value);
- break;
- case 7:
- $this->setOutDocBottomMargin($value);
- break;
- case 8:
- $this->setOutDocGenerate($value);
- break;
- case 9:
- $this->setOutDocType($value);
- break;
- case 10:
- $this->setOutDocCurrentRevision($value);
- break;
- case 11:
- $this->setOutDocFieldMapping($value);
- break;
- case 12:
- $this->setOutDocVersioning($value);
- break;
- case 13:
- $this->setOutDocDestinationPath($value);
- break;
- case 14:
- $this->setOutDocTags($value);
- break;
- case 15:
- $this->setOutDocPdfSecurityEnabled($value);
- break;
- case 16:
- $this->setOutDocPdfSecurityOpenPassword($value);
- break;
- case 17:
- $this->setOutDocPdfSecurityOwnerPassword($value);
- break;
- case 18:
- $this->setOutDocPdfSecurityPermissions($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = OutputDocumentPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setOutDocUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setOutDocLandscape($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setOutDocMedia($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setOutDocLeftMargin($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setOutDocRightMargin($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setOutDocTopMargin($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setOutDocBottomMargin($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setOutDocGenerate($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setOutDocType($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setOutDocCurrentRevision($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setOutDocFieldMapping($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setOutDocVersioning($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setOutDocDestinationPath($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setOutDocTags($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setOutDocPdfSecurityEnabled($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setOutDocPdfSecurityOpenPassword($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setOutDocPdfSecurityOwnerPassword($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setOutDocPdfSecurityPermissions($arr[$keys[18]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(OutputDocumentPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_UID)) $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $this->out_doc_uid);
- if ($this->isColumnModified(OutputDocumentPeer::PRO_UID)) $criteria->add(OutputDocumentPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_LANDSCAPE)) $criteria->add(OutputDocumentPeer::OUT_DOC_LANDSCAPE, $this->out_doc_landscape);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_MEDIA)) $criteria->add(OutputDocumentPeer::OUT_DOC_MEDIA, $this->out_doc_media);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_LEFT_MARGIN)) $criteria->add(OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, $this->out_doc_left_margin);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN)) $criteria->add(OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, $this->out_doc_right_margin);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_TOP_MARGIN)) $criteria->add(OutputDocumentPeer::OUT_DOC_TOP_MARGIN, $this->out_doc_top_margin);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN)) $criteria->add(OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, $this->out_doc_bottom_margin);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_GENERATE)) $criteria->add(OutputDocumentPeer::OUT_DOC_GENERATE, $this->out_doc_generate);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_TYPE)) $criteria->add(OutputDocumentPeer::OUT_DOC_TYPE, $this->out_doc_type);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_CURRENT_REVISION)) $criteria->add(OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, $this->out_doc_current_revision);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_FIELD_MAPPING)) $criteria->add(OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, $this->out_doc_field_mapping);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_VERSIONING)) $criteria->add(OutputDocumentPeer::OUT_DOC_VERSIONING, $this->out_doc_versioning);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH)) $criteria->add(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, $this->out_doc_destination_path);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_TAGS)) $criteria->add(OutputDocumentPeer::OUT_DOC_TAGS, $this->out_doc_tags);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, $this->out_doc_pdf_security_enabled);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, $this->out_doc_pdf_security_open_password);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, $this->out_doc_pdf_security_owner_password);
- if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS)) $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, $this->out_doc_pdf_security_permissions);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(OutputDocumentPeer::DATABASE_NAME);
-
- $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $this->out_doc_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getOutDocUid();
- }
-
- /**
- * Generic method to set the primary key (out_doc_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setOutDocUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of OutputDocument (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setOutDocLandscape($this->out_doc_landscape);
-
- $copyObj->setOutDocMedia($this->out_doc_media);
-
- $copyObj->setOutDocLeftMargin($this->out_doc_left_margin);
-
- $copyObj->setOutDocRightMargin($this->out_doc_right_margin);
-
- $copyObj->setOutDocTopMargin($this->out_doc_top_margin);
-
- $copyObj->setOutDocBottomMargin($this->out_doc_bottom_margin);
-
- $copyObj->setOutDocGenerate($this->out_doc_generate);
-
- $copyObj->setOutDocType($this->out_doc_type);
-
- $copyObj->setOutDocCurrentRevision($this->out_doc_current_revision);
-
- $copyObj->setOutDocFieldMapping($this->out_doc_field_mapping);
-
- $copyObj->setOutDocVersioning($this->out_doc_versioning);
-
- $copyObj->setOutDocDestinationPath($this->out_doc_destination_path);
-
- $copyObj->setOutDocTags($this->out_doc_tags);
-
- $copyObj->setOutDocPdfSecurityEnabled($this->out_doc_pdf_security_enabled);
-
- $copyObj->setOutDocPdfSecurityOpenPassword($this->out_doc_pdf_security_open_password);
-
- $copyObj->setOutDocPdfSecurityOwnerPassword($this->out_doc_pdf_security_owner_password);
-
- $copyObj->setOutDocPdfSecurityPermissions($this->out_doc_pdf_security_permissions);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setOutDocUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return OutputDocument Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return OutputDocumentPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new OutputDocumentPeer();
- }
- return self::$peer;
- }
-
-} // BaseOutputDocument
diff --git a/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php b/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php
index deeba3c93..88227c852 100755
--- a/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php
+++ b/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php
@@ -12,656 +12,658 @@ include_once 'classes/model/OutputDocument.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseOutputDocumentPeer {
+abstract class BaseOutputDocumentPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'OUTPUT_DOCUMENT';
+ /** the table name for this class */
+ const TABLE_NAME = 'OUTPUT_DOCUMENT';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.OutputDocument';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.OutputDocument';
- /** The total number of columns. */
- const NUM_COLUMNS = 19;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 19;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the OUT_DOC_UID field */
- const OUT_DOC_UID = 'OUTPUT_DOCUMENT.OUT_DOC_UID';
+ /** the column name for the OUT_DOC_UID field */
+ const OUT_DOC_UID = 'OUTPUT_DOCUMENT.OUT_DOC_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'OUTPUT_DOCUMENT.PRO_UID';
+
+ /** the column name for the OUT_DOC_LANDSCAPE field */
+ const OUT_DOC_LANDSCAPE = 'OUTPUT_DOCUMENT.OUT_DOC_LANDSCAPE';
+
+ /** the column name for the OUT_DOC_MEDIA field */
+ const OUT_DOC_MEDIA = 'OUTPUT_DOCUMENT.OUT_DOC_MEDIA';
+
+ /** the column name for the OUT_DOC_LEFT_MARGIN field */
+ const OUT_DOC_LEFT_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_LEFT_MARGIN';
+
+ /** the column name for the OUT_DOC_RIGHT_MARGIN field */
+ const OUT_DOC_RIGHT_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_RIGHT_MARGIN';
+
+ /** the column name for the OUT_DOC_TOP_MARGIN field */
+ const OUT_DOC_TOP_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_TOP_MARGIN';
+
+ /** the column name for the OUT_DOC_BOTTOM_MARGIN field */
+ const OUT_DOC_BOTTOM_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_BOTTOM_MARGIN';
+
+ /** the column name for the OUT_DOC_GENERATE field */
+ const OUT_DOC_GENERATE = 'OUTPUT_DOCUMENT.OUT_DOC_GENERATE';
+
+ /** the column name for the OUT_DOC_TYPE field */
+ const OUT_DOC_TYPE = 'OUTPUT_DOCUMENT.OUT_DOC_TYPE';
+
+ /** the column name for the OUT_DOC_CURRENT_REVISION field */
+ const OUT_DOC_CURRENT_REVISION = 'OUTPUT_DOCUMENT.OUT_DOC_CURRENT_REVISION';
+
+ /** the column name for the OUT_DOC_FIELD_MAPPING field */
+ const OUT_DOC_FIELD_MAPPING = 'OUTPUT_DOCUMENT.OUT_DOC_FIELD_MAPPING';
+
+ /** the column name for the OUT_DOC_VERSIONING field */
+ const OUT_DOC_VERSIONING = 'OUTPUT_DOCUMENT.OUT_DOC_VERSIONING';
+
+ /** the column name for the OUT_DOC_DESTINATION_PATH field */
+ const OUT_DOC_DESTINATION_PATH = 'OUTPUT_DOCUMENT.OUT_DOC_DESTINATION_PATH';
+
+ /** the column name for the OUT_DOC_TAGS field */
+ const OUT_DOC_TAGS = 'OUTPUT_DOCUMENT.OUT_DOC_TAGS';
+
+ /** the column name for the OUT_DOC_PDF_SECURITY_ENABLED field */
+ const OUT_DOC_PDF_SECURITY_ENABLED = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_ENABLED';
+
+ /** the column name for the OUT_DOC_PDF_SECURITY_OPEN_PASSWORD field */
+ const OUT_DOC_PDF_SECURITY_OPEN_PASSWORD = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_OPEN_PASSWORD';
+
+ /** the column name for the OUT_DOC_PDF_SECURITY_OWNER_PASSWORD field */
+ const OUT_DOC_PDF_SECURITY_OWNER_PASSWORD = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_OWNER_PASSWORD';
+
+ /** the column name for the OUT_DOC_PDF_SECURITY_PERMISSIONS field */
+ const OUT_DOC_PDF_SECURITY_PERMISSIONS = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_PERMISSIONS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('OutDocUid', 'ProUid', 'OutDocLandscape', 'OutDocMedia', 'OutDocLeftMargin', 'OutDocRightMargin', 'OutDocTopMargin', 'OutDocBottomMargin', 'OutDocGenerate', 'OutDocType', 'OutDocCurrentRevision', 'OutDocFieldMapping', 'OutDocVersioning', 'OutDocDestinationPath', 'OutDocTags', 'OutDocPdfSecurityEnabled', 'OutDocPdfSecurityOpenPassword', 'OutDocPdfSecurityOwnerPassword', 'OutDocPdfSecurityPermissions', ),
+ BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID, OutputDocumentPeer::PRO_UID, OutputDocumentPeer::OUT_DOC_LANDSCAPE, OutputDocumentPeer::OUT_DOC_MEDIA, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, OutputDocumentPeer::OUT_DOC_TOP_MARGIN, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, OutputDocumentPeer::OUT_DOC_GENERATE, OutputDocumentPeer::OUT_DOC_TYPE, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, OutputDocumentPeer::OUT_DOC_VERSIONING, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, OutputDocumentPeer::OUT_DOC_TAGS, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, ),
+ BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID', 'PRO_UID', 'OUT_DOC_LANDSCAPE', 'OUT_DOC_MEDIA', 'OUT_DOC_LEFT_MARGIN', 'OUT_DOC_RIGHT_MARGIN', 'OUT_DOC_TOP_MARGIN', 'OUT_DOC_BOTTOM_MARGIN', 'OUT_DOC_GENERATE', 'OUT_DOC_TYPE', 'OUT_DOC_CURRENT_REVISION', 'OUT_DOC_FIELD_MAPPING', 'OUT_DOC_VERSIONING', 'OUT_DOC_DESTINATION_PATH', 'OUT_DOC_TAGS', 'OUT_DOC_PDF_SECURITY_ENABLED', 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OUT_DOC_PDF_SECURITY_PERMISSIONS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('OutDocUid' => 0, 'ProUid' => 1, 'OutDocLandscape' => 2, 'OutDocMedia' => 3, 'OutDocLeftMargin' => 4, 'OutDocRightMargin' => 5, 'OutDocTopMargin' => 6, 'OutDocBottomMargin' => 7, 'OutDocGenerate' => 8, 'OutDocType' => 9, 'OutDocCurrentRevision' => 10, 'OutDocFieldMapping' => 11, 'OutDocVersioning' => 12, 'OutDocDestinationPath' => 13, 'OutDocTags' => 14, 'OutDocPdfSecurityEnabled' => 15, 'OutDocPdfSecurityOpenPassword' => 16, 'OutDocPdfSecurityOwnerPassword' => 17, 'OutDocPdfSecurityPermissions' => 18, ),
+ BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID => 0, OutputDocumentPeer::PRO_UID => 1, OutputDocumentPeer::OUT_DOC_LANDSCAPE => 2, OutputDocumentPeer::OUT_DOC_MEDIA => 3, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN => 4, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN => 5, OutputDocumentPeer::OUT_DOC_TOP_MARGIN => 6, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN => 7, OutputDocumentPeer::OUT_DOC_GENERATE => 8, OutputDocumentPeer::OUT_DOC_TYPE => 9, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION => 10, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING => 11, OutputDocumentPeer::OUT_DOC_VERSIONING => 12, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH => 13, OutputDocumentPeer::OUT_DOC_TAGS => 14, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED => 15, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD => 16, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD => 17, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS => 18, ),
+ BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID' => 0, 'PRO_UID' => 1, 'OUT_DOC_LANDSCAPE' => 2, 'OUT_DOC_MEDIA' => 3, 'OUT_DOC_LEFT_MARGIN' => 4, 'OUT_DOC_RIGHT_MARGIN' => 5, 'OUT_DOC_TOP_MARGIN' => 6, 'OUT_DOC_BOTTOM_MARGIN' => 7, 'OUT_DOC_GENERATE' => 8, 'OUT_DOC_TYPE' => 9, 'OUT_DOC_CURRENT_REVISION' => 10, 'OUT_DOC_FIELD_MAPPING' => 11, 'OUT_DOC_VERSIONING' => 12, 'OUT_DOC_DESTINATION_PATH' => 13, 'OUT_DOC_TAGS' => 14, 'OUT_DOC_PDF_SECURITY_ENABLED' => 15, 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD' => 16, 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD' => 17, 'OUT_DOC_PDF_SECURITY_PERMISSIONS' => 18, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/OutputDocumentMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.OutputDocumentMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = OutputDocumentPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. OutputDocumentPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(OutputDocumentPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_UID);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::PRO_UID);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_LANDSCAPE);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_MEDIA);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_LEFT_MARGIN);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_TOP_MARGIN);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_GENERATE);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_TYPE);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_CURRENT_REVISION);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_FIELD_MAPPING);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_VERSIONING);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_TAGS);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD);
+
+ $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS);
+
+ }
+
+ const COUNT = 'COUNT(OUTPUT_DOCUMENT.OUT_DOC_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT OUTPUT_DOCUMENT.OUT_DOC_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(OutputDocumentPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(OutputDocumentPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = OutputDocumentPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return OutputDocument
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = OutputDocumentPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return OutputDocumentPeer::populateObjects(OutputDocumentPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ OutputDocumentPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = OutputDocumentPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return OutputDocumentPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a OutputDocument or Criteria object.
+ *
+ * @param mixed $values Criteria or OutputDocument object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from OutputDocument object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a OutputDocument or Criteria object.
+ *
+ * @param mixed $values Criteria or OutputDocument object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(OutputDocumentPeer::OUT_DOC_UID);
+ $selectCriteria->add(OutputDocumentPeer::OUT_DOC_UID, $criteria->remove(OutputDocumentPeer::OUT_DOC_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the OUTPUT_DOCUMENT table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(OutputDocumentPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a OutputDocument or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or OutputDocument object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof OutputDocument) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(OutputDocumentPeer::OUT_DOC_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given OutputDocument object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param OutputDocument $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(OutputDocument $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(OutputDocumentPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(OutputDocumentPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_UID))
+ $columns[OutputDocumentPeer::OUT_DOC_UID] = $obj->getOutDocUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::PRO_UID))
+ $columns[OutputDocumentPeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_GENERATE))
+ $columns[OutputDocumentPeer::OUT_DOC_GENERATE] = $obj->getOutDocGenerate();
+
+ if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_TYPE))
+ $columns[OutputDocumentPeer::OUT_DOC_TYPE] = $obj->getOutDocType();
+
+ }
+
+ return BasePeer::doValidate(OutputDocumentPeer::DATABASE_NAME, OutputDocumentPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return OutputDocument
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(OutputDocumentPeer::DATABASE_NAME);
+
+ $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $pk);
+
+
+ $v = OutputDocumentPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $pks, Criteria::IN);
+ $objs = OutputDocumentPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** the column name for the PRO_UID field */
- const PRO_UID = 'OUTPUT_DOCUMENT.PRO_UID';
-
- /** the column name for the OUT_DOC_LANDSCAPE field */
- const OUT_DOC_LANDSCAPE = 'OUTPUT_DOCUMENT.OUT_DOC_LANDSCAPE';
-
- /** the column name for the OUT_DOC_MEDIA field */
- const OUT_DOC_MEDIA = 'OUTPUT_DOCUMENT.OUT_DOC_MEDIA';
-
- /** the column name for the OUT_DOC_LEFT_MARGIN field */
- const OUT_DOC_LEFT_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_LEFT_MARGIN';
-
- /** the column name for the OUT_DOC_RIGHT_MARGIN field */
- const OUT_DOC_RIGHT_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_RIGHT_MARGIN';
-
- /** the column name for the OUT_DOC_TOP_MARGIN field */
- const OUT_DOC_TOP_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_TOP_MARGIN';
-
- /** the column name for the OUT_DOC_BOTTOM_MARGIN field */
- const OUT_DOC_BOTTOM_MARGIN = 'OUTPUT_DOCUMENT.OUT_DOC_BOTTOM_MARGIN';
-
- /** the column name for the OUT_DOC_GENERATE field */
- const OUT_DOC_GENERATE = 'OUTPUT_DOCUMENT.OUT_DOC_GENERATE';
-
- /** the column name for the OUT_DOC_TYPE field */
- const OUT_DOC_TYPE = 'OUTPUT_DOCUMENT.OUT_DOC_TYPE';
-
- /** the column name for the OUT_DOC_CURRENT_REVISION field */
- const OUT_DOC_CURRENT_REVISION = 'OUTPUT_DOCUMENT.OUT_DOC_CURRENT_REVISION';
-
- /** the column name for the OUT_DOC_FIELD_MAPPING field */
- const OUT_DOC_FIELD_MAPPING = 'OUTPUT_DOCUMENT.OUT_DOC_FIELD_MAPPING';
-
- /** the column name for the OUT_DOC_VERSIONING field */
- const OUT_DOC_VERSIONING = 'OUTPUT_DOCUMENT.OUT_DOC_VERSIONING';
-
- /** the column name for the OUT_DOC_DESTINATION_PATH field */
- const OUT_DOC_DESTINATION_PATH = 'OUTPUT_DOCUMENT.OUT_DOC_DESTINATION_PATH';
-
- /** the column name for the OUT_DOC_TAGS field */
- const OUT_DOC_TAGS = 'OUTPUT_DOCUMENT.OUT_DOC_TAGS';
-
- /** the column name for the OUT_DOC_PDF_SECURITY_ENABLED field */
- const OUT_DOC_PDF_SECURITY_ENABLED = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_ENABLED';
-
- /** the column name for the OUT_DOC_PDF_SECURITY_OPEN_PASSWORD field */
- const OUT_DOC_PDF_SECURITY_OPEN_PASSWORD = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_OPEN_PASSWORD';
-
- /** the column name for the OUT_DOC_PDF_SECURITY_OWNER_PASSWORD field */
- const OUT_DOC_PDF_SECURITY_OWNER_PASSWORD = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_OWNER_PASSWORD';
-
- /** the column name for the OUT_DOC_PDF_SECURITY_PERMISSIONS field */
- const OUT_DOC_PDF_SECURITY_PERMISSIONS = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_PERMISSIONS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('OutDocUid', 'ProUid', 'OutDocLandscape', 'OutDocMedia', 'OutDocLeftMargin', 'OutDocRightMargin', 'OutDocTopMargin', 'OutDocBottomMargin', 'OutDocGenerate', 'OutDocType', 'OutDocCurrentRevision', 'OutDocFieldMapping', 'OutDocVersioning', 'OutDocDestinationPath', 'OutDocTags', 'OutDocPdfSecurityEnabled', 'OutDocPdfSecurityOpenPassword', 'OutDocPdfSecurityOwnerPassword', 'OutDocPdfSecurityPermissions', ),
- BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID, OutputDocumentPeer::PRO_UID, OutputDocumentPeer::OUT_DOC_LANDSCAPE, OutputDocumentPeer::OUT_DOC_MEDIA, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, OutputDocumentPeer::OUT_DOC_TOP_MARGIN, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, OutputDocumentPeer::OUT_DOC_GENERATE, OutputDocumentPeer::OUT_DOC_TYPE, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, OutputDocumentPeer::OUT_DOC_VERSIONING, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, OutputDocumentPeer::OUT_DOC_TAGS, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, ),
- BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID', 'PRO_UID', 'OUT_DOC_LANDSCAPE', 'OUT_DOC_MEDIA', 'OUT_DOC_LEFT_MARGIN', 'OUT_DOC_RIGHT_MARGIN', 'OUT_DOC_TOP_MARGIN', 'OUT_DOC_BOTTOM_MARGIN', 'OUT_DOC_GENERATE', 'OUT_DOC_TYPE', 'OUT_DOC_CURRENT_REVISION', 'OUT_DOC_FIELD_MAPPING', 'OUT_DOC_VERSIONING', 'OUT_DOC_DESTINATION_PATH', 'OUT_DOC_TAGS', 'OUT_DOC_PDF_SECURITY_ENABLED', 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OUT_DOC_PDF_SECURITY_PERMISSIONS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('OutDocUid' => 0, 'ProUid' => 1, 'OutDocLandscape' => 2, 'OutDocMedia' => 3, 'OutDocLeftMargin' => 4, 'OutDocRightMargin' => 5, 'OutDocTopMargin' => 6, 'OutDocBottomMargin' => 7, 'OutDocGenerate' => 8, 'OutDocType' => 9, 'OutDocCurrentRevision' => 10, 'OutDocFieldMapping' => 11, 'OutDocVersioning' => 12, 'OutDocDestinationPath' => 13, 'OutDocTags' => 14, 'OutDocPdfSecurityEnabled' => 15, 'OutDocPdfSecurityOpenPassword' => 16, 'OutDocPdfSecurityOwnerPassword' => 17, 'OutDocPdfSecurityPermissions' => 18, ),
- BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID => 0, OutputDocumentPeer::PRO_UID => 1, OutputDocumentPeer::OUT_DOC_LANDSCAPE => 2, OutputDocumentPeer::OUT_DOC_MEDIA => 3, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN => 4, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN => 5, OutputDocumentPeer::OUT_DOC_TOP_MARGIN => 6, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN => 7, OutputDocumentPeer::OUT_DOC_GENERATE => 8, OutputDocumentPeer::OUT_DOC_TYPE => 9, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION => 10, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING => 11, OutputDocumentPeer::OUT_DOC_VERSIONING => 12, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH => 13, OutputDocumentPeer::OUT_DOC_TAGS => 14, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED => 15, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD => 16, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD => 17, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS => 18, ),
- BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID' => 0, 'PRO_UID' => 1, 'OUT_DOC_LANDSCAPE' => 2, 'OUT_DOC_MEDIA' => 3, 'OUT_DOC_LEFT_MARGIN' => 4, 'OUT_DOC_RIGHT_MARGIN' => 5, 'OUT_DOC_TOP_MARGIN' => 6, 'OUT_DOC_BOTTOM_MARGIN' => 7, 'OUT_DOC_GENERATE' => 8, 'OUT_DOC_TYPE' => 9, 'OUT_DOC_CURRENT_REVISION' => 10, 'OUT_DOC_FIELD_MAPPING' => 11, 'OUT_DOC_VERSIONING' => 12, 'OUT_DOC_DESTINATION_PATH' => 13, 'OUT_DOC_TAGS' => 14, 'OUT_DOC_PDF_SECURITY_ENABLED' => 15, 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD' => 16, 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD' => 17, 'OUT_DOC_PDF_SECURITY_PERMISSIONS' => 18, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/OutputDocumentMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.OutputDocumentMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = OutputDocumentPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. OutputDocumentPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(OutputDocumentPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_UID);
-
- $criteria->addSelectColumn(OutputDocumentPeer::PRO_UID);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_LANDSCAPE);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_MEDIA);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_LEFT_MARGIN);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_TOP_MARGIN);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_GENERATE);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_TYPE);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_CURRENT_REVISION);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_FIELD_MAPPING);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_VERSIONING);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_DESTINATION_PATH);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_TAGS);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD);
-
- $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS);
-
- }
-
- const COUNT = 'COUNT(OUTPUT_DOCUMENT.OUT_DOC_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT OUTPUT_DOCUMENT.OUT_DOC_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(OutputDocumentPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(OutputDocumentPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = OutputDocumentPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return OutputDocument
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = OutputDocumentPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return OutputDocumentPeer::populateObjects(OutputDocumentPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- OutputDocumentPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = OutputDocumentPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return OutputDocumentPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a OutputDocument or Criteria object.
- *
- * @param mixed $values Criteria or OutputDocument object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from OutputDocument object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a OutputDocument or Criteria object.
- *
- * @param mixed $values Criteria or OutputDocument object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(OutputDocumentPeer::OUT_DOC_UID);
- $selectCriteria->add(OutputDocumentPeer::OUT_DOC_UID, $criteria->remove(OutputDocumentPeer::OUT_DOC_UID), $comparison);
-
- } else { // $values is OutputDocument object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the OUTPUT_DOCUMENT table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(OutputDocumentPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a OutputDocument or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or OutputDocument object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof OutputDocument) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(OutputDocumentPeer::OUT_DOC_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given OutputDocument object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param OutputDocument $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(OutputDocument $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(OutputDocumentPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(OutputDocumentPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_UID))
- $columns[OutputDocumentPeer::OUT_DOC_UID] = $obj->getOutDocUid();
-
- if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::PRO_UID))
- $columns[OutputDocumentPeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_GENERATE))
- $columns[OutputDocumentPeer::OUT_DOC_GENERATE] = $obj->getOutDocGenerate();
-
- if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_TYPE))
- $columns[OutputDocumentPeer::OUT_DOC_TYPE] = $obj->getOutDocType();
-
- }
-
- return BasePeer::doValidate(OutputDocumentPeer::DATABASE_NAME, OutputDocumentPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return OutputDocument
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(OutputDocumentPeer::DATABASE_NAME);
-
- $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $pk);
-
-
- $v = OutputDocumentPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(OutputDocumentPeer::OUT_DOC_UID, $pks, Criteria::IN);
- $objs = OutputDocumentPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseOutputDocumentPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseOutputDocumentPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseOutputDocumentPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/OutputDocumentMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.OutputDocumentMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/OutputDocumentMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.OutputDocumentMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseProcess.php b/workflow/engine/classes/model/om/BaseProcess.php
index b143a31d0..e4b87bf01 100755
--- a/workflow/engine/classes/model/om/BaseProcess.php
+++ b/workflow/engine/classes/model/om/BaseProcess.php
@@ -16,1799 +16,1929 @@ include_once 'classes/model/ProcessPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcess extends BaseObject implements Persistent {
+abstract class BaseProcess extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ProcessPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the pro_parent field.
+ * @var string
+ */
+ protected $pro_parent = '0';
+
+ /**
+ * The value for the pro_time field.
+ * @var double
+ */
+ protected $pro_time = 1;
+
+ /**
+ * The value for the pro_timeunit field.
+ * @var string
+ */
+ protected $pro_timeunit = 'DAYS';
+
+ /**
+ * The value for the pro_status field.
+ * @var string
+ */
+ protected $pro_status = 'ACTIVE';
+
+ /**
+ * The value for the pro_type_day field.
+ * @var string
+ */
+ protected $pro_type_day = '0';
+
+ /**
+ * The value for the pro_type field.
+ * @var string
+ */
+ protected $pro_type = 'NORMAL';
+
+ /**
+ * The value for the pro_assignment field.
+ * @var string
+ */
+ protected $pro_assignment = 'FALSE';
+
+ /**
+ * The value for the pro_show_map field.
+ * @var int
+ */
+ protected $pro_show_map = 1;
+
+ /**
+ * The value for the pro_show_message field.
+ * @var int
+ */
+ protected $pro_show_message = 1;
+
+ /**
+ * The value for the pro_show_delegate field.
+ * @var int
+ */
+ protected $pro_show_delegate = 1;
+
+ /**
+ * The value for the pro_show_dynaform field.
+ * @var int
+ */
+ protected $pro_show_dynaform = 0;
+
+ /**
+ * The value for the pro_category field.
+ * @var string
+ */
+ protected $pro_category = '';
+
+ /**
+ * The value for the pro_sub_category field.
+ * @var string
+ */
+ protected $pro_sub_category = '';
+
+ /**
+ * The value for the pro_industry field.
+ * @var int
+ */
+ protected $pro_industry = 1;
+
+ /**
+ * The value for the pro_update_date field.
+ * @var int
+ */
+ protected $pro_update_date;
+
+ /**
+ * The value for the pro_create_date field.
+ * @var int
+ */
+ protected $pro_create_date;
+
+ /**
+ * The value for the pro_create_user field.
+ * @var string
+ */
+ protected $pro_create_user = '';
+
+ /**
+ * The value for the pro_height field.
+ * @var int
+ */
+ protected $pro_height = 5000;
+
+ /**
+ * The value for the pro_width field.
+ * @var int
+ */
+ protected $pro_width = 10000;
+
+ /**
+ * The value for the pro_title_x field.
+ * @var int
+ */
+ protected $pro_title_x = 0;
+
+ /**
+ * The value for the pro_title_y field.
+ * @var int
+ */
+ protected $pro_title_y = 6;
+
+ /**
+ * The value for the pro_debug field.
+ * @var int
+ */
+ protected $pro_debug = 0;
+
+ /**
+ * The value for the pro_dynaforms field.
+ * @var string
+ */
+ protected $pro_dynaforms;
+
+ /**
+ * The value for the pro_derivation_screen_tpl field.
+ * @var string
+ */
+ protected $pro_derivation_screen_tpl = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [pro_parent] column value.
+ *
+ * @return string
+ */
+ public function getProParent()
+ {
+
+ return $this->pro_parent;
+ }
+
+ /**
+ * Get the [pro_time] column value.
+ *
+ * @return double
+ */
+ public function getProTime()
+ {
+
+ return $this->pro_time;
+ }
+
+ /**
+ * Get the [pro_timeunit] column value.
+ *
+ * @return string
+ */
+ public function getProTimeunit()
+ {
+
+ return $this->pro_timeunit;
+ }
+
+ /**
+ * Get the [pro_status] column value.
+ *
+ * @return string
+ */
+ public function getProStatus()
+ {
+
+ return $this->pro_status;
+ }
+
+ /**
+ * Get the [pro_type_day] column value.
+ *
+ * @return string
+ */
+ public function getProTypeDay()
+ {
+
+ return $this->pro_type_day;
+ }
+
+ /**
+ * Get the [pro_type] column value.
+ *
+ * @return string
+ */
+ public function getProType()
+ {
+
+ return $this->pro_type;
+ }
+
+ /**
+ * Get the [pro_assignment] column value.
+ *
+ * @return string
+ */
+ public function getProAssignment()
+ {
+
+ return $this->pro_assignment;
+ }
+
+ /**
+ * Get the [pro_show_map] column value.
+ *
+ * @return int
+ */
+ public function getProShowMap()
+ {
+
+ return $this->pro_show_map;
+ }
+
+ /**
+ * Get the [pro_show_message] column value.
+ *
+ * @return int
+ */
+ public function getProShowMessage()
+ {
+
+ return $this->pro_show_message;
+ }
+
+ /**
+ * Get the [pro_show_delegate] column value.
+ *
+ * @return int
+ */
+ public function getProShowDelegate()
+ {
+
+ return $this->pro_show_delegate;
+ }
+
+ /**
+ * Get the [pro_show_dynaform] column value.
+ *
+ * @return int
+ */
+ public function getProShowDynaform()
+ {
+
+ return $this->pro_show_dynaform;
+ }
+
+ /**
+ * Get the [pro_category] column value.
+ *
+ * @return string
+ */
+ public function getProCategory()
+ {
+
+ return $this->pro_category;
+ }
+
+ /**
+ * Get the [pro_sub_category] column value.
+ *
+ * @return string
+ */
+ public function getProSubCategory()
+ {
+
+ return $this->pro_sub_category;
+ }
+
+ /**
+ * Get the [pro_industry] column value.
+ *
+ * @return int
+ */
+ public function getProIndustry()
+ {
+
+ return $this->pro_industry;
+ }
+
+ /**
+ * Get the [optionally formatted] [pro_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getProUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->pro_update_date === null || $this->pro_update_date === '') {
+ return null;
+ } elseif (!is_int($this->pro_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->pro_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [pro_update_date] as date/time value: " .
+ var_export($this->pro_update_date, true));
+ }
+ } else {
+ $ts = $this->pro_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [pro_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getProCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->pro_create_date === null || $this->pro_create_date === '') {
+ return null;
+ } elseif (!is_int($this->pro_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->pro_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [pro_create_date] as date/time value: " .
+ var_export($this->pro_create_date, true));
+ }
+ } else {
+ $ts = $this->pro_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [pro_create_user] column value.
+ *
+ * @return string
+ */
+ public function getProCreateUser()
+ {
+
+ return $this->pro_create_user;
+ }
+
+ /**
+ * Get the [pro_height] column value.
+ *
+ * @return int
+ */
+ public function getProHeight()
+ {
+
+ return $this->pro_height;
+ }
+
+ /**
+ * Get the [pro_width] column value.
+ *
+ * @return int
+ */
+ public function getProWidth()
+ {
+
+ return $this->pro_width;
+ }
+
+ /**
+ * Get the [pro_title_x] column value.
+ *
+ * @return int
+ */
+ public function getProTitleX()
+ {
+
+ return $this->pro_title_x;
+ }
+
+ /**
+ * Get the [pro_title_y] column value.
+ *
+ * @return int
+ */
+ public function getProTitleY()
+ {
+
+ return $this->pro_title_y;
+ }
+
+ /**
+ * Get the [pro_debug] column value.
+ *
+ * @return int
+ */
+ public function getProDebug()
+ {
+
+ return $this->pro_debug;
+ }
+
+ /**
+ * Get the [pro_dynaforms] column value.
+ *
+ * @return string
+ */
+ public function getProDynaforms()
+ {
+
+ return $this->pro_dynaforms;
+ }
+
+ /**
+ * Get the [pro_derivation_screen_tpl] column value.
+ *
+ * @return string
+ */
+ public function getProDerivationScreenTpl()
+ {
+
+ return $this->pro_derivation_screen_tpl;
+ }
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [pro_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_parent !== $v || $v === '0') {
+ $this->pro_parent = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_PARENT;
+ }
+
+ } // setProParent()
+
+ /**
+ * Set the value of [pro_time] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setProTime($v)
+ {
+
+ if ($this->pro_time !== $v || $v === 1) {
+ $this->pro_time = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_TIME;
+ }
+
+ } // setProTime()
+
+ /**
+ * Set the value of [pro_timeunit] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProTimeunit($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_timeunit !== $v || $v === 'DAYS') {
+ $this->pro_timeunit = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_TIMEUNIT;
+ }
+
+ } // setProTimeunit()
+
+ /**
+ * Set the value of [pro_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_status !== $v || $v === 'ACTIVE') {
+ $this->pro_status = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_STATUS;
+ }
+
+ } // setProStatus()
+
+ /**
+ * Set the value of [pro_type_day] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProTypeDay($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_type_day !== $v || $v === '0') {
+ $this->pro_type_day = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_TYPE_DAY;
+ }
+
+ } // setProTypeDay()
+
+ /**
+ * Set the value of [pro_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_type !== $v || $v === 'NORMAL') {
+ $this->pro_type = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_TYPE;
+ }
+
+ } // setProType()
+
+ /**
+ * Set the value of [pro_assignment] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProAssignment($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_assignment !== $v || $v === 'FALSE') {
+ $this->pro_assignment = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_ASSIGNMENT;
+ }
+
+ } // setProAssignment()
+
+ /**
+ * Set the value of [pro_show_map] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProShowMap($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->pro_show_map !== $v || $v === 1) {
+ $this->pro_show_map = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_MAP;
+ }
+
+ } // setProShowMap()
+
+ /**
+ * Set the value of [pro_show_message] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProShowMessage($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->pro_show_message !== $v || $v === 1) {
+ $this->pro_show_message = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_MESSAGE;
+ }
+
+ } // setProShowMessage()
+
+ /**
+ * Set the value of [pro_show_delegate] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProShowDelegate($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->pro_show_delegate !== $v || $v === 1) {
+ $this->pro_show_delegate = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_DELEGATE;
+ }
+
+ } // setProShowDelegate()
+
+ /**
+ * Set the value of [pro_show_dynaform] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProShowDynaform($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->pro_show_dynaform !== $v || $v === 0) {
+ $this->pro_show_dynaform = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_DYNAFORM;
+ }
+
+ } // setProShowDynaform()
+
+ /**
+ * Set the value of [pro_category] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProCategory($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_category !== $v || $v === '') {
+ $this->pro_category = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_CATEGORY;
+ }
+
+ } // setProCategory()
+
+ /**
+ * Set the value of [pro_sub_category] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProSubCategory($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_sub_category !== $v || $v === '') {
+ $this->pro_sub_category = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_SUB_CATEGORY;
+ }
+
+ } // setProSubCategory()
+
+ /**
+ * Set the value of [pro_industry] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProIndustry($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->pro_industry !== $v || $v === 1) {
+ $this->pro_industry = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_INDUSTRY;
+ }
+
+ } // setProIndustry()
+
+ /**
+ * Set the value of [pro_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [pro_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->pro_update_date !== $ts) {
+ $this->pro_update_date = $ts;
+ $this->modifiedColumns[] = ProcessPeer::PRO_UPDATE_DATE;
+ }
+
+ } // setProUpdateDate()
+
+ /**
+ * Set the value of [pro_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [pro_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->pro_create_date !== $ts) {
+ $this->pro_create_date = $ts;
+ $this->modifiedColumns[] = ProcessPeer::PRO_CREATE_DATE;
+ }
+
+ } // setProCreateDate()
+
+ /**
+ * Set the value of [pro_create_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProCreateUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_create_user !== $v || $v === '') {
+ $this->pro_create_user = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_CREATE_USER;
+ }
+
+ } // setProCreateUser()
+
+ /**
+ * Set the value of [pro_height] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProHeight($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->pro_height !== $v || $v === 5000) {
+ $this->pro_height = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_HEIGHT;
+ }
+
+ } // setProHeight()
+
+ /**
+ * Set the value of [pro_width] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProWidth($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->pro_width !== $v || $v === 10000) {
+ $this->pro_width = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_WIDTH;
+ }
+
+ } // setProWidth()
+
+ /**
+ * Set the value of [pro_title_x] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProTitleX($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->pro_title_x !== $v || $v === 0) {
+ $this->pro_title_x = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_TITLE_X;
+ }
+
+ } // setProTitleX()
+
+ /**
+ * Set the value of [pro_title_y] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProTitleY($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->pro_title_y !== $v || $v === 6) {
+ $this->pro_title_y = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_TITLE_Y;
+ }
+
+ } // setProTitleY()
+
+ /**
+ * Set the value of [pro_debug] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProDebug($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->pro_debug !== $v || $v === 0) {
+ $this->pro_debug = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_DEBUG;
+ }
+
+ } // setProDebug()
+
+ /**
+ * Set the value of [pro_dynaforms] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProDynaforms($v)
+ {
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ProcessPeer
- */
- protected static $peer;
+ if ($this->pro_dynaforms !== $v) {
+ $this->pro_dynaforms = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_DYNAFORMS;
+ }
+ } // setProDynaforms()
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ /**
+ * Set the value of [pro_derivation_screen_tpl] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProDerivationScreenTpl($v)
+ {
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
- /**
- * The value for the pro_parent field.
- * @var string
- */
- protected $pro_parent = '0';
+ if ($this->pro_derivation_screen_tpl !== $v || $v === '') {
+ $this->pro_derivation_screen_tpl = $v;
+ $this->modifiedColumns[] = ProcessPeer::PRO_DERIVATION_SCREEN_TPL;
+ }
+ } // setProDerivationScreenTpl()
- /**
- * The value for the pro_time field.
- * @var double
- */
- protected $pro_time = 1;
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->pro_uid = $rs->getString($startcol + 0);
+
+ $this->pro_parent = $rs->getString($startcol + 1);
+
+ $this->pro_time = $rs->getFloat($startcol + 2);
+
+ $this->pro_timeunit = $rs->getString($startcol + 3);
+
+ $this->pro_status = $rs->getString($startcol + 4);
+
+ $this->pro_type_day = $rs->getString($startcol + 5);
+
+ $this->pro_type = $rs->getString($startcol + 6);
+
+ $this->pro_assignment = $rs->getString($startcol + 7);
+
+ $this->pro_show_map = $rs->getInt($startcol + 8);
+
+ $this->pro_show_message = $rs->getInt($startcol + 9);
+
+ $this->pro_show_delegate = $rs->getInt($startcol + 10);
+
+ $this->pro_show_dynaform = $rs->getInt($startcol + 11);
+
+ $this->pro_category = $rs->getString($startcol + 12);
+
+ $this->pro_sub_category = $rs->getString($startcol + 13);
+
+ $this->pro_industry = $rs->getInt($startcol + 14);
+
+ $this->pro_update_date = $rs->getTimestamp($startcol + 15, null);
+
+ $this->pro_create_date = $rs->getTimestamp($startcol + 16, null);
+
+ $this->pro_create_user = $rs->getString($startcol + 17);
+
+ $this->pro_height = $rs->getInt($startcol + 18);
+
+ $this->pro_width = $rs->getInt($startcol + 19);
+
+ $this->pro_title_x = $rs->getInt($startcol + 20);
+
+ $this->pro_title_y = $rs->getInt($startcol + 21);
+
+ $this->pro_debug = $rs->getInt($startcol + 22);
+
+ $this->pro_dynaforms = $rs->getString($startcol + 23);
+
+ $this->pro_derivation_screen_tpl = $rs->getString($startcol + 24);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 25; // 25 = ProcessPeer::NUM_COLUMNS - ProcessPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Process object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ProcessPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ProcessPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ProcessPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ProcessPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getProUid();
+ break;
+ case 1:
+ return $this->getProParent();
+ break;
+ case 2:
+ return $this->getProTime();
+ break;
+ case 3:
+ return $this->getProTimeunit();
+ break;
+ case 4:
+ return $this->getProStatus();
+ break;
+ case 5:
+ return $this->getProTypeDay();
+ break;
+ case 6:
+ return $this->getProType();
+ break;
+ case 7:
+ return $this->getProAssignment();
+ break;
+ case 8:
+ return $this->getProShowMap();
+ break;
+ case 9:
+ return $this->getProShowMessage();
+ break;
+ case 10:
+ return $this->getProShowDelegate();
+ break;
+ case 11:
+ return $this->getProShowDynaform();
+ break;
+ case 12:
+ return $this->getProCategory();
+ break;
+ case 13:
+ return $this->getProSubCategory();
+ break;
+ case 14:
+ return $this->getProIndustry();
+ break;
+ case 15:
+ return $this->getProUpdateDate();
+ break;
+ case 16:
+ return $this->getProCreateDate();
+ break;
+ case 17:
+ return $this->getProCreateUser();
+ break;
+ case 18:
+ return $this->getProHeight();
+ break;
+ case 19:
+ return $this->getProWidth();
+ break;
+ case 20:
+ return $this->getProTitleX();
+ break;
+ case 21:
+ return $this->getProTitleY();
+ break;
+ case 22:
+ return $this->getProDebug();
+ break;
+ case 23:
+ return $this->getProDynaforms();
+ break;
+ case 24:
+ return $this->getProDerivationScreenTpl();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getProUid(),
+ $keys[1] => $this->getProParent(),
+ $keys[2] => $this->getProTime(),
+ $keys[3] => $this->getProTimeunit(),
+ $keys[4] => $this->getProStatus(),
+ $keys[5] => $this->getProTypeDay(),
+ $keys[6] => $this->getProType(),
+ $keys[7] => $this->getProAssignment(),
+ $keys[8] => $this->getProShowMap(),
+ $keys[9] => $this->getProShowMessage(),
+ $keys[10] => $this->getProShowDelegate(),
+ $keys[11] => $this->getProShowDynaform(),
+ $keys[12] => $this->getProCategory(),
+ $keys[13] => $this->getProSubCategory(),
+ $keys[14] => $this->getProIndustry(),
+ $keys[15] => $this->getProUpdateDate(),
+ $keys[16] => $this->getProCreateDate(),
+ $keys[17] => $this->getProCreateUser(),
+ $keys[18] => $this->getProHeight(),
+ $keys[19] => $this->getProWidth(),
+ $keys[20] => $this->getProTitleX(),
+ $keys[21] => $this->getProTitleY(),
+ $keys[22] => $this->getProDebug(),
+ $keys[23] => $this->getProDynaforms(),
+ $keys[24] => $this->getProDerivationScreenTpl(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setProUid($value);
+ break;
+ case 1:
+ $this->setProParent($value);
+ break;
+ case 2:
+ $this->setProTime($value);
+ break;
+ case 3:
+ $this->setProTimeunit($value);
+ break;
+ case 4:
+ $this->setProStatus($value);
+ break;
+ case 5:
+ $this->setProTypeDay($value);
+ break;
+ case 6:
+ $this->setProType($value);
+ break;
+ case 7:
+ $this->setProAssignment($value);
+ break;
+ case 8:
+ $this->setProShowMap($value);
+ break;
+ case 9:
+ $this->setProShowMessage($value);
+ break;
+ case 10:
+ $this->setProShowDelegate($value);
+ break;
+ case 11:
+ $this->setProShowDynaform($value);
+ break;
+ case 12:
+ $this->setProCategory($value);
+ break;
+ case 13:
+ $this->setProSubCategory($value);
+ break;
+ case 14:
+ $this->setProIndustry($value);
+ break;
+ case 15:
+ $this->setProUpdateDate($value);
+ break;
+ case 16:
+ $this->setProCreateDate($value);
+ break;
+ case 17:
+ $this->setProCreateUser($value);
+ break;
+ case 18:
+ $this->setProHeight($value);
+ break;
+ case 19:
+ $this->setProWidth($value);
+ break;
+ case 20:
+ $this->setProTitleX($value);
+ break;
+ case 21:
+ $this->setProTitleY($value);
+ break;
+ case 22:
+ $this->setProDebug($value);
+ break;
+ case 23:
+ $this->setProDynaforms($value);
+ break;
+ case 24:
+ $this->setProDerivationScreenTpl($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setProUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProParent($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setProTime($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setProTimeunit($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setProStatus($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setProTypeDay($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setProType($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setProAssignment($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setProShowMap($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setProShowMessage($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setProShowDelegate($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setProShowDynaform($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setProCategory($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setProSubCategory($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setProIndustry($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setProUpdateDate($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setProCreateDate($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setProCreateUser($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setProHeight($arr[$keys[18]]);
+ }
+
+ if (array_key_exists($keys[19], $arr)) {
+ $this->setProWidth($arr[$keys[19]]);
+ }
+
+ if (array_key_exists($keys[20], $arr)) {
+ $this->setProTitleX($arr[$keys[20]]);
+ }
+
+ if (array_key_exists($keys[21], $arr)) {
+ $this->setProTitleY($arr[$keys[21]]);
+ }
+
+ if (array_key_exists($keys[22], $arr)) {
+ $this->setProDebug($arr[$keys[22]]);
+ }
+
+ if (array_key_exists($keys[23], $arr)) {
+ $this->setProDynaforms($arr[$keys[23]]);
+ }
+
+ if (array_key_exists($keys[24], $arr)) {
+ $this->setProDerivationScreenTpl($arr[$keys[24]]);
+ }
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ProcessPeer::DATABASE_NAME);
- /**
- * The value for the pro_timeunit field.
- * @var string
- */
- protected $pro_timeunit = 'DAYS';
+ if ($this->isColumnModified(ProcessPeer::PRO_UID)) {
+ $criteria->add(ProcessPeer::PRO_UID, $this->pro_uid);
+ }
+ if ($this->isColumnModified(ProcessPeer::PRO_PARENT)) {
+ $criteria->add(ProcessPeer::PRO_PARENT, $this->pro_parent);
+ }
- /**
- * The value for the pro_status field.
- * @var string
- */
- protected $pro_status = 'ACTIVE';
+ if ($this->isColumnModified(ProcessPeer::PRO_TIME)) {
+ $criteria->add(ProcessPeer::PRO_TIME, $this->pro_time);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_TIMEUNIT)) {
+ $criteria->add(ProcessPeer::PRO_TIMEUNIT, $this->pro_timeunit);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_STATUS)) {
+ $criteria->add(ProcessPeer::PRO_STATUS, $this->pro_status);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_TYPE_DAY)) {
+ $criteria->add(ProcessPeer::PRO_TYPE_DAY, $this->pro_type_day);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_TYPE)) {
+ $criteria->add(ProcessPeer::PRO_TYPE, $this->pro_type);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_ASSIGNMENT)) {
+ $criteria->add(ProcessPeer::PRO_ASSIGNMENT, $this->pro_assignment);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_SHOW_MAP)) {
+ $criteria->add(ProcessPeer::PRO_SHOW_MAP, $this->pro_show_map);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_SHOW_MESSAGE)) {
+ $criteria->add(ProcessPeer::PRO_SHOW_MESSAGE, $this->pro_show_message);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_SHOW_DELEGATE)) {
+ $criteria->add(ProcessPeer::PRO_SHOW_DELEGATE, $this->pro_show_delegate);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_SHOW_DYNAFORM)) {
+ $criteria->add(ProcessPeer::PRO_SHOW_DYNAFORM, $this->pro_show_dynaform);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_CATEGORY)) {
+ $criteria->add(ProcessPeer::PRO_CATEGORY, $this->pro_category);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_SUB_CATEGORY)) {
+ $criteria->add(ProcessPeer::PRO_SUB_CATEGORY, $this->pro_sub_category);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_INDUSTRY)) {
+ $criteria->add(ProcessPeer::PRO_INDUSTRY, $this->pro_industry);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_UPDATE_DATE)) {
+ $criteria->add(ProcessPeer::PRO_UPDATE_DATE, $this->pro_update_date);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_CREATE_DATE)) {
+ $criteria->add(ProcessPeer::PRO_CREATE_DATE, $this->pro_create_date);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_CREATE_USER)) {
+ $criteria->add(ProcessPeer::PRO_CREATE_USER, $this->pro_create_user);
+ }
+
+ if ($this->isColumnModified(ProcessPeer::PRO_HEIGHT)) {
+ $criteria->add(ProcessPeer::PRO_HEIGHT, $this->pro_height);
+ }
+ if ($this->isColumnModified(ProcessPeer::PRO_WIDTH)) {
+ $criteria->add(ProcessPeer::PRO_WIDTH, $this->pro_width);
+ }
- /**
- * The value for the pro_type_day field.
- * @var string
- */
- protected $pro_type_day = '0';
+ if ($this->isColumnModified(ProcessPeer::PRO_TITLE_X)) {
+ $criteria->add(ProcessPeer::PRO_TITLE_X, $this->pro_title_x);
+ }
+ if ($this->isColumnModified(ProcessPeer::PRO_TITLE_Y)) {
+ $criteria->add(ProcessPeer::PRO_TITLE_Y, $this->pro_title_y);
+ }
- /**
- * The value for the pro_type field.
- * @var string
- */
- protected $pro_type = 'NORMAL';
+ if ($this->isColumnModified(ProcessPeer::PRO_DEBUG)) {
+ $criteria->add(ProcessPeer::PRO_DEBUG, $this->pro_debug);
+ }
+ if ($this->isColumnModified(ProcessPeer::PRO_DYNAFORMS)) {
+ $criteria->add(ProcessPeer::PRO_DYNAFORMS, $this->pro_dynaforms);
+ }
- /**
- * The value for the pro_assignment field.
- * @var string
- */
- protected $pro_assignment = 'FALSE';
+ if ($this->isColumnModified(ProcessPeer::PRO_DERIVATION_SCREEN_TPL)) {
+ $criteria->add(ProcessPeer::PRO_DERIVATION_SCREEN_TPL, $this->pro_derivation_screen_tpl);
+ }
- /**
- * The value for the pro_show_map field.
- * @var int
- */
- protected $pro_show_map = 1;
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ProcessPeer::DATABASE_NAME);
- /**
- * The value for the pro_show_message field.
- * @var int
- */
- protected $pro_show_message = 1;
+ $criteria->add(ProcessPeer::PRO_UID, $this->pro_uid);
+ return $criteria;
+ }
- /**
- * The value for the pro_show_delegate field.
- * @var int
- */
- protected $pro_show_delegate = 1;
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getProUid();
+ }
+ /**
+ * Generic method to set the primary key (pro_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setProUid($key);
+ }
- /**
- * The value for the pro_show_dynaform field.
- * @var int
- */
- protected $pro_show_dynaform = 0;
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Process (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+ $copyObj->setProParent($this->pro_parent);
- /**
- * The value for the pro_category field.
- * @var string
- */
- protected $pro_category = '';
+ $copyObj->setProTime($this->pro_time);
+ $copyObj->setProTimeunit($this->pro_timeunit);
- /**
- * The value for the pro_sub_category field.
- * @var string
- */
- protected $pro_sub_category = '';
+ $copyObj->setProStatus($this->pro_status);
+ $copyObj->setProTypeDay($this->pro_type_day);
- /**
- * The value for the pro_industry field.
- * @var int
- */
- protected $pro_industry = 1;
+ $copyObj->setProType($this->pro_type);
+ $copyObj->setProAssignment($this->pro_assignment);
- /**
- * The value for the pro_update_date field.
- * @var int
- */
- protected $pro_update_date;
+ $copyObj->setProShowMap($this->pro_show_map);
+ $copyObj->setProShowMessage($this->pro_show_message);
- /**
- * The value for the pro_create_date field.
- * @var int
- */
- protected $pro_create_date;
+ $copyObj->setProShowDelegate($this->pro_show_delegate);
+ $copyObj->setProShowDynaform($this->pro_show_dynaform);
- /**
- * The value for the pro_create_user field.
- * @var string
- */
- protected $pro_create_user = '';
+ $copyObj->setProCategory($this->pro_category);
+ $copyObj->setProSubCategory($this->pro_sub_category);
- /**
- * The value for the pro_height field.
- * @var int
- */
- protected $pro_height = 5000;
+ $copyObj->setProIndustry($this->pro_industry);
+ $copyObj->setProUpdateDate($this->pro_update_date);
- /**
- * The value for the pro_width field.
- * @var int
- */
- protected $pro_width = 10000;
-
+ $copyObj->setProCreateDate($this->pro_create_date);
- /**
- * The value for the pro_title_x field.
- * @var int
- */
- protected $pro_title_x = 0;
-
-
- /**
- * The value for the pro_title_y field.
- * @var int
- */
- protected $pro_title_y = 6;
-
-
- /**
- * The value for the pro_debug field.
- * @var int
- */
- protected $pro_debug = 0;
-
-
- /**
- * The value for the pro_dynaforms field.
- * @var string
- */
- protected $pro_dynaforms;
-
-
- /**
- * The value for the pro_derivation_screen_tpl field.
- * @var string
- */
- protected $pro_derivation_screen_tpl = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [pro_parent] column value.
- *
- * @return string
- */
- public function getProParent()
- {
-
- return $this->pro_parent;
- }
-
- /**
- * Get the [pro_time] column value.
- *
- * @return double
- */
- public function getProTime()
- {
-
- return $this->pro_time;
- }
-
- /**
- * Get the [pro_timeunit] column value.
- *
- * @return string
- */
- public function getProTimeunit()
- {
-
- return $this->pro_timeunit;
- }
-
- /**
- * Get the [pro_status] column value.
- *
- * @return string
- */
- public function getProStatus()
- {
-
- return $this->pro_status;
- }
-
- /**
- * Get the [pro_type_day] column value.
- *
- * @return string
- */
- public function getProTypeDay()
- {
-
- return $this->pro_type_day;
- }
-
- /**
- * Get the [pro_type] column value.
- *
- * @return string
- */
- public function getProType()
- {
-
- return $this->pro_type;
- }
-
- /**
- * Get the [pro_assignment] column value.
- *
- * @return string
- */
- public function getProAssignment()
- {
-
- return $this->pro_assignment;
- }
-
- /**
- * Get the [pro_show_map] column value.
- *
- * @return int
- */
- public function getProShowMap()
- {
-
- return $this->pro_show_map;
- }
-
- /**
- * Get the [pro_show_message] column value.
- *
- * @return int
- */
- public function getProShowMessage()
- {
-
- return $this->pro_show_message;
- }
-
- /**
- * Get the [pro_show_delegate] column value.
- *
- * @return int
- */
- public function getProShowDelegate()
- {
-
- return $this->pro_show_delegate;
- }
-
- /**
- * Get the [pro_show_dynaform] column value.
- *
- * @return int
- */
- public function getProShowDynaform()
- {
-
- return $this->pro_show_dynaform;
- }
-
- /**
- * Get the [pro_category] column value.
- *
- * @return string
- */
- public function getProCategory()
- {
-
- return $this->pro_category;
- }
-
- /**
- * Get the [pro_sub_category] column value.
- *
- * @return string
- */
- public function getProSubCategory()
- {
-
- return $this->pro_sub_category;
- }
-
- /**
- * Get the [pro_industry] column value.
- *
- * @return int
- */
- public function getProIndustry()
- {
-
- return $this->pro_industry;
- }
-
- /**
- * Get the [optionally formatted] [pro_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getProUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->pro_update_date === null || $this->pro_update_date === '') {
- return null;
- } elseif (!is_int($this->pro_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->pro_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [pro_update_date] as date/time value: " . var_export($this->pro_update_date, true));
- }
- } else {
- $ts = $this->pro_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [pro_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getProCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->pro_create_date === null || $this->pro_create_date === '') {
- return null;
- } elseif (!is_int($this->pro_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->pro_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [pro_create_date] as date/time value: " . var_export($this->pro_create_date, true));
- }
- } else {
- $ts = $this->pro_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [pro_create_user] column value.
- *
- * @return string
- */
- public function getProCreateUser()
- {
-
- return $this->pro_create_user;
- }
-
- /**
- * Get the [pro_height] column value.
- *
- * @return int
- */
- public function getProHeight()
- {
-
- return $this->pro_height;
- }
-
- /**
- * Get the [pro_width] column value.
- *
- * @return int
- */
- public function getProWidth()
- {
-
- return $this->pro_width;
- }
-
- /**
- * Get the [pro_title_x] column value.
- *
- * @return int
- */
- public function getProTitleX()
- {
-
- return $this->pro_title_x;
- }
-
- /**
- * Get the [pro_title_y] column value.
- *
- * @return int
- */
- public function getProTitleY()
- {
-
- return $this->pro_title_y;
- }
-
- /**
- * Get the [pro_debug] column value.
- *
- * @return int
- */
- public function getProDebug()
- {
-
- return $this->pro_debug;
- }
-
- /**
- * Get the [pro_dynaforms] column value.
- *
- * @return string
- */
- public function getProDynaforms()
- {
-
- return $this->pro_dynaforms;
- }
-
- /**
- * Get the [pro_derivation_screen_tpl] column value.
- *
- * @return string
- */
- public function getProDerivationScreenTpl()
- {
-
- return $this->pro_derivation_screen_tpl;
- }
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [pro_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_parent !== $v || $v === '0') {
- $this->pro_parent = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_PARENT;
- }
-
- } // setProParent()
-
- /**
- * Set the value of [pro_time] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setProTime($v)
- {
-
- if ($this->pro_time !== $v || $v === 1) {
- $this->pro_time = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_TIME;
- }
-
- } // setProTime()
-
- /**
- * Set the value of [pro_timeunit] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProTimeunit($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_timeunit !== $v || $v === 'DAYS') {
- $this->pro_timeunit = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_TIMEUNIT;
- }
-
- } // setProTimeunit()
-
- /**
- * Set the value of [pro_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_status !== $v || $v === 'ACTIVE') {
- $this->pro_status = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_STATUS;
- }
-
- } // setProStatus()
-
- /**
- * Set the value of [pro_type_day] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProTypeDay($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_type_day !== $v || $v === '0') {
- $this->pro_type_day = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_TYPE_DAY;
- }
-
- } // setProTypeDay()
-
- /**
- * Set the value of [pro_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_type !== $v || $v === 'NORMAL') {
- $this->pro_type = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_TYPE;
- }
-
- } // setProType()
-
- /**
- * Set the value of [pro_assignment] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProAssignment($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_assignment !== $v || $v === 'FALSE') {
- $this->pro_assignment = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_ASSIGNMENT;
- }
-
- } // setProAssignment()
-
- /**
- * Set the value of [pro_show_map] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProShowMap($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->pro_show_map !== $v || $v === 1) {
- $this->pro_show_map = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_MAP;
- }
-
- } // setProShowMap()
-
- /**
- * Set the value of [pro_show_message] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProShowMessage($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->pro_show_message !== $v || $v === 1) {
- $this->pro_show_message = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_MESSAGE;
- }
-
- } // setProShowMessage()
-
- /**
- * Set the value of [pro_show_delegate] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProShowDelegate($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->pro_show_delegate !== $v || $v === 1) {
- $this->pro_show_delegate = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_DELEGATE;
- }
-
- } // setProShowDelegate()
-
- /**
- * Set the value of [pro_show_dynaform] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProShowDynaform($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->pro_show_dynaform !== $v || $v === 0) {
- $this->pro_show_dynaform = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_SHOW_DYNAFORM;
- }
-
- } // setProShowDynaform()
-
- /**
- * Set the value of [pro_category] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProCategory($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_category !== $v || $v === '') {
- $this->pro_category = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_CATEGORY;
- }
-
- } // setProCategory()
-
- /**
- * Set the value of [pro_sub_category] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProSubCategory($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_sub_category !== $v || $v === '') {
- $this->pro_sub_category = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_SUB_CATEGORY;
- }
-
- } // setProSubCategory()
-
- /**
- * Set the value of [pro_industry] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProIndustry($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->pro_industry !== $v || $v === 1) {
- $this->pro_industry = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_INDUSTRY;
- }
-
- } // setProIndustry()
-
- /**
- * Set the value of [pro_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [pro_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->pro_update_date !== $ts) {
- $this->pro_update_date = $ts;
- $this->modifiedColumns[] = ProcessPeer::PRO_UPDATE_DATE;
- }
-
- } // setProUpdateDate()
-
- /**
- * Set the value of [pro_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [pro_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->pro_create_date !== $ts) {
- $this->pro_create_date = $ts;
- $this->modifiedColumns[] = ProcessPeer::PRO_CREATE_DATE;
- }
-
- } // setProCreateDate()
-
- /**
- * Set the value of [pro_create_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProCreateUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_create_user !== $v || $v === '') {
- $this->pro_create_user = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_CREATE_USER;
- }
-
- } // setProCreateUser()
-
- /**
- * Set the value of [pro_height] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProHeight($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->pro_height !== $v || $v === 5000) {
- $this->pro_height = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_HEIGHT;
- }
-
- } // setProHeight()
-
- /**
- * Set the value of [pro_width] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProWidth($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->pro_width !== $v || $v === 10000) {
- $this->pro_width = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_WIDTH;
- }
-
- } // setProWidth()
-
- /**
- * Set the value of [pro_title_x] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProTitleX($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->pro_title_x !== $v || $v === 0) {
- $this->pro_title_x = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_TITLE_X;
- }
-
- } // setProTitleX()
-
- /**
- * Set the value of [pro_title_y] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProTitleY($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->pro_title_y !== $v || $v === 6) {
- $this->pro_title_y = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_TITLE_Y;
- }
-
- } // setProTitleY()
-
- /**
- * Set the value of [pro_debug] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setProDebug($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->pro_debug !== $v || $v === 0) {
- $this->pro_debug = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_DEBUG;
- }
-
- } // setProDebug()
-
- /**
- * Set the value of [pro_dynaforms] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProDynaforms($v)
- {
+ $copyObj->setProCreateUser($this->pro_create_user);
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
+ $copyObj->setProHeight($this->pro_height);
- if ($this->pro_dynaforms !== $v) {
- $this->pro_dynaforms = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_DYNAFORMS;
- }
+ $copyObj->setProWidth($this->pro_width);
- } // setProDynaforms()
+ $copyObj->setProTitleX($this->pro_title_x);
- /**
- * Set the value of [pro_derivation_screen_tpl] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProDerivationScreenTpl($v)
- {
+ $copyObj->setProTitleY($this->pro_title_y);
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
+ $copyObj->setProDebug($this->pro_debug);
- if ($this->pro_derivation_screen_tpl !== $v || $v === '') {
- $this->pro_derivation_screen_tpl = $v;
- $this->modifiedColumns[] = ProcessPeer::PRO_DERIVATION_SCREEN_TPL;
- }
+ $copyObj->setProDynaforms($this->pro_dynaforms);
- } // setProDerivationScreenTpl()
+ $copyObj->setProDerivationScreenTpl($this->pro_derivation_screen_tpl);
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->pro_uid = $rs->getString($startcol + 0);
-
- $this->pro_parent = $rs->getString($startcol + 1);
-
- $this->pro_time = $rs->getFloat($startcol + 2);
-
- $this->pro_timeunit = $rs->getString($startcol + 3);
-
- $this->pro_status = $rs->getString($startcol + 4);
-
- $this->pro_type_day = $rs->getString($startcol + 5);
-
- $this->pro_type = $rs->getString($startcol + 6);
-
- $this->pro_assignment = $rs->getString($startcol + 7);
-
- $this->pro_show_map = $rs->getInt($startcol + 8);
-
- $this->pro_show_message = $rs->getInt($startcol + 9);
-
- $this->pro_show_delegate = $rs->getInt($startcol + 10);
-
- $this->pro_show_dynaform = $rs->getInt($startcol + 11);
-
- $this->pro_category = $rs->getString($startcol + 12);
-
- $this->pro_sub_category = $rs->getString($startcol + 13);
-
- $this->pro_industry = $rs->getInt($startcol + 14);
-
- $this->pro_update_date = $rs->getTimestamp($startcol + 15, null);
-
- $this->pro_create_date = $rs->getTimestamp($startcol + 16, null);
-
- $this->pro_create_user = $rs->getString($startcol + 17);
-
- $this->pro_height = $rs->getInt($startcol + 18);
-
- $this->pro_width = $rs->getInt($startcol + 19);
-
- $this->pro_title_x = $rs->getInt($startcol + 20);
-
- $this->pro_title_y = $rs->getInt($startcol + 21);
-
- $this->pro_debug = $rs->getInt($startcol + 22);
-
- $this->pro_dynaforms = $rs->getString($startcol + 23);
-
- $this->pro_derivation_screen_tpl = $rs->getString($startcol + 24);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 25; // 25 = ProcessPeer::NUM_COLUMNS - ProcessPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Process object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ProcessPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ProcessPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ProcessPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ProcessPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getProUid();
- break;
- case 1:
- return $this->getProParent();
- break;
- case 2:
- return $this->getProTime();
- break;
- case 3:
- return $this->getProTimeunit();
- break;
- case 4:
- return $this->getProStatus();
- break;
- case 5:
- return $this->getProTypeDay();
- break;
- case 6:
- return $this->getProType();
- break;
- case 7:
- return $this->getProAssignment();
- break;
- case 8:
- return $this->getProShowMap();
- break;
- case 9:
- return $this->getProShowMessage();
- break;
- case 10:
- return $this->getProShowDelegate();
- break;
- case 11:
- return $this->getProShowDynaform();
- break;
- case 12:
- return $this->getProCategory();
- break;
- case 13:
- return $this->getProSubCategory();
- break;
- case 14:
- return $this->getProIndustry();
- break;
- case 15:
- return $this->getProUpdateDate();
- break;
- case 16:
- return $this->getProCreateDate();
- break;
- case 17:
- return $this->getProCreateUser();
- break;
- case 18:
- return $this->getProHeight();
- break;
- case 19:
- return $this->getProWidth();
- break;
- case 20:
- return $this->getProTitleX();
- break;
- case 21:
- return $this->getProTitleY();
- break;
- case 22:
- return $this->getProDebug();
- break;
- case 23:
- return $this->getProDynaforms();
- break;
- case 24:
- return $this->getProDerivationScreenTpl();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getProUid(),
- $keys[1] => $this->getProParent(),
- $keys[2] => $this->getProTime(),
- $keys[3] => $this->getProTimeunit(),
- $keys[4] => $this->getProStatus(),
- $keys[5] => $this->getProTypeDay(),
- $keys[6] => $this->getProType(),
- $keys[7] => $this->getProAssignment(),
- $keys[8] => $this->getProShowMap(),
- $keys[9] => $this->getProShowMessage(),
- $keys[10] => $this->getProShowDelegate(),
- $keys[11] => $this->getProShowDynaform(),
- $keys[12] => $this->getProCategory(),
- $keys[13] => $this->getProSubCategory(),
- $keys[14] => $this->getProIndustry(),
- $keys[15] => $this->getProUpdateDate(),
- $keys[16] => $this->getProCreateDate(),
- $keys[17] => $this->getProCreateUser(),
- $keys[18] => $this->getProHeight(),
- $keys[19] => $this->getProWidth(),
- $keys[20] => $this->getProTitleX(),
- $keys[21] => $this->getProTitleY(),
- $keys[22] => $this->getProDebug(),
- $keys[23] => $this->getProDynaforms(),
- $keys[24] => $this->getProDerivationScreenTpl(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setProUid($value);
- break;
- case 1:
- $this->setProParent($value);
- break;
- case 2:
- $this->setProTime($value);
- break;
- case 3:
- $this->setProTimeunit($value);
- break;
- case 4:
- $this->setProStatus($value);
- break;
- case 5:
- $this->setProTypeDay($value);
- break;
- case 6:
- $this->setProType($value);
- break;
- case 7:
- $this->setProAssignment($value);
- break;
- case 8:
- $this->setProShowMap($value);
- break;
- case 9:
- $this->setProShowMessage($value);
- break;
- case 10:
- $this->setProShowDelegate($value);
- break;
- case 11:
- $this->setProShowDynaform($value);
- break;
- case 12:
- $this->setProCategory($value);
- break;
- case 13:
- $this->setProSubCategory($value);
- break;
- case 14:
- $this->setProIndustry($value);
- break;
- case 15:
- $this->setProUpdateDate($value);
- break;
- case 16:
- $this->setProCreateDate($value);
- break;
- case 17:
- $this->setProCreateUser($value);
- break;
- case 18:
- $this->setProHeight($value);
- break;
- case 19:
- $this->setProWidth($value);
- break;
- case 20:
- $this->setProTitleX($value);
- break;
- case 21:
- $this->setProTitleY($value);
- break;
- case 22:
- $this->setProDebug($value);
- break;
- case 23:
- $this->setProDynaforms($value);
- break;
- case 24:
- $this->setProDerivationScreenTpl($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setProUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProParent($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setProTime($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setProTimeunit($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setProStatus($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setProTypeDay($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setProType($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setProAssignment($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setProShowMap($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setProShowMessage($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setProShowDelegate($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setProShowDynaform($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setProCategory($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setProSubCategory($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setProIndustry($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setProUpdateDate($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setProCreateDate($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setProCreateUser($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setProHeight($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setProWidth($arr[$keys[19]]);
- if (array_key_exists($keys[20], $arr)) $this->setProTitleX($arr[$keys[20]]);
- if (array_key_exists($keys[21], $arr)) $this->setProTitleY($arr[$keys[21]]);
- if (array_key_exists($keys[22], $arr)) $this->setProDebug($arr[$keys[22]]);
- if (array_key_exists($keys[23], $arr)) $this->setProDynaforms($arr[$keys[23]]);
- if (array_key_exists($keys[24], $arr)) $this->setProDerivationScreenTpl($arr[$keys[24]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ProcessPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ProcessPeer::PRO_UID)) $criteria->add(ProcessPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(ProcessPeer::PRO_PARENT)) $criteria->add(ProcessPeer::PRO_PARENT, $this->pro_parent);
- if ($this->isColumnModified(ProcessPeer::PRO_TIME)) $criteria->add(ProcessPeer::PRO_TIME, $this->pro_time);
- if ($this->isColumnModified(ProcessPeer::PRO_TIMEUNIT)) $criteria->add(ProcessPeer::PRO_TIMEUNIT, $this->pro_timeunit);
- if ($this->isColumnModified(ProcessPeer::PRO_STATUS)) $criteria->add(ProcessPeer::PRO_STATUS, $this->pro_status);
- if ($this->isColumnModified(ProcessPeer::PRO_TYPE_DAY)) $criteria->add(ProcessPeer::PRO_TYPE_DAY, $this->pro_type_day);
- if ($this->isColumnModified(ProcessPeer::PRO_TYPE)) $criteria->add(ProcessPeer::PRO_TYPE, $this->pro_type);
- if ($this->isColumnModified(ProcessPeer::PRO_ASSIGNMENT)) $criteria->add(ProcessPeer::PRO_ASSIGNMENT, $this->pro_assignment);
- if ($this->isColumnModified(ProcessPeer::PRO_SHOW_MAP)) $criteria->add(ProcessPeer::PRO_SHOW_MAP, $this->pro_show_map);
- if ($this->isColumnModified(ProcessPeer::PRO_SHOW_MESSAGE)) $criteria->add(ProcessPeer::PRO_SHOW_MESSAGE, $this->pro_show_message);
- if ($this->isColumnModified(ProcessPeer::PRO_SHOW_DELEGATE)) $criteria->add(ProcessPeer::PRO_SHOW_DELEGATE, $this->pro_show_delegate);
- if ($this->isColumnModified(ProcessPeer::PRO_SHOW_DYNAFORM)) $criteria->add(ProcessPeer::PRO_SHOW_DYNAFORM, $this->pro_show_dynaform);
- if ($this->isColumnModified(ProcessPeer::PRO_CATEGORY)) $criteria->add(ProcessPeer::PRO_CATEGORY, $this->pro_category);
- if ($this->isColumnModified(ProcessPeer::PRO_SUB_CATEGORY)) $criteria->add(ProcessPeer::PRO_SUB_CATEGORY, $this->pro_sub_category);
- if ($this->isColumnModified(ProcessPeer::PRO_INDUSTRY)) $criteria->add(ProcessPeer::PRO_INDUSTRY, $this->pro_industry);
- if ($this->isColumnModified(ProcessPeer::PRO_UPDATE_DATE)) $criteria->add(ProcessPeer::PRO_UPDATE_DATE, $this->pro_update_date);
- if ($this->isColumnModified(ProcessPeer::PRO_CREATE_DATE)) $criteria->add(ProcessPeer::PRO_CREATE_DATE, $this->pro_create_date);
- if ($this->isColumnModified(ProcessPeer::PRO_CREATE_USER)) $criteria->add(ProcessPeer::PRO_CREATE_USER, $this->pro_create_user);
- if ($this->isColumnModified(ProcessPeer::PRO_HEIGHT)) $criteria->add(ProcessPeer::PRO_HEIGHT, $this->pro_height);
- if ($this->isColumnModified(ProcessPeer::PRO_WIDTH)) $criteria->add(ProcessPeer::PRO_WIDTH, $this->pro_width);
- if ($this->isColumnModified(ProcessPeer::PRO_TITLE_X)) $criteria->add(ProcessPeer::PRO_TITLE_X, $this->pro_title_x);
- if ($this->isColumnModified(ProcessPeer::PRO_TITLE_Y)) $criteria->add(ProcessPeer::PRO_TITLE_Y, $this->pro_title_y);
- if ($this->isColumnModified(ProcessPeer::PRO_DEBUG)) $criteria->add(ProcessPeer::PRO_DEBUG, $this->pro_debug);
- if ($this->isColumnModified(ProcessPeer::PRO_DYNAFORMS)) $criteria->add(ProcessPeer::PRO_DYNAFORMS, $this->pro_dynaforms);
- if ($this->isColumnModified(ProcessPeer::PRO_DERIVATION_SCREEN_TPL)) $criteria->add(ProcessPeer::PRO_DERIVATION_SCREEN_TPL, $this->pro_derivation_screen_tpl);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ProcessPeer::DATABASE_NAME);
-
- $criteria->add(ProcessPeer::PRO_UID, $this->pro_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getProUid();
- }
-
- /**
- * Generic method to set the primary key (pro_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setProUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Process (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProParent($this->pro_parent);
-
- $copyObj->setProTime($this->pro_time);
-
- $copyObj->setProTimeunit($this->pro_timeunit);
-
- $copyObj->setProStatus($this->pro_status);
-
- $copyObj->setProTypeDay($this->pro_type_day);
-
- $copyObj->setProType($this->pro_type);
-
- $copyObj->setProAssignment($this->pro_assignment);
-
- $copyObj->setProShowMap($this->pro_show_map);
-
- $copyObj->setProShowMessage($this->pro_show_message);
-
- $copyObj->setProShowDelegate($this->pro_show_delegate);
-
- $copyObj->setProShowDynaform($this->pro_show_dynaform);
-
- $copyObj->setProCategory($this->pro_category);
-
- $copyObj->setProSubCategory($this->pro_sub_category);
-
- $copyObj->setProIndustry($this->pro_industry);
-
- $copyObj->setProUpdateDate($this->pro_update_date);
-
- $copyObj->setProCreateDate($this->pro_create_date);
-
- $copyObj->setProCreateUser($this->pro_create_user);
-
- $copyObj->setProHeight($this->pro_height);
-
- $copyObj->setProWidth($this->pro_width);
-
- $copyObj->setProTitleX($this->pro_title_x);
- $copyObj->setProTitleY($this->pro_title_y);
+ $copyObj->setNew(true);
- $copyObj->setProDebug($this->pro_debug);
+ $copyObj->setProUid(''); // this is a pkey column, so set to default value
- $copyObj->setProDynaforms($this->pro_dynaforms);
+ }
- $copyObj->setProDerivationScreenTpl($this->pro_derivation_screen_tpl);
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Process Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ProcessPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ProcessPeer();
+ }
+ return self::$peer;
+ }
+}
- $copyObj->setNew(true);
-
- $copyObj->setProUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Process Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ProcessPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ProcessPeer();
- }
- return self::$peer;
- }
-
-} // BaseProcess
diff --git a/workflow/engine/classes/model/om/BaseProcessCategory.php b/workflow/engine/classes/model/om/BaseProcessCategory.php
index 72dfa2f46..e5e9291f4 100755
--- a/workflow/engine/classes/model/om/BaseProcessCategory.php
+++ b/workflow/engine/classes/model/om/BaseProcessCategory.php
@@ -16,648 +16,669 @@ include_once 'classes/model/ProcessCategoryPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcessCategory extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ProcessCategoryPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the category_uid field.
- * @var string
- */
- protected $category_uid = '';
-
-
- /**
- * The value for the category_parent field.
- * @var string
- */
- protected $category_parent = '0';
-
-
- /**
- * The value for the category_name field.
- * @var string
- */
- protected $category_name = '';
-
-
- /**
- * The value for the category_icon field.
- * @var string
- */
- protected $category_icon = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [category_uid] column value.
- *
- * @return string
- */
- public function getCategoryUid()
- {
-
- return $this->category_uid;
- }
-
- /**
- * Get the [category_parent] column value.
- *
- * @return string
- */
- public function getCategoryParent()
- {
-
- return $this->category_parent;
- }
-
- /**
- * Get the [category_name] column value.
- *
- * @return string
- */
- public function getCategoryName()
- {
-
- return $this->category_name;
- }
-
- /**
- * Get the [category_icon] column value.
- *
- * @return string
- */
- public function getCategoryIcon()
- {
-
- return $this->category_icon;
- }
-
- /**
- * Set the value of [category_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCategoryUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->category_uid !== $v || $v === '') {
- $this->category_uid = $v;
- $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_UID;
- }
-
- } // setCategoryUid()
-
- /**
- * Set the value of [category_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCategoryParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->category_parent !== $v || $v === '0') {
- $this->category_parent = $v;
- $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_PARENT;
- }
-
- } // setCategoryParent()
-
- /**
- * Set the value of [category_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCategoryName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->category_name !== $v || $v === '') {
- $this->category_name = $v;
- $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_NAME;
- }
-
- } // setCategoryName()
-
- /**
- * Set the value of [category_icon] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setCategoryIcon($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->category_icon !== $v || $v === '') {
- $this->category_icon = $v;
- $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_ICON;
- }
-
- } // setCategoryIcon()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->category_uid = $rs->getString($startcol + 0);
-
- $this->category_parent = $rs->getString($startcol + 1);
-
- $this->category_name = $rs->getString($startcol + 2);
-
- $this->category_icon = $rs->getString($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = ProcessCategoryPeer::NUM_COLUMNS - ProcessCategoryPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating ProcessCategory object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessCategoryPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ProcessCategoryPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessCategoryPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ProcessCategoryPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ProcessCategoryPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ProcessCategoryPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessCategoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getCategoryUid();
- break;
- case 1:
- return $this->getCategoryParent();
- break;
- case 2:
- return $this->getCategoryName();
- break;
- case 3:
- return $this->getCategoryIcon();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessCategoryPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getCategoryUid(),
- $keys[1] => $this->getCategoryParent(),
- $keys[2] => $this->getCategoryName(),
- $keys[3] => $this->getCategoryIcon(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessCategoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setCategoryUid($value);
- break;
- case 1:
- $this->setCategoryParent($value);
- break;
- case 2:
- $this->setCategoryName($value);
- break;
- case 3:
- $this->setCategoryIcon($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessCategoryPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setCategoryUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setCategoryParent($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setCategoryName($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setCategoryIcon($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ProcessCategoryPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_UID)) $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $this->category_uid);
- if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_PARENT)) $criteria->add(ProcessCategoryPeer::CATEGORY_PARENT, $this->category_parent);
- if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_NAME)) $criteria->add(ProcessCategoryPeer::CATEGORY_NAME, $this->category_name);
- if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_ICON)) $criteria->add(ProcessCategoryPeer::CATEGORY_ICON, $this->category_icon);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ProcessCategoryPeer::DATABASE_NAME);
-
- $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $this->category_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getCategoryUid();
- }
-
- /**
- * Generic method to set the primary key (category_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setCategoryUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of ProcessCategory (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setCategoryParent($this->category_parent);
-
- $copyObj->setCategoryName($this->category_name);
-
- $copyObj->setCategoryIcon($this->category_icon);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setCategoryUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return ProcessCategory Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ProcessCategoryPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ProcessCategoryPeer();
- }
- return self::$peer;
- }
-
-} // BaseProcessCategory
+abstract class BaseProcessCategory extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ProcessCategoryPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the category_uid field.
+ * @var string
+ */
+ protected $category_uid = '';
+
+ /**
+ * The value for the category_parent field.
+ * @var string
+ */
+ protected $category_parent = '0';
+
+ /**
+ * The value for the category_name field.
+ * @var string
+ */
+ protected $category_name = '';
+
+ /**
+ * The value for the category_icon field.
+ * @var string
+ */
+ protected $category_icon = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [category_uid] column value.
+ *
+ * @return string
+ */
+ public function getCategoryUid()
+ {
+
+ return $this->category_uid;
+ }
+
+ /**
+ * Get the [category_parent] column value.
+ *
+ * @return string
+ */
+ public function getCategoryParent()
+ {
+
+ return $this->category_parent;
+ }
+
+ /**
+ * Get the [category_name] column value.
+ *
+ * @return string
+ */
+ public function getCategoryName()
+ {
+
+ return $this->category_name;
+ }
+
+ /**
+ * Get the [category_icon] column value.
+ *
+ * @return string
+ */
+ public function getCategoryIcon()
+ {
+
+ return $this->category_icon;
+ }
+
+ /**
+ * Set the value of [category_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCategoryUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->category_uid !== $v || $v === '') {
+ $this->category_uid = $v;
+ $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_UID;
+ }
+
+ } // setCategoryUid()
+
+ /**
+ * Set the value of [category_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCategoryParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->category_parent !== $v || $v === '0') {
+ $this->category_parent = $v;
+ $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_PARENT;
+ }
+
+ } // setCategoryParent()
+
+ /**
+ * Set the value of [category_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCategoryName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->category_name !== $v || $v === '') {
+ $this->category_name = $v;
+ $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_NAME;
+ }
+
+ } // setCategoryName()
+
+ /**
+ * Set the value of [category_icon] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setCategoryIcon($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->category_icon !== $v || $v === '') {
+ $this->category_icon = $v;
+ $this->modifiedColumns[] = ProcessCategoryPeer::CATEGORY_ICON;
+ }
+
+ } // setCategoryIcon()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->category_uid = $rs->getString($startcol + 0);
+
+ $this->category_parent = $rs->getString($startcol + 1);
+
+ $this->category_name = $rs->getString($startcol + 2);
+
+ $this->category_icon = $rs->getString($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = ProcessCategoryPeer::NUM_COLUMNS - ProcessCategoryPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating ProcessCategory object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessCategoryPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ProcessCategoryPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessCategoryPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ProcessCategoryPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ProcessCategoryPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ProcessCategoryPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessCategoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getCategoryUid();
+ break;
+ case 1:
+ return $this->getCategoryParent();
+ break;
+ case 2:
+ return $this->getCategoryName();
+ break;
+ case 3:
+ return $this->getCategoryIcon();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessCategoryPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getCategoryUid(),
+ $keys[1] => $this->getCategoryParent(),
+ $keys[2] => $this->getCategoryName(),
+ $keys[3] => $this->getCategoryIcon(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessCategoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setCategoryUid($value);
+ break;
+ case 1:
+ $this->setCategoryParent($value);
+ break;
+ case 2:
+ $this->setCategoryName($value);
+ break;
+ case 3:
+ $this->setCategoryIcon($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessCategoryPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setCategoryUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setCategoryParent($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setCategoryName($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setCategoryIcon($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ProcessCategoryPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_UID)) {
+ $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $this->category_uid);
+ }
+
+ if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_PARENT)) {
+ $criteria->add(ProcessCategoryPeer::CATEGORY_PARENT, $this->category_parent);
+ }
+
+ if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_NAME)) {
+ $criteria->add(ProcessCategoryPeer::CATEGORY_NAME, $this->category_name);
+ }
+
+ if ($this->isColumnModified(ProcessCategoryPeer::CATEGORY_ICON)) {
+ $criteria->add(ProcessCategoryPeer::CATEGORY_ICON, $this->category_icon);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ProcessCategoryPeer::DATABASE_NAME);
+
+ $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $this->category_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getCategoryUid();
+ }
+
+ /**
+ * Generic method to set the primary key (category_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setCategoryUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of ProcessCategory (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setCategoryParent($this->category_parent);
+
+ $copyObj->setCategoryName($this->category_name);
+
+ $copyObj->setCategoryIcon($this->category_icon);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setCategoryUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return ProcessCategory Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ProcessCategoryPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ProcessCategoryPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseProcessCategoryPeer.php b/workflow/engine/classes/model/om/BaseProcessCategoryPeer.php
index fb5c8e252..bca9cae20 100755
--- a/workflow/engine/classes/model/om/BaseProcessCategoryPeer.php
+++ b/workflow/engine/classes/model/om/BaseProcessCategoryPeer.php
@@ -12,569 +12,571 @@ include_once 'classes/model/ProcessCategory.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcessCategoryPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'PROCESS_CATEGORY';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.ProcessCategory';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the CATEGORY_UID field */
- const CATEGORY_UID = 'PROCESS_CATEGORY.CATEGORY_UID';
-
- /** the column name for the CATEGORY_PARENT field */
- const CATEGORY_PARENT = 'PROCESS_CATEGORY.CATEGORY_PARENT';
-
- /** the column name for the CATEGORY_NAME field */
- const CATEGORY_NAME = 'PROCESS_CATEGORY.CATEGORY_NAME';
-
- /** the column name for the CATEGORY_ICON field */
- const CATEGORY_ICON = 'PROCESS_CATEGORY.CATEGORY_ICON';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('CategoryUid', 'CategoryParent', 'CategoryName', 'CategoryIcon', ),
- BasePeer::TYPE_COLNAME => array (ProcessCategoryPeer::CATEGORY_UID, ProcessCategoryPeer::CATEGORY_PARENT, ProcessCategoryPeer::CATEGORY_NAME, ProcessCategoryPeer::CATEGORY_ICON, ),
- BasePeer::TYPE_FIELDNAME => array ('CATEGORY_UID', 'CATEGORY_PARENT', 'CATEGORY_NAME', 'CATEGORY_ICON', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('CategoryUid' => 0, 'CategoryParent' => 1, 'CategoryName' => 2, 'CategoryIcon' => 3, ),
- BasePeer::TYPE_COLNAME => array (ProcessCategoryPeer::CATEGORY_UID => 0, ProcessCategoryPeer::CATEGORY_PARENT => 1, ProcessCategoryPeer::CATEGORY_NAME => 2, ProcessCategoryPeer::CATEGORY_ICON => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('CATEGORY_UID' => 0, 'CATEGORY_PARENT' => 1, 'CATEGORY_NAME' => 2, 'CATEGORY_ICON' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ProcessCategoryMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ProcessCategoryMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ProcessCategoryPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ProcessCategoryPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ProcessCategoryPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
-
- $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_PARENT);
-
- $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
-
- $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_ICON);
-
- }
-
- const COUNT = 'COUNT(PROCESS_CATEGORY.CATEGORY_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS_CATEGORY.CATEGORY_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ProcessCategoryPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ProcessCategoryPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ProcessCategoryPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return ProcessCategory
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ProcessCategoryPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ProcessCategoryPeer::populateObjects(ProcessCategoryPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ProcessCategoryPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ProcessCategoryPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ProcessCategoryPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a ProcessCategory or Criteria object.
- *
- * @param mixed $values Criteria or ProcessCategory object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from ProcessCategory object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a ProcessCategory or Criteria object.
- *
- * @param mixed $values Criteria or ProcessCategory object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ProcessCategoryPeer::CATEGORY_UID);
- $selectCriteria->add(ProcessCategoryPeer::CATEGORY_UID, $criteria->remove(ProcessCategoryPeer::CATEGORY_UID), $comparison);
-
- } else { // $values is ProcessCategory object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the PROCESS_CATEGORY table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ProcessCategoryPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a ProcessCategory or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ProcessCategory object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ProcessCategoryPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof ProcessCategory) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ProcessCategoryPeer::CATEGORY_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given ProcessCategory object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param ProcessCategory $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(ProcessCategory $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ProcessCategoryPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ProcessCategoryPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(ProcessCategoryPeer::DATABASE_NAME, ProcessCategoryPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return ProcessCategory
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ProcessCategoryPeer::DATABASE_NAME);
-
- $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $pk);
-
-
- $v = ProcessCategoryPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $pks, Criteria::IN);
- $objs = ProcessCategoryPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseProcessCategoryPeer
+abstract class BaseProcessCategoryPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'PROCESS_CATEGORY';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.ProcessCategory';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the CATEGORY_UID field */
+ const CATEGORY_UID = 'PROCESS_CATEGORY.CATEGORY_UID';
+
+ /** the column name for the CATEGORY_PARENT field */
+ const CATEGORY_PARENT = 'PROCESS_CATEGORY.CATEGORY_PARENT';
+
+ /** the column name for the CATEGORY_NAME field */
+ const CATEGORY_NAME = 'PROCESS_CATEGORY.CATEGORY_NAME';
+
+ /** the column name for the CATEGORY_ICON field */
+ const CATEGORY_ICON = 'PROCESS_CATEGORY.CATEGORY_ICON';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('CategoryUid', 'CategoryParent', 'CategoryName', 'CategoryIcon', ),
+ BasePeer::TYPE_COLNAME => array (ProcessCategoryPeer::CATEGORY_UID, ProcessCategoryPeer::CATEGORY_PARENT, ProcessCategoryPeer::CATEGORY_NAME, ProcessCategoryPeer::CATEGORY_ICON, ),
+ BasePeer::TYPE_FIELDNAME => array ('CATEGORY_UID', 'CATEGORY_PARENT', 'CATEGORY_NAME', 'CATEGORY_ICON', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('CategoryUid' => 0, 'CategoryParent' => 1, 'CategoryName' => 2, 'CategoryIcon' => 3, ),
+ BasePeer::TYPE_COLNAME => array (ProcessCategoryPeer::CATEGORY_UID => 0, ProcessCategoryPeer::CATEGORY_PARENT => 1, ProcessCategoryPeer::CATEGORY_NAME => 2, ProcessCategoryPeer::CATEGORY_ICON => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('CATEGORY_UID' => 0, 'CATEGORY_PARENT' => 1, 'CATEGORY_NAME' => 2, 'CATEGORY_ICON' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ProcessCategoryMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ProcessCategoryMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ProcessCategoryPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ProcessCategoryPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ProcessCategoryPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
+
+ $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_PARENT);
+
+ $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
+
+ $criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_ICON);
+
+ }
+
+ const COUNT = 'COUNT(PROCESS_CATEGORY.CATEGORY_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS_CATEGORY.CATEGORY_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ProcessCategoryPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ProcessCategoryPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ProcessCategoryPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return ProcessCategory
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ProcessCategoryPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ProcessCategoryPeer::populateObjects(ProcessCategoryPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ProcessCategoryPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ProcessCategoryPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ProcessCategoryPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a ProcessCategory or Criteria object.
+ *
+ * @param mixed $values Criteria or ProcessCategory object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from ProcessCategory object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a ProcessCategory or Criteria object.
+ *
+ * @param mixed $values Criteria or ProcessCategory object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ProcessCategoryPeer::CATEGORY_UID);
+ $selectCriteria->add(ProcessCategoryPeer::CATEGORY_UID, $criteria->remove(ProcessCategoryPeer::CATEGORY_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the PROCESS_CATEGORY table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ProcessCategoryPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a ProcessCategory or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ProcessCategory object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessCategoryPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof ProcessCategory) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ProcessCategoryPeer::CATEGORY_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given ProcessCategory object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param ProcessCategory $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(ProcessCategory $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ProcessCategoryPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ProcessCategoryPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(ProcessCategoryPeer::DATABASE_NAME, ProcessCategoryPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return ProcessCategory
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ProcessCategoryPeer::DATABASE_NAME);
+
+ $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $pk);
+
+
+ $v = ProcessCategoryPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ProcessCategoryPeer::CATEGORY_UID, $pks, Criteria::IN);
+ $objs = ProcessCategoryPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseProcessCategoryPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseProcessCategoryPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ProcessCategoryMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ProcessCategoryMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ProcessCategoryMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ProcessCategoryMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseProcessOwner.php b/workflow/engine/classes/model/om/BaseProcessOwner.php
index d21f99a86..ac370ff70 100755
--- a/workflow/engine/classes/model/om/BaseProcessOwner.php
+++ b/workflow/engine/classes/model/om/BaseProcessOwner.php
@@ -16,554 +16,565 @@ include_once 'classes/model/ProcessOwnerPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcessOwner extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ProcessOwnerPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the own_uid field.
- * @var string
- */
- protected $own_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [own_uid] column value.
- *
- * @return string
- */
- public function getOwnUid()
- {
-
- return $this->own_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Set the value of [own_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setOwnUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->own_uid !== $v || $v === '') {
- $this->own_uid = $v;
- $this->modifiedColumns[] = ProcessOwnerPeer::OWN_UID;
- }
-
- } // setOwnUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ProcessOwnerPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->own_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 2; // 2 = ProcessOwnerPeer::NUM_COLUMNS - ProcessOwnerPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating ProcessOwner object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessOwnerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ProcessOwnerPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessOwnerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ProcessOwnerPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ProcessOwnerPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ProcessOwnerPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getOwnUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessOwnerPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getOwnUid(),
- $keys[1] => $this->getProUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setOwnUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessOwnerPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setOwnUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ProcessOwnerPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ProcessOwnerPeer::OWN_UID)) $criteria->add(ProcessOwnerPeer::OWN_UID, $this->own_uid);
- if ($this->isColumnModified(ProcessOwnerPeer::PRO_UID)) $criteria->add(ProcessOwnerPeer::PRO_UID, $this->pro_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ProcessOwnerPeer::DATABASE_NAME);
-
- $criteria->add(ProcessOwnerPeer::OWN_UID, $this->own_uid);
- $criteria->add(ProcessOwnerPeer::PRO_UID, $this->pro_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getOwnUid();
-
- $pks[1] = $this->getProUid();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setOwnUid($keys[0]);
-
- $this->setProUid($keys[1]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of ProcessOwner (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
-
- $copyObj->setNew(true);
-
- $copyObj->setOwnUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setProUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return ProcessOwner Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ProcessOwnerPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ProcessOwnerPeer();
- }
- return self::$peer;
- }
-
-} // BaseProcessOwner
+abstract class BaseProcessOwner extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ProcessOwnerPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the own_uid field.
+ * @var string
+ */
+ protected $own_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [own_uid] column value.
+ *
+ * @return string
+ */
+ public function getOwnUid()
+ {
+
+ return $this->own_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Set the value of [own_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setOwnUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->own_uid !== $v || $v === '') {
+ $this->own_uid = $v;
+ $this->modifiedColumns[] = ProcessOwnerPeer::OWN_UID;
+ }
+
+ } // setOwnUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ProcessOwnerPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->own_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 2; // 2 = ProcessOwnerPeer::NUM_COLUMNS - ProcessOwnerPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating ProcessOwner object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessOwnerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ProcessOwnerPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessOwnerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ProcessOwnerPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ProcessOwnerPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ProcessOwnerPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getOwnUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessOwnerPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getOwnUid(),
+ $keys[1] => $this->getProUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessOwnerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setOwnUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessOwnerPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setOwnUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ProcessOwnerPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ProcessOwnerPeer::OWN_UID)) {
+ $criteria->add(ProcessOwnerPeer::OWN_UID, $this->own_uid);
+ }
+
+ if ($this->isColumnModified(ProcessOwnerPeer::PRO_UID)) {
+ $criteria->add(ProcessOwnerPeer::PRO_UID, $this->pro_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ProcessOwnerPeer::DATABASE_NAME);
+
+ $criteria->add(ProcessOwnerPeer::OWN_UID, $this->own_uid);
+ $criteria->add(ProcessOwnerPeer::PRO_UID, $this->pro_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getOwnUid();
+
+ $pks[1] = $this->getProUid();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setOwnUid($keys[0]);
+
+ $this->setProUid($keys[1]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of ProcessOwner (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setOwnUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setProUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return ProcessOwner Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ProcessOwnerPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ProcessOwnerPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseProcessOwnerPeer.php b/workflow/engine/classes/model/om/BaseProcessOwnerPeer.php
index 6d78d47e5..ad702f664 100755
--- a/workflow/engine/classes/model/om/BaseProcessOwnerPeer.php
+++ b/workflow/engine/classes/model/om/BaseProcessOwnerPeer.php
@@ -12,550 +12,551 @@ include_once 'classes/model/ProcessOwner.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcessOwnerPeer {
+abstract class BaseProcessOwnerPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'PROCESS_OWNER';
+ /** the table name for this class */
+ const TABLE_NAME = 'PROCESS_OWNER';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.ProcessOwner';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.ProcessOwner';
- /** The total number of columns. */
- const NUM_COLUMNS = 2;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 2;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the OWN_UID field */
- const OWN_UID = 'PROCESS_OWNER.OWN_UID';
+ /** the column name for the OWN_UID field */
+ const OWN_UID = 'PROCESS_OWNER.OWN_UID';
- /** the column name for the PRO_UID field */
- const PRO_UID = 'PROCESS_OWNER.PRO_UID';
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'PROCESS_OWNER.PRO_UID';
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('OwnUid', 'ProUid', ),
- BasePeer::TYPE_COLNAME => array (ProcessOwnerPeer::OWN_UID, ProcessOwnerPeer::PRO_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('OWN_UID', 'PRO_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, )
- );
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('OwnUid', 'ProUid', ),
+ BasePeer::TYPE_COLNAME => array (ProcessOwnerPeer::OWN_UID, ProcessOwnerPeer::PRO_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('OWN_UID', 'PRO_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, )
+ );
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('OwnUid' => 0, 'ProUid' => 1, ),
- BasePeer::TYPE_COLNAME => array (ProcessOwnerPeer::OWN_UID => 0, ProcessOwnerPeer::PRO_UID => 1, ),
- BasePeer::TYPE_FIELDNAME => array ('OWN_UID' => 0, 'PRO_UID' => 1, ),
- BasePeer::TYPE_NUM => array (0, 1, )
- );
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('OwnUid' => 0, 'ProUid' => 1, ),
+ BasePeer::TYPE_COLNAME => array (ProcessOwnerPeer::OWN_UID => 0, ProcessOwnerPeer::PRO_UID => 1, ),
+ BasePeer::TYPE_FIELDNAME => array ('OWN_UID' => 0, 'PRO_UID' => 1, ),
+ BasePeer::TYPE_NUM => array (0, 1, )
+ );
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ProcessOwnerMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ProcessOwnerMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ProcessOwnerPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ProcessOwnerMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ProcessOwnerMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ProcessOwnerPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ProcessOwnerPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ProcessOwnerPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ProcessOwnerPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ProcessOwnerPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(ProcessOwnerPeer::OWN_UID);
+ $criteria->addSelectColumn(ProcessOwnerPeer::OWN_UID);
- $criteria->addSelectColumn(ProcessOwnerPeer::PRO_UID);
+ $criteria->addSelectColumn(ProcessOwnerPeer::PRO_UID);
- }
+ }
- const COUNT = 'COUNT(PROCESS_OWNER.OWN_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS_OWNER.OWN_UID)';
+ const COUNT = 'COUNT(PROCESS_OWNER.OWN_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS_OWNER.OWN_UID)';
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ProcessOwnerPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ProcessOwnerPeer::COUNT);
- }
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ProcessOwnerPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ProcessOwnerPeer::COUNT);
+ }
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
- $rs = ProcessOwnerPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return ProcessOwner
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ProcessOwnerPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ProcessOwnerPeer::populateObjects(ProcessOwnerPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $rs = ProcessOwnerPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return ProcessOwner
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ProcessOwnerPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ProcessOwnerPeer::populateObjects(ProcessOwnerPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ProcessOwnerPeer::addSelectColumns($criteria);
- }
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ProcessOwnerPeer::addSelectColumns($criteria);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ProcessOwnerPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ProcessOwnerPeer::CLASS_DEFAULT;
- }
+ // set the class once to avoid overhead in the loop
+ $cls = ProcessOwnerPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
- /**
- * Method perform an INSERT on the database, given a ProcessOwner or Criteria object.
- *
- * @param mixed $values Criteria or ProcessOwner object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from ProcessOwner object
- }
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ProcessOwnerPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a ProcessOwner or Criteria object.
+ *
+ * @param mixed $values Criteria or ProcessOwner object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from ProcessOwner object
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
- return $pk;
- }
+ return $pk;
+ }
- /**
- * Method perform an UPDATE on the database, given a ProcessOwner or Criteria object.
- *
- * @param mixed $values Criteria or ProcessOwner object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ /**
+ * Method perform an UPDATE on the database, given a ProcessOwner or Criteria object.
+ *
+ * @param mixed $values Criteria or ProcessOwner object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
- $selectCriteria = new Criteria(self::DATABASE_NAME);
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
- $comparison = $criteria->getComparison(ProcessOwnerPeer::OWN_UID);
- $selectCriteria->add(ProcessOwnerPeer::OWN_UID, $criteria->remove(ProcessOwnerPeer::OWN_UID), $comparison);
+ $comparison = $criteria->getComparison(ProcessOwnerPeer::OWN_UID);
+ $selectCriteria->add(ProcessOwnerPeer::OWN_UID, $criteria->remove(ProcessOwnerPeer::OWN_UID), $comparison);
- $comparison = $criteria->getComparison(ProcessOwnerPeer::PRO_UID);
- $selectCriteria->add(ProcessOwnerPeer::PRO_UID, $criteria->remove(ProcessOwnerPeer::PRO_UID), $comparison);
+ $comparison = $criteria->getComparison(ProcessOwnerPeer::PRO_UID);
+ $selectCriteria->add(ProcessOwnerPeer::PRO_UID, $criteria->remove(ProcessOwnerPeer::PRO_UID), $comparison);
- } else { // $values is ProcessOwner object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
- /**
- * Method to DELETE all rows from the PROCESS_OWNER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ProcessOwnerPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ /**
+ * Method to DELETE all rows from the PROCESS_OWNER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ProcessOwnerPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- /**
- * Method perform a DELETE on the database, given a ProcessOwner or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ProcessOwner object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ProcessOwnerPeer::DATABASE_NAME);
- }
+ /**
+ * Method perform a DELETE on the database, given a ProcessOwner or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ProcessOwner object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessOwnerPeer::DATABASE_NAME);
+ }
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof ProcessOwner) {
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof ProcessOwner) {
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- }
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ }
- $criteria->add(ProcessOwnerPeer::OWN_UID, $vals[0], Criteria::IN);
- $criteria->add(ProcessOwnerPeer::PRO_UID, $vals[1], Criteria::IN);
- }
+ $criteria->add(ProcessOwnerPeer::OWN_UID, $vals[0], Criteria::IN);
+ $criteria->add(ProcessOwnerPeer::PRO_UID, $vals[1], Criteria::IN);
+ }
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
- $affectedRows = 0; // initialize var to track total num of affected rows
+ $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
- /**
- * Validates all modified columns of given ProcessOwner object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param ProcessOwner $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(ProcessOwner $obj, $cols = null)
- {
- $columns = array();
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ProcessOwnerPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ProcessOwnerPeer::TABLE_NAME);
+ /**
+ * Validates all modified columns of given ProcessOwner object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param ProcessOwner $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(ProcessOwner $obj, $cols = null)
+ {
+ $columns = array();
- if (! is_array($cols)) {
- $cols = array($cols);
- }
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ProcessOwnerPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ProcessOwnerPeer::TABLE_NAME);
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
- }
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
- return BasePeer::doValidate(ProcessOwnerPeer::DATABASE_NAME, ProcessOwnerPeer::TABLE_NAME, $columns);
- }
+ }
- /**
- * Retrieve object using using composite pkey values.
- * @param string $own_uid
- @param string $pro_uid
-
- * @param Connection $con
- * @return ProcessOwner
- */
- public static function retrieveByPK( $own_uid, $pro_uid, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(ProcessOwnerPeer::OWN_UID, $own_uid);
- $criteria->add(ProcessOwnerPeer::PRO_UID, $pro_uid);
- $v = ProcessOwnerPeer::doSelect($criteria, $con);
+ return BasePeer::doValidate(ProcessOwnerPeer::DATABASE_NAME, ProcessOwnerPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $own_uid
+ * @param string $pro_uid
+ * @param Connection $con
+ * @return ProcessOwner
+ */
+ public static function retrieveByPK($own_uid, $pro_uid, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(ProcessOwnerPeer::OWN_UID, $own_uid);
+ $criteria->add(ProcessOwnerPeer::PRO_UID, $pro_uid);
+ $v = ProcessOwnerPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
- return !empty($v) ? $v[0] : null;
- }
-} // BaseProcessOwnerPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseProcessOwnerPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseProcessOwnerPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ProcessOwnerMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ProcessOwnerMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ProcessOwnerMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ProcessOwnerMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseProcessPeer.php b/workflow/engine/classes/model/om/BaseProcessPeer.php
index 90fb60872..3321d75e7 100755
--- a/workflow/engine/classes/model/om/BaseProcessPeer.php
+++ b/workflow/engine/classes/model/om/BaseProcessPeer.php
@@ -12,686 +12,688 @@ include_once 'classes/model/Process.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcessPeer {
+abstract class BaseProcessPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'PROCESS';
+ /** the table name for this class */
+ const TABLE_NAME = 'PROCESS';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Process';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Process';
- /** The total number of columns. */
- const NUM_COLUMNS = 25;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 25;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the PRO_UID field */
- const PRO_UID = 'PROCESS.PRO_UID';
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'PROCESS.PRO_UID';
- /** the column name for the PRO_PARENT field */
- const PRO_PARENT = 'PROCESS.PRO_PARENT';
+ /** the column name for the PRO_PARENT field */
+ const PRO_PARENT = 'PROCESS.PRO_PARENT';
- /** the column name for the PRO_TIME field */
- const PRO_TIME = 'PROCESS.PRO_TIME';
+ /** the column name for the PRO_TIME field */
+ const PRO_TIME = 'PROCESS.PRO_TIME';
- /** the column name for the PRO_TIMEUNIT field */
- const PRO_TIMEUNIT = 'PROCESS.PRO_TIMEUNIT';
+ /** the column name for the PRO_TIMEUNIT field */
+ const PRO_TIMEUNIT = 'PROCESS.PRO_TIMEUNIT';
- /** the column name for the PRO_STATUS field */
- const PRO_STATUS = 'PROCESS.PRO_STATUS';
+ /** the column name for the PRO_STATUS field */
+ const PRO_STATUS = 'PROCESS.PRO_STATUS';
- /** the column name for the PRO_TYPE_DAY field */
- const PRO_TYPE_DAY = 'PROCESS.PRO_TYPE_DAY';
+ /** the column name for the PRO_TYPE_DAY field */
+ const PRO_TYPE_DAY = 'PROCESS.PRO_TYPE_DAY';
- /** the column name for the PRO_TYPE field */
- const PRO_TYPE = 'PROCESS.PRO_TYPE';
+ /** the column name for the PRO_TYPE field */
+ const PRO_TYPE = 'PROCESS.PRO_TYPE';
- /** the column name for the PRO_ASSIGNMENT field */
- const PRO_ASSIGNMENT = 'PROCESS.PRO_ASSIGNMENT';
+ /** the column name for the PRO_ASSIGNMENT field */
+ const PRO_ASSIGNMENT = 'PROCESS.PRO_ASSIGNMENT';
- /** the column name for the PRO_SHOW_MAP field */
- const PRO_SHOW_MAP = 'PROCESS.PRO_SHOW_MAP';
+ /** the column name for the PRO_SHOW_MAP field */
+ const PRO_SHOW_MAP = 'PROCESS.PRO_SHOW_MAP';
+
+ /** the column name for the PRO_SHOW_MESSAGE field */
+ const PRO_SHOW_MESSAGE = 'PROCESS.PRO_SHOW_MESSAGE';
+
+ /** the column name for the PRO_SHOW_DELEGATE field */
+ const PRO_SHOW_DELEGATE = 'PROCESS.PRO_SHOW_DELEGATE';
+
+ /** the column name for the PRO_SHOW_DYNAFORM field */
+ const PRO_SHOW_DYNAFORM = 'PROCESS.PRO_SHOW_DYNAFORM';
+
+ /** the column name for the PRO_CATEGORY field */
+ const PRO_CATEGORY = 'PROCESS.PRO_CATEGORY';
+
+ /** the column name for the PRO_SUB_CATEGORY field */
+ const PRO_SUB_CATEGORY = 'PROCESS.PRO_SUB_CATEGORY';
+
+ /** the column name for the PRO_INDUSTRY field */
+ const PRO_INDUSTRY = 'PROCESS.PRO_INDUSTRY';
+
+ /** the column name for the PRO_UPDATE_DATE field */
+ const PRO_UPDATE_DATE = 'PROCESS.PRO_UPDATE_DATE';
+
+ /** the column name for the PRO_CREATE_DATE field */
+ const PRO_CREATE_DATE = 'PROCESS.PRO_CREATE_DATE';
+
+ /** the column name for the PRO_CREATE_USER field */
+ const PRO_CREATE_USER = 'PROCESS.PRO_CREATE_USER';
+
+ /** the column name for the PRO_HEIGHT field */
+ const PRO_HEIGHT = 'PROCESS.PRO_HEIGHT';
+
+ /** the column name for the PRO_WIDTH field */
+ const PRO_WIDTH = 'PROCESS.PRO_WIDTH';
+
+ /** the column name for the PRO_TITLE_X field */
+ const PRO_TITLE_X = 'PROCESS.PRO_TITLE_X';
+
+ /** the column name for the PRO_TITLE_Y field */
+ const PRO_TITLE_Y = 'PROCESS.PRO_TITLE_Y';
+
+ /** the column name for the PRO_DEBUG field */
+ const PRO_DEBUG = 'PROCESS.PRO_DEBUG';
+
+ /** the column name for the PRO_DYNAFORMS field */
+ const PRO_DYNAFORMS = 'PROCESS.PRO_DYNAFORMS';
+
+ /** the column name for the PRO_DERIVATION_SCREEN_TPL field */
+ const PRO_DERIVATION_SCREEN_TPL = 'PROCESS.PRO_DERIVATION_SCREEN_TPL';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('ProUid', 'ProParent', 'ProTime', 'ProTimeunit', 'ProStatus', 'ProTypeDay', 'ProType', 'ProAssignment', 'ProShowMap', 'ProShowMessage', 'ProShowDelegate', 'ProShowDynaform', 'ProCategory', 'ProSubCategory', 'ProIndustry', 'ProUpdateDate', 'ProCreateDate', 'ProCreateUser', 'ProHeight', 'ProWidth', 'ProTitleX', 'ProTitleY', 'ProDebug', 'ProDynaforms', 'ProDerivationScreenTpl', ),
+ BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID, ProcessPeer::PRO_PARENT, ProcessPeer::PRO_TIME, ProcessPeer::PRO_TIMEUNIT, ProcessPeer::PRO_STATUS, ProcessPeer::PRO_TYPE_DAY, ProcessPeer::PRO_TYPE, ProcessPeer::PRO_ASSIGNMENT, ProcessPeer::PRO_SHOW_MAP, ProcessPeer::PRO_SHOW_MESSAGE, ProcessPeer::PRO_SHOW_DELEGATE, ProcessPeer::PRO_SHOW_DYNAFORM, ProcessPeer::PRO_CATEGORY, ProcessPeer::PRO_SUB_CATEGORY, ProcessPeer::PRO_INDUSTRY, ProcessPeer::PRO_UPDATE_DATE, ProcessPeer::PRO_CREATE_DATE, ProcessPeer::PRO_CREATE_USER, ProcessPeer::PRO_HEIGHT, ProcessPeer::PRO_WIDTH, ProcessPeer::PRO_TITLE_X, ProcessPeer::PRO_TITLE_Y, ProcessPeer::PRO_DEBUG, ProcessPeer::PRO_DYNAFORMS, ProcessPeer::PRO_DERIVATION_SCREEN_TPL, ),
+ BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'PRO_PARENT', 'PRO_TIME', 'PRO_TIMEUNIT', 'PRO_STATUS', 'PRO_TYPE_DAY', 'PRO_TYPE', 'PRO_ASSIGNMENT', 'PRO_SHOW_MAP', 'PRO_SHOW_MESSAGE', 'PRO_SHOW_DELEGATE', 'PRO_SHOW_DYNAFORM', 'PRO_CATEGORY', 'PRO_SUB_CATEGORY', 'PRO_INDUSTRY', 'PRO_UPDATE_DATE', 'PRO_CREATE_DATE', 'PRO_CREATE_USER', 'PRO_HEIGHT', 'PRO_WIDTH', 'PRO_TITLE_X', 'PRO_TITLE_Y', 'PRO_DEBUG', 'PRO_DYNAFORMS', 'PRO_DERIVATION_SCREEN_TPL', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'ProParent' => 1, 'ProTime' => 2, 'ProTimeunit' => 3, 'ProStatus' => 4, 'ProTypeDay' => 5, 'ProType' => 6, 'ProAssignment' => 7, 'ProShowMap' => 8, 'ProShowMessage' => 9, 'ProShowDelegate' => 10, 'ProShowDynaform' => 11, 'ProCategory' => 12, 'ProSubCategory' => 13, 'ProIndustry' => 14, 'ProUpdateDate' => 15, 'ProCreateDate' => 16, 'ProCreateUser' => 17, 'ProHeight' => 18, 'ProWidth' => 19, 'ProTitleX' => 20, 'ProTitleY' => 21, 'ProDebug' => 22, 'ProDynaforms' => 23, 'ProDerivationScreenTpl' => 24, ),
+ BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID => 0, ProcessPeer::PRO_PARENT => 1, ProcessPeer::PRO_TIME => 2, ProcessPeer::PRO_TIMEUNIT => 3, ProcessPeer::PRO_STATUS => 4, ProcessPeer::PRO_TYPE_DAY => 5, ProcessPeer::PRO_TYPE => 6, ProcessPeer::PRO_ASSIGNMENT => 7, ProcessPeer::PRO_SHOW_MAP => 8, ProcessPeer::PRO_SHOW_MESSAGE => 9, ProcessPeer::PRO_SHOW_DELEGATE => 10, ProcessPeer::PRO_SHOW_DYNAFORM => 11, ProcessPeer::PRO_CATEGORY => 12, ProcessPeer::PRO_SUB_CATEGORY => 13, ProcessPeer::PRO_INDUSTRY => 14, ProcessPeer::PRO_UPDATE_DATE => 15, ProcessPeer::PRO_CREATE_DATE => 16, ProcessPeer::PRO_CREATE_USER => 17, ProcessPeer::PRO_HEIGHT => 18, ProcessPeer::PRO_WIDTH => 19, ProcessPeer::PRO_TITLE_X => 20, ProcessPeer::PRO_TITLE_Y => 21, ProcessPeer::PRO_DEBUG => 22, ProcessPeer::PRO_DYNAFORMS => 23, ProcessPeer::PRO_DERIVATION_SCREEN_TPL => 24, ),
+ BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'PRO_PARENT' => 1, 'PRO_TIME' => 2, 'PRO_TIMEUNIT' => 3, 'PRO_STATUS' => 4, 'PRO_TYPE_DAY' => 5, 'PRO_TYPE' => 6, 'PRO_ASSIGNMENT' => 7, 'PRO_SHOW_MAP' => 8, 'PRO_SHOW_MESSAGE' => 9, 'PRO_SHOW_DELEGATE' => 10, 'PRO_SHOW_DYNAFORM' => 11, 'PRO_CATEGORY' => 12, 'PRO_SUB_CATEGORY' => 13, 'PRO_INDUSTRY' => 14, 'PRO_UPDATE_DATE' => 15, 'PRO_CREATE_DATE' => 16, 'PRO_CREATE_USER' => 17, 'PRO_HEIGHT' => 18, 'PRO_WIDTH' => 19, 'PRO_TITLE_X' => 20, 'PRO_TITLE_Y' => 21, 'PRO_DEBUG' => 22, 'PRO_DYNAFORMS' => 23, 'PRO_DERIVATION_SCREEN_TPL' => 24, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ProcessMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ProcessMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ProcessPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ProcessPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ProcessPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_UID);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_PARENT);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_TIME);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_TIMEUNIT);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_STATUS);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_TYPE_DAY);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_TYPE);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_ASSIGNMENT);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_MAP);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_MESSAGE);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_DELEGATE);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_DYNAFORM);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_SUB_CATEGORY);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_INDUSTRY);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_UPDATE_DATE);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_CREATE_DATE);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_CREATE_USER);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_HEIGHT);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_WIDTH);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_TITLE_X);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_TITLE_Y);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_DEBUG);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_DYNAFORMS);
+
+ $criteria->addSelectColumn(ProcessPeer::PRO_DERIVATION_SCREEN_TPL);
+
+ }
+
+ const COUNT = 'COUNT(PROCESS.PRO_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS.PRO_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ProcessPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ProcessPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ProcessPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Process
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ProcessPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ProcessPeer::populateObjects(ProcessPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ProcessPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ProcessPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ProcessPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Process or Criteria object.
+ *
+ * @param mixed $values Criteria or Process object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Process object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Process or Criteria object.
+ *
+ * @param mixed $values Criteria or Process object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ProcessPeer::PRO_UID);
+ $selectCriteria->add(ProcessPeer::PRO_UID, $criteria->remove(ProcessPeer::PRO_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the PROCESS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ProcessPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Process or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Process object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Process) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ProcessPeer::PRO_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Process object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Process $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Process $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ProcessPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ProcessPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_TIMEUNIT))
+ $columns[ProcessPeer::PRO_TIMEUNIT] = $obj->getProTimeunit();
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_STATUS))
+ $columns[ProcessPeer::PRO_STATUS] = $obj->getProStatus();
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_TYPE))
+ $columns[ProcessPeer::PRO_TYPE] = $obj->getProType();
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_ASSIGNMENT))
+ $columns[ProcessPeer::PRO_ASSIGNMENT] = $obj->getProAssignment();
+
+ }
+
+ return BasePeer::doValidate(ProcessPeer::DATABASE_NAME, ProcessPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Process
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ProcessPeer::DATABASE_NAME);
+
+ $criteria->add(ProcessPeer::PRO_UID, $pk);
+
+
+ $v = ProcessPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ProcessPeer::PRO_UID, $pks, Criteria::IN);
+ $objs = ProcessPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** the column name for the PRO_SHOW_MESSAGE field */
- const PRO_SHOW_MESSAGE = 'PROCESS.PRO_SHOW_MESSAGE';
-
- /** the column name for the PRO_SHOW_DELEGATE field */
- const PRO_SHOW_DELEGATE = 'PROCESS.PRO_SHOW_DELEGATE';
-
- /** the column name for the PRO_SHOW_DYNAFORM field */
- const PRO_SHOW_DYNAFORM = 'PROCESS.PRO_SHOW_DYNAFORM';
-
- /** the column name for the PRO_CATEGORY field */
- const PRO_CATEGORY = 'PROCESS.PRO_CATEGORY';
-
- /** the column name for the PRO_SUB_CATEGORY field */
- const PRO_SUB_CATEGORY = 'PROCESS.PRO_SUB_CATEGORY';
-
- /** the column name for the PRO_INDUSTRY field */
- const PRO_INDUSTRY = 'PROCESS.PRO_INDUSTRY';
-
- /** the column name for the PRO_UPDATE_DATE field */
- const PRO_UPDATE_DATE = 'PROCESS.PRO_UPDATE_DATE';
-
- /** the column name for the PRO_CREATE_DATE field */
- const PRO_CREATE_DATE = 'PROCESS.PRO_CREATE_DATE';
-
- /** the column name for the PRO_CREATE_USER field */
- const PRO_CREATE_USER = 'PROCESS.PRO_CREATE_USER';
-
- /** the column name for the PRO_HEIGHT field */
- const PRO_HEIGHT = 'PROCESS.PRO_HEIGHT';
-
- /** the column name for the PRO_WIDTH field */
- const PRO_WIDTH = 'PROCESS.PRO_WIDTH';
-
- /** the column name for the PRO_TITLE_X field */
- const PRO_TITLE_X = 'PROCESS.PRO_TITLE_X';
-
- /** the column name for the PRO_TITLE_Y field */
- const PRO_TITLE_Y = 'PROCESS.PRO_TITLE_Y';
-
- /** the column name for the PRO_DEBUG field */
- const PRO_DEBUG = 'PROCESS.PRO_DEBUG';
-
- /** the column name for the PRO_DYNAFORMS field */
- const PRO_DYNAFORMS = 'PROCESS.PRO_DYNAFORMS';
-
- /** the column name for the PRO_DERIVATION_SCREEN_TPL field */
- const PRO_DERIVATION_SCREEN_TPL = 'PROCESS.PRO_DERIVATION_SCREEN_TPL';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('ProUid', 'ProParent', 'ProTime', 'ProTimeunit', 'ProStatus', 'ProTypeDay', 'ProType', 'ProAssignment', 'ProShowMap', 'ProShowMessage', 'ProShowDelegate', 'ProShowDynaform', 'ProCategory', 'ProSubCategory', 'ProIndustry', 'ProUpdateDate', 'ProCreateDate', 'ProCreateUser', 'ProHeight', 'ProWidth', 'ProTitleX', 'ProTitleY', 'ProDebug', 'ProDynaforms', 'ProDerivationScreenTpl', ),
- BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID, ProcessPeer::PRO_PARENT, ProcessPeer::PRO_TIME, ProcessPeer::PRO_TIMEUNIT, ProcessPeer::PRO_STATUS, ProcessPeer::PRO_TYPE_DAY, ProcessPeer::PRO_TYPE, ProcessPeer::PRO_ASSIGNMENT, ProcessPeer::PRO_SHOW_MAP, ProcessPeer::PRO_SHOW_MESSAGE, ProcessPeer::PRO_SHOW_DELEGATE, ProcessPeer::PRO_SHOW_DYNAFORM, ProcessPeer::PRO_CATEGORY, ProcessPeer::PRO_SUB_CATEGORY, ProcessPeer::PRO_INDUSTRY, ProcessPeer::PRO_UPDATE_DATE, ProcessPeer::PRO_CREATE_DATE, ProcessPeer::PRO_CREATE_USER, ProcessPeer::PRO_HEIGHT, ProcessPeer::PRO_WIDTH, ProcessPeer::PRO_TITLE_X, ProcessPeer::PRO_TITLE_Y, ProcessPeer::PRO_DEBUG, ProcessPeer::PRO_DYNAFORMS, ProcessPeer::PRO_DERIVATION_SCREEN_TPL, ),
- BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'PRO_PARENT', 'PRO_TIME', 'PRO_TIMEUNIT', 'PRO_STATUS', 'PRO_TYPE_DAY', 'PRO_TYPE', 'PRO_ASSIGNMENT', 'PRO_SHOW_MAP', 'PRO_SHOW_MESSAGE', 'PRO_SHOW_DELEGATE', 'PRO_SHOW_DYNAFORM', 'PRO_CATEGORY', 'PRO_SUB_CATEGORY', 'PRO_INDUSTRY', 'PRO_UPDATE_DATE', 'PRO_CREATE_DATE', 'PRO_CREATE_USER', 'PRO_HEIGHT', 'PRO_WIDTH', 'PRO_TITLE_X', 'PRO_TITLE_Y', 'PRO_DEBUG', 'PRO_DYNAFORMS', 'PRO_DERIVATION_SCREEN_TPL', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'ProParent' => 1, 'ProTime' => 2, 'ProTimeunit' => 3, 'ProStatus' => 4, 'ProTypeDay' => 5, 'ProType' => 6, 'ProAssignment' => 7, 'ProShowMap' => 8, 'ProShowMessage' => 9, 'ProShowDelegate' => 10, 'ProShowDynaform' => 11, 'ProCategory' => 12, 'ProSubCategory' => 13, 'ProIndustry' => 14, 'ProUpdateDate' => 15, 'ProCreateDate' => 16, 'ProCreateUser' => 17, 'ProHeight' => 18, 'ProWidth' => 19, 'ProTitleX' => 20, 'ProTitleY' => 21, 'ProDebug' => 22, 'ProDynaforms' => 23, 'ProDerivationScreenTpl' => 24, ),
- BasePeer::TYPE_COLNAME => array (ProcessPeer::PRO_UID => 0, ProcessPeer::PRO_PARENT => 1, ProcessPeer::PRO_TIME => 2, ProcessPeer::PRO_TIMEUNIT => 3, ProcessPeer::PRO_STATUS => 4, ProcessPeer::PRO_TYPE_DAY => 5, ProcessPeer::PRO_TYPE => 6, ProcessPeer::PRO_ASSIGNMENT => 7, ProcessPeer::PRO_SHOW_MAP => 8, ProcessPeer::PRO_SHOW_MESSAGE => 9, ProcessPeer::PRO_SHOW_DELEGATE => 10, ProcessPeer::PRO_SHOW_DYNAFORM => 11, ProcessPeer::PRO_CATEGORY => 12, ProcessPeer::PRO_SUB_CATEGORY => 13, ProcessPeer::PRO_INDUSTRY => 14, ProcessPeer::PRO_UPDATE_DATE => 15, ProcessPeer::PRO_CREATE_DATE => 16, ProcessPeer::PRO_CREATE_USER => 17, ProcessPeer::PRO_HEIGHT => 18, ProcessPeer::PRO_WIDTH => 19, ProcessPeer::PRO_TITLE_X => 20, ProcessPeer::PRO_TITLE_Y => 21, ProcessPeer::PRO_DEBUG => 22, ProcessPeer::PRO_DYNAFORMS => 23, ProcessPeer::PRO_DERIVATION_SCREEN_TPL => 24, ),
- BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'PRO_PARENT' => 1, 'PRO_TIME' => 2, 'PRO_TIMEUNIT' => 3, 'PRO_STATUS' => 4, 'PRO_TYPE_DAY' => 5, 'PRO_TYPE' => 6, 'PRO_ASSIGNMENT' => 7, 'PRO_SHOW_MAP' => 8, 'PRO_SHOW_MESSAGE' => 9, 'PRO_SHOW_DELEGATE' => 10, 'PRO_SHOW_DYNAFORM' => 11, 'PRO_CATEGORY' => 12, 'PRO_SUB_CATEGORY' => 13, 'PRO_INDUSTRY' => 14, 'PRO_UPDATE_DATE' => 15, 'PRO_CREATE_DATE' => 16, 'PRO_CREATE_USER' => 17, 'PRO_HEIGHT' => 18, 'PRO_WIDTH' => 19, 'PRO_TITLE_X' => 20, 'PRO_TITLE_Y' => 21, 'PRO_DEBUG' => 22, 'PRO_DYNAFORMS' => 23, 'PRO_DERIVATION_SCREEN_TPL' => 24, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ProcessMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ProcessMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ProcessPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ProcessPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ProcessPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ProcessPeer::PRO_UID);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_PARENT);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_TIME);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_TIMEUNIT);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_STATUS);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_TYPE_DAY);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_TYPE);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_ASSIGNMENT);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_MAP);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_MESSAGE);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_DELEGATE);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_SHOW_DYNAFORM);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_SUB_CATEGORY);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_INDUSTRY);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_UPDATE_DATE);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_CREATE_DATE);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_CREATE_USER);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_HEIGHT);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_WIDTH);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_TITLE_X);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_TITLE_Y);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_DEBUG);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_DYNAFORMS);
-
- $criteria->addSelectColumn(ProcessPeer::PRO_DERIVATION_SCREEN_TPL);
-
- }
-
- const COUNT = 'COUNT(PROCESS.PRO_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS.PRO_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ProcessPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ProcessPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ProcessPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Process
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ProcessPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ProcessPeer::populateObjects(ProcessPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ProcessPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ProcessPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ProcessPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Process or Criteria object.
- *
- * @param mixed $values Criteria or Process object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Process object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Process or Criteria object.
- *
- * @param mixed $values Criteria or Process object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ProcessPeer::PRO_UID);
- $selectCriteria->add(ProcessPeer::PRO_UID, $criteria->remove(ProcessPeer::PRO_UID), $comparison);
-
- } else { // $values is Process object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the PROCESS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ProcessPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Process or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Process object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Process) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ProcessPeer::PRO_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Process object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Process $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Process $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ProcessPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ProcessPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_TIMEUNIT))
- $columns[ProcessPeer::PRO_TIMEUNIT] = $obj->getProTimeunit();
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_STATUS))
- $columns[ProcessPeer::PRO_STATUS] = $obj->getProStatus();
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_TYPE))
- $columns[ProcessPeer::PRO_TYPE] = $obj->getProType();
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessPeer::PRO_ASSIGNMENT))
- $columns[ProcessPeer::PRO_ASSIGNMENT] = $obj->getProAssignment();
-
- }
-
- return BasePeer::doValidate(ProcessPeer::DATABASE_NAME, ProcessPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Process
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ProcessPeer::DATABASE_NAME);
-
- $criteria->add(ProcessPeer::PRO_UID, $pk);
-
-
- $v = ProcessPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ProcessPeer::PRO_UID, $pks, Criteria::IN);
- $objs = ProcessPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseProcessPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseProcessPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseProcessPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ProcessMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ProcessMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ProcessMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ProcessMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseProcessUser.php b/workflow/engine/classes/model/om/BaseProcessUser.php
index 2a5ad9f9f..71a0ed559 100755
--- a/workflow/engine/classes/model/om/BaseProcessUser.php
+++ b/workflow/engine/classes/model/om/BaseProcessUser.php
@@ -16,648 +16,669 @@ include_once 'classes/model/ProcessUserPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcessUser extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ProcessUserPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the pu_uid field.
- * @var string
- */
- protected $pu_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
-
- /**
- * The value for the pu_type field.
- * @var string
- */
- protected $pu_type = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [pu_uid] column value.
- *
- * @return string
- */
- public function getPuUid()
- {
-
- return $this->pu_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [pu_type] column value.
- *
- * @return string
- */
- public function getPuType()
- {
-
- return $this->pu_type;
- }
-
- /**
- * Set the value of [pu_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setPuUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pu_uid !== $v || $v === '') {
- $this->pu_uid = $v;
- $this->modifiedColumns[] = ProcessUserPeer::PU_UID;
- }
-
- } // setPuUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ProcessUserPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = ProcessUserPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [pu_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setPuType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pu_type !== $v || $v === '') {
- $this->pu_type = $v;
- $this->modifiedColumns[] = ProcessUserPeer::PU_TYPE;
- }
-
- } // setPuType()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->pu_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->usr_uid = $rs->getString($startcol + 2);
-
- $this->pu_type = $rs->getString($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = ProcessUserPeer::NUM_COLUMNS - ProcessUserPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating ProcessUser object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ProcessUserPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ProcessUserPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ProcessUserPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ProcessUserPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getPuUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getUsrUid();
- break;
- case 3:
- return $this->getPuType();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessUserPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getPuUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getUsrUid(),
- $keys[3] => $this->getPuType(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ProcessUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setPuUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setUsrUid($value);
- break;
- case 3:
- $this->setPuType($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ProcessUserPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setPuUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setUsrUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setPuType($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ProcessUserPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ProcessUserPeer::PU_UID)) $criteria->add(ProcessUserPeer::PU_UID, $this->pu_uid);
- if ($this->isColumnModified(ProcessUserPeer::PRO_UID)) $criteria->add(ProcessUserPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(ProcessUserPeer::USR_UID)) $criteria->add(ProcessUserPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(ProcessUserPeer::PU_TYPE)) $criteria->add(ProcessUserPeer::PU_TYPE, $this->pu_type);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ProcessUserPeer::DATABASE_NAME);
-
- $criteria->add(ProcessUserPeer::PU_UID, $this->pu_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getPuUid();
- }
-
- /**
- * Generic method to set the primary key (pu_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setPuUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of ProcessUser (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setPuType($this->pu_type);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setPuUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return ProcessUser Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ProcessUserPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ProcessUserPeer();
- }
- return self::$peer;
- }
-
-} // BaseProcessUser
+abstract class BaseProcessUser extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ProcessUserPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the pu_uid field.
+ * @var string
+ */
+ protected $pu_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the pu_type field.
+ * @var string
+ */
+ protected $pu_type = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [pu_uid] column value.
+ *
+ * @return string
+ */
+ public function getPuUid()
+ {
+
+ return $this->pu_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [pu_type] column value.
+ *
+ * @return string
+ */
+ public function getPuType()
+ {
+
+ return $this->pu_type;
+ }
+
+ /**
+ * Set the value of [pu_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setPuUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pu_uid !== $v || $v === '') {
+ $this->pu_uid = $v;
+ $this->modifiedColumns[] = ProcessUserPeer::PU_UID;
+ }
+
+ } // setPuUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ProcessUserPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = ProcessUserPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [pu_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setPuType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pu_type !== $v || $v === '') {
+ $this->pu_type = $v;
+ $this->modifiedColumns[] = ProcessUserPeer::PU_TYPE;
+ }
+
+ } // setPuType()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->pu_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->usr_uid = $rs->getString($startcol + 2);
+
+ $this->pu_type = $rs->getString($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = ProcessUserPeer::NUM_COLUMNS - ProcessUserPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating ProcessUser object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ProcessUserPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ProcessUserPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ProcessUserPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ProcessUserPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getPuUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getUsrUid();
+ break;
+ case 3:
+ return $this->getPuType();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessUserPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getPuUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getUsrUid(),
+ $keys[3] => $this->getPuType(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ProcessUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setPuUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setUsrUid($value);
+ break;
+ case 3:
+ $this->setPuType($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ProcessUserPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setPuUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setUsrUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setPuType($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ProcessUserPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ProcessUserPeer::PU_UID)) {
+ $criteria->add(ProcessUserPeer::PU_UID, $this->pu_uid);
+ }
+
+ if ($this->isColumnModified(ProcessUserPeer::PRO_UID)) {
+ $criteria->add(ProcessUserPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(ProcessUserPeer::USR_UID)) {
+ $criteria->add(ProcessUserPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(ProcessUserPeer::PU_TYPE)) {
+ $criteria->add(ProcessUserPeer::PU_TYPE, $this->pu_type);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ProcessUserPeer::DATABASE_NAME);
+
+ $criteria->add(ProcessUserPeer::PU_UID, $this->pu_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getPuUid();
+ }
+
+ /**
+ * Generic method to set the primary key (pu_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setPuUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of ProcessUser (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+ $copyObj->setPuType($this->pu_type);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setPuUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return ProcessUser Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ProcessUserPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ProcessUserPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseProcessUserPeer.php b/workflow/engine/classes/model/om/BaseProcessUserPeer.php
index 88df0a01a..5069ac693 100755
--- a/workflow/engine/classes/model/om/BaseProcessUserPeer.php
+++ b/workflow/engine/classes/model/om/BaseProcessUserPeer.php
@@ -12,581 +12,583 @@ include_once 'classes/model/ProcessUser.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseProcessUserPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'PROCESS_USER';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.ProcessUser';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the PU_UID field */
- const PU_UID = 'PROCESS_USER.PU_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'PROCESS_USER.PRO_UID';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'PROCESS_USER.USR_UID';
-
- /** the column name for the PU_TYPE field */
- const PU_TYPE = 'PROCESS_USER.PU_TYPE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('PuUid', 'ProUid', 'UsrUid', 'PuType', ),
- BasePeer::TYPE_COLNAME => array (ProcessUserPeer::PU_UID, ProcessUserPeer::PRO_UID, ProcessUserPeer::USR_UID, ProcessUserPeer::PU_TYPE, ),
- BasePeer::TYPE_FIELDNAME => array ('PU_UID', 'PRO_UID', 'USR_UID', 'PU_TYPE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('PuUid' => 0, 'ProUid' => 1, 'UsrUid' => 2, 'PuType' => 3, ),
- BasePeer::TYPE_COLNAME => array (ProcessUserPeer::PU_UID => 0, ProcessUserPeer::PRO_UID => 1, ProcessUserPeer::USR_UID => 2, ProcessUserPeer::PU_TYPE => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('PU_UID' => 0, 'PRO_UID' => 1, 'USR_UID' => 2, 'PU_TYPE' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ProcessUserMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ProcessUserMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ProcessUserPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ProcessUserPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ProcessUserPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ProcessUserPeer::PU_UID);
-
- $criteria->addSelectColumn(ProcessUserPeer::PRO_UID);
-
- $criteria->addSelectColumn(ProcessUserPeer::USR_UID);
-
- $criteria->addSelectColumn(ProcessUserPeer::PU_TYPE);
-
- }
-
- const COUNT = 'COUNT(PROCESS_USER.PU_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS_USER.PU_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ProcessUserPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ProcessUserPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ProcessUserPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return ProcessUser
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ProcessUserPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ProcessUserPeer::populateObjects(ProcessUserPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ProcessUserPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ProcessUserPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ProcessUserPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a ProcessUser or Criteria object.
- *
- * @param mixed $values Criteria or ProcessUser object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from ProcessUser object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a ProcessUser or Criteria object.
- *
- * @param mixed $values Criteria or ProcessUser object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ProcessUserPeer::PU_UID);
- $selectCriteria->add(ProcessUserPeer::PU_UID, $criteria->remove(ProcessUserPeer::PU_UID), $comparison);
-
- } else { // $values is ProcessUser object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the PROCESS_USER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ProcessUserPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a ProcessUser or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ProcessUser object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof ProcessUser) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ProcessUserPeer::PU_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given ProcessUser object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param ProcessUser $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(ProcessUser $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ProcessUserPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ProcessUserPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::PU_UID))
- $columns[ProcessUserPeer::PU_UID] = $obj->getPuUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::PRO_UID))
- $columns[ProcessUserPeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::USR_UID))
- $columns[ProcessUserPeer::USR_UID] = $obj->getUsrUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::PU_TYPE))
- $columns[ProcessUserPeer::PU_TYPE] = $obj->getPuType();
-
- }
-
- return BasePeer::doValidate(ProcessUserPeer::DATABASE_NAME, ProcessUserPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return ProcessUser
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ProcessUserPeer::DATABASE_NAME);
-
- $criteria->add(ProcessUserPeer::PU_UID, $pk);
-
-
- $v = ProcessUserPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ProcessUserPeer::PU_UID, $pks, Criteria::IN);
- $objs = ProcessUserPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseProcessUserPeer
+abstract class BaseProcessUserPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'PROCESS_USER';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.ProcessUser';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the PU_UID field */
+ const PU_UID = 'PROCESS_USER.PU_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'PROCESS_USER.PRO_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'PROCESS_USER.USR_UID';
+
+ /** the column name for the PU_TYPE field */
+ const PU_TYPE = 'PROCESS_USER.PU_TYPE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('PuUid', 'ProUid', 'UsrUid', 'PuType', ),
+ BasePeer::TYPE_COLNAME => array (ProcessUserPeer::PU_UID, ProcessUserPeer::PRO_UID, ProcessUserPeer::USR_UID, ProcessUserPeer::PU_TYPE, ),
+ BasePeer::TYPE_FIELDNAME => array ('PU_UID', 'PRO_UID', 'USR_UID', 'PU_TYPE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('PuUid' => 0, 'ProUid' => 1, 'UsrUid' => 2, 'PuType' => 3, ),
+ BasePeer::TYPE_COLNAME => array (ProcessUserPeer::PU_UID => 0, ProcessUserPeer::PRO_UID => 1, ProcessUserPeer::USR_UID => 2, ProcessUserPeer::PU_TYPE => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('PU_UID' => 0, 'PRO_UID' => 1, 'USR_UID' => 2, 'PU_TYPE' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ProcessUserMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ProcessUserMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ProcessUserPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ProcessUserPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ProcessUserPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ProcessUserPeer::PU_UID);
+
+ $criteria->addSelectColumn(ProcessUserPeer::PRO_UID);
+
+ $criteria->addSelectColumn(ProcessUserPeer::USR_UID);
+
+ $criteria->addSelectColumn(ProcessUserPeer::PU_TYPE);
+
+ }
+
+ const COUNT = 'COUNT(PROCESS_USER.PU_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT PROCESS_USER.PU_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ProcessUserPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ProcessUserPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ProcessUserPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return ProcessUser
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ProcessUserPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ProcessUserPeer::populateObjects(ProcessUserPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ProcessUserPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ProcessUserPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ProcessUserPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a ProcessUser or Criteria object.
+ *
+ * @param mixed $values Criteria or ProcessUser object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from ProcessUser object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a ProcessUser or Criteria object.
+ *
+ * @param mixed $values Criteria or ProcessUser object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ProcessUserPeer::PU_UID);
+ $selectCriteria->add(ProcessUserPeer::PU_UID, $criteria->remove(ProcessUserPeer::PU_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the PROCESS_USER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ProcessUserPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a ProcessUser or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ProcessUser object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof ProcessUser) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ProcessUserPeer::PU_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given ProcessUser object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param ProcessUser $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(ProcessUser $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ProcessUserPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ProcessUserPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::PU_UID))
+ $columns[ProcessUserPeer::PU_UID] = $obj->getPuUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::PRO_UID))
+ $columns[ProcessUserPeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::USR_UID))
+ $columns[ProcessUserPeer::USR_UID] = $obj->getUsrUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ProcessUserPeer::PU_TYPE))
+ $columns[ProcessUserPeer::PU_TYPE] = $obj->getPuType();
+
+ }
+
+ return BasePeer::doValidate(ProcessUserPeer::DATABASE_NAME, ProcessUserPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return ProcessUser
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ProcessUserPeer::DATABASE_NAME);
+
+ $criteria->add(ProcessUserPeer::PU_UID, $pk);
+
+
+ $v = ProcessUserPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ProcessUserPeer::PU_UID, $pks, Criteria::IN);
+ $objs = ProcessUserPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseProcessUserPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseProcessUserPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ProcessUserMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ProcessUserMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ProcessUserMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ProcessUserMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseReportTable.php b/workflow/engine/classes/model/om/BaseReportTable.php
index 410c83738..916dd161e 100755
--- a/workflow/engine/classes/model/om/BaseReportTable.php
+++ b/workflow/engine/classes/model/om/BaseReportTable.php
@@ -16,882 +16,925 @@ include_once 'classes/model/ReportTablePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseReportTable extends BaseObject implements Persistent {
-
+abstract class BaseReportTable extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ReportTablePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the rep_tab_uid field.
+ * @var string
+ */
+ protected $rep_tab_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the rep_tab_name field.
+ * @var string
+ */
+ protected $rep_tab_name = '';
+
+ /**
+ * The value for the rep_tab_type field.
+ * @var string
+ */
+ protected $rep_tab_type = '';
+
+ /**
+ * The value for the rep_tab_grid field.
+ * @var string
+ */
+ protected $rep_tab_grid = '';
+
+ /**
+ * The value for the rep_tab_connection field.
+ * @var string
+ */
+ protected $rep_tab_connection = '';
+
+ /**
+ * The value for the rep_tab_create_date field.
+ * @var int
+ */
+ protected $rep_tab_create_date;
+
+ /**
+ * The value for the rep_tab_status field.
+ * @var string
+ */
+ protected $rep_tab_status = 'ACTIVE';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [rep_tab_uid] column value.
+ *
+ * @return string
+ */
+ public function getRepTabUid()
+ {
+
+ return $this->rep_tab_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [rep_tab_name] column value.
+ *
+ * @return string
+ */
+ public function getRepTabName()
+ {
+
+ return $this->rep_tab_name;
+ }
+
+ /**
+ * Get the [rep_tab_type] column value.
+ *
+ * @return string
+ */
+ public function getRepTabType()
+ {
+
+ return $this->rep_tab_type;
+ }
+
+ /**
+ * Get the [rep_tab_grid] column value.
+ *
+ * @return string
+ */
+ public function getRepTabGrid()
+ {
+
+ return $this->rep_tab_grid;
+ }
+
+ /**
+ * Get the [rep_tab_connection] column value.
+ *
+ * @return string
+ */
+ public function getRepTabConnection()
+ {
+
+ return $this->rep_tab_connection;
+ }
+
+ /**
+ * Get the [optionally formatted] [rep_tab_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getRepTabCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->rep_tab_create_date === null || $this->rep_tab_create_date === '') {
+ return null;
+ } elseif (!is_int($this->rep_tab_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->rep_tab_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [rep_tab_create_date] as date/time value: " .
+ var_export($this->rep_tab_create_date, true));
+ }
+ } else {
+ $ts = $this->rep_tab_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [rep_tab_status] column value.
+ *
+ * @return string
+ */
+ public function getRepTabStatus()
+ {
+
+ return $this->rep_tab_status;
+ }
+
+ /**
+ * Set the value of [rep_tab_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepTabUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_tab_uid !== $v || $v === '') {
+ $this->rep_tab_uid = $v;
+ $this->modifiedColumns[] = ReportTablePeer::REP_TAB_UID;
+ }
+
+ } // setRepTabUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ReportTablePeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [rep_tab_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepTabName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_tab_name !== $v || $v === '') {
+ $this->rep_tab_name = $v;
+ $this->modifiedColumns[] = ReportTablePeer::REP_TAB_NAME;
+ }
+
+ } // setRepTabName()
+
+ /**
+ * Set the value of [rep_tab_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepTabType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_tab_type !== $v || $v === '') {
+ $this->rep_tab_type = $v;
+ $this->modifiedColumns[] = ReportTablePeer::REP_TAB_TYPE;
+ }
+
+ } // setRepTabType()
+
+ /**
+ * Set the value of [rep_tab_grid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepTabGrid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_tab_grid !== $v || $v === '') {
+ $this->rep_tab_grid = $v;
+ $this->modifiedColumns[] = ReportTablePeer::REP_TAB_GRID;
+ }
+
+ } // setRepTabGrid()
+
+ /**
+ * Set the value of [rep_tab_connection] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepTabConnection($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_tab_connection !== $v || $v === '') {
+ $this->rep_tab_connection = $v;
+ $this->modifiedColumns[] = ReportTablePeer::REP_TAB_CONNECTION;
+ }
+
+ } // setRepTabConnection()
+
+ /**
+ * Set the value of [rep_tab_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setRepTabCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [rep_tab_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->rep_tab_create_date !== $ts) {
+ $this->rep_tab_create_date = $ts;
+ $this->modifiedColumns[] = ReportTablePeer::REP_TAB_CREATE_DATE;
+ }
+
+ } // setRepTabCreateDate()
+
+ /**
+ * Set the value of [rep_tab_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepTabStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_tab_status !== $v || $v === 'ACTIVE') {
+ $this->rep_tab_status = $v;
+ $this->modifiedColumns[] = ReportTablePeer::REP_TAB_STATUS;
+ }
+
+ } // setRepTabStatus()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->rep_tab_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->rep_tab_name = $rs->getString($startcol + 2);
+
+ $this->rep_tab_type = $rs->getString($startcol + 3);
+
+ $this->rep_tab_grid = $rs->getString($startcol + 4);
+
+ $this->rep_tab_connection = $rs->getString($startcol + 5);
+
+ $this->rep_tab_create_date = $rs->getTimestamp($startcol + 6, null);
+
+ $this->rep_tab_status = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = ReportTablePeer::NUM_COLUMNS - ReportTablePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating ReportTable object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ReportTablePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ReportTablePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ReportTablePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ReportTablePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ReportTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getRepTabUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getRepTabName();
+ break;
+ case 3:
+ return $this->getRepTabType();
+ break;
+ case 4:
+ return $this->getRepTabGrid();
+ break;
+ case 5:
+ return $this->getRepTabConnection();
+ break;
+ case 6:
+ return $this->getRepTabCreateDate();
+ break;
+ case 7:
+ return $this->getRepTabStatus();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ReportTablePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getRepTabUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getRepTabName(),
+ $keys[3] => $this->getRepTabType(),
+ $keys[4] => $this->getRepTabGrid(),
+ $keys[5] => $this->getRepTabConnection(),
+ $keys[6] => $this->getRepTabCreateDate(),
+ $keys[7] => $this->getRepTabStatus(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ReportTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setRepTabUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setRepTabName($value);
+ break;
+ case 3:
+ $this->setRepTabType($value);
+ break;
+ case 4:
+ $this->setRepTabGrid($value);
+ break;
+ case 5:
+ $this->setRepTabConnection($value);
+ break;
+ case 6:
+ $this->setRepTabCreateDate($value);
+ break;
+ case 7:
+ $this->setRepTabStatus($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ReportTablePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setRepTabUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setRepTabName($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setRepTabType($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setRepTabGrid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setRepTabConnection($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setRepTabCreateDate($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setRepTabStatus($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ReportTablePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ReportTablePeer::REP_TAB_UID)) {
+ $criteria->add(ReportTablePeer::REP_TAB_UID, $this->rep_tab_uid);
+ }
+
+ if ($this->isColumnModified(ReportTablePeer::PRO_UID)) {
+ $criteria->add(ReportTablePeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(ReportTablePeer::REP_TAB_NAME)) {
+ $criteria->add(ReportTablePeer::REP_TAB_NAME, $this->rep_tab_name);
+ }
+
+ if ($this->isColumnModified(ReportTablePeer::REP_TAB_TYPE)) {
+ $criteria->add(ReportTablePeer::REP_TAB_TYPE, $this->rep_tab_type);
+ }
+
+ if ($this->isColumnModified(ReportTablePeer::REP_TAB_GRID)) {
+ $criteria->add(ReportTablePeer::REP_TAB_GRID, $this->rep_tab_grid);
+ }
+
+ if ($this->isColumnModified(ReportTablePeer::REP_TAB_CONNECTION)) {
+ $criteria->add(ReportTablePeer::REP_TAB_CONNECTION, $this->rep_tab_connection);
+ }
+
+ if ($this->isColumnModified(ReportTablePeer::REP_TAB_CREATE_DATE)) {
+ $criteria->add(ReportTablePeer::REP_TAB_CREATE_DATE, $this->rep_tab_create_date);
+ }
+
+ if ($this->isColumnModified(ReportTablePeer::REP_TAB_STATUS)) {
+ $criteria->add(ReportTablePeer::REP_TAB_STATUS, $this->rep_tab_status);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ReportTablePeer::DATABASE_NAME);
+
+ $criteria->add(ReportTablePeer::REP_TAB_UID, $this->rep_tab_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getRepTabUid();
+ }
+
+ /**
+ * Generic method to set the primary key (rep_tab_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setRepTabUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of ReportTable (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setRepTabName($this->rep_tab_name);
+
+ $copyObj->setRepTabType($this->rep_tab_type);
+
+ $copyObj->setRepTabGrid($this->rep_tab_grid);
+
+ $copyObj->setRepTabConnection($this->rep_tab_connection);
+
+ $copyObj->setRepTabCreateDate($this->rep_tab_create_date);
+
+ $copyObj->setRepTabStatus($this->rep_tab_status);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setRepTabUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return ReportTable Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ReportTablePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ReportTablePeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ReportTablePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the rep_tab_uid field.
- * @var string
- */
- protected $rep_tab_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the rep_tab_name field.
- * @var string
- */
- protected $rep_tab_name = '';
-
-
- /**
- * The value for the rep_tab_type field.
- * @var string
- */
- protected $rep_tab_type = '';
-
-
- /**
- * The value for the rep_tab_grid field.
- * @var string
- */
- protected $rep_tab_grid = '';
-
-
- /**
- * The value for the rep_tab_connection field.
- * @var string
- */
- protected $rep_tab_connection = '';
-
-
- /**
- * The value for the rep_tab_create_date field.
- * @var int
- */
- protected $rep_tab_create_date;
-
-
- /**
- * The value for the rep_tab_status field.
- * @var string
- */
- protected $rep_tab_status = 'ACTIVE';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [rep_tab_uid] column value.
- *
- * @return string
- */
- public function getRepTabUid()
- {
-
- return $this->rep_tab_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [rep_tab_name] column value.
- *
- * @return string
- */
- public function getRepTabName()
- {
-
- return $this->rep_tab_name;
- }
-
- /**
- * Get the [rep_tab_type] column value.
- *
- * @return string
- */
- public function getRepTabType()
- {
-
- return $this->rep_tab_type;
- }
-
- /**
- * Get the [rep_tab_grid] column value.
- *
- * @return string
- */
- public function getRepTabGrid()
- {
-
- return $this->rep_tab_grid;
- }
-
- /**
- * Get the [rep_tab_connection] column value.
- *
- * @return string
- */
- public function getRepTabConnection()
- {
-
- return $this->rep_tab_connection;
- }
-
- /**
- * Get the [optionally formatted] [rep_tab_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getRepTabCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->rep_tab_create_date === null || $this->rep_tab_create_date === '') {
- return null;
- } elseif (!is_int($this->rep_tab_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->rep_tab_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [rep_tab_create_date] as date/time value: " . var_export($this->rep_tab_create_date, true));
- }
- } else {
- $ts = $this->rep_tab_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [rep_tab_status] column value.
- *
- * @return string
- */
- public function getRepTabStatus()
- {
-
- return $this->rep_tab_status;
- }
-
- /**
- * Set the value of [rep_tab_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepTabUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_tab_uid !== $v || $v === '') {
- $this->rep_tab_uid = $v;
- $this->modifiedColumns[] = ReportTablePeer::REP_TAB_UID;
- }
-
- } // setRepTabUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ReportTablePeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [rep_tab_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepTabName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_tab_name !== $v || $v === '') {
- $this->rep_tab_name = $v;
- $this->modifiedColumns[] = ReportTablePeer::REP_TAB_NAME;
- }
-
- } // setRepTabName()
-
- /**
- * Set the value of [rep_tab_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepTabType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_tab_type !== $v || $v === '') {
- $this->rep_tab_type = $v;
- $this->modifiedColumns[] = ReportTablePeer::REP_TAB_TYPE;
- }
-
- } // setRepTabType()
-
- /**
- * Set the value of [rep_tab_grid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepTabGrid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_tab_grid !== $v || $v === '') {
- $this->rep_tab_grid = $v;
- $this->modifiedColumns[] = ReportTablePeer::REP_TAB_GRID;
- }
-
- } // setRepTabGrid()
-
- /**
- * Set the value of [rep_tab_connection] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepTabConnection($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_tab_connection !== $v || $v === '') {
- $this->rep_tab_connection = $v;
- $this->modifiedColumns[] = ReportTablePeer::REP_TAB_CONNECTION;
- }
-
- } // setRepTabConnection()
-
- /**
- * Set the value of [rep_tab_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setRepTabCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [rep_tab_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->rep_tab_create_date !== $ts) {
- $this->rep_tab_create_date = $ts;
- $this->modifiedColumns[] = ReportTablePeer::REP_TAB_CREATE_DATE;
- }
-
- } // setRepTabCreateDate()
-
- /**
- * Set the value of [rep_tab_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepTabStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_tab_status !== $v || $v === 'ACTIVE') {
- $this->rep_tab_status = $v;
- $this->modifiedColumns[] = ReportTablePeer::REP_TAB_STATUS;
- }
-
- } // setRepTabStatus()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->rep_tab_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->rep_tab_name = $rs->getString($startcol + 2);
-
- $this->rep_tab_type = $rs->getString($startcol + 3);
-
- $this->rep_tab_grid = $rs->getString($startcol + 4);
-
- $this->rep_tab_connection = $rs->getString($startcol + 5);
-
- $this->rep_tab_create_date = $rs->getTimestamp($startcol + 6, null);
-
- $this->rep_tab_status = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = ReportTablePeer::NUM_COLUMNS - ReportTablePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating ReportTable object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ReportTablePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ReportTablePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ReportTablePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ReportTablePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ReportTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getRepTabUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getRepTabName();
- break;
- case 3:
- return $this->getRepTabType();
- break;
- case 4:
- return $this->getRepTabGrid();
- break;
- case 5:
- return $this->getRepTabConnection();
- break;
- case 6:
- return $this->getRepTabCreateDate();
- break;
- case 7:
- return $this->getRepTabStatus();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ReportTablePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getRepTabUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getRepTabName(),
- $keys[3] => $this->getRepTabType(),
- $keys[4] => $this->getRepTabGrid(),
- $keys[5] => $this->getRepTabConnection(),
- $keys[6] => $this->getRepTabCreateDate(),
- $keys[7] => $this->getRepTabStatus(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ReportTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setRepTabUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setRepTabName($value);
- break;
- case 3:
- $this->setRepTabType($value);
- break;
- case 4:
- $this->setRepTabGrid($value);
- break;
- case 5:
- $this->setRepTabConnection($value);
- break;
- case 6:
- $this->setRepTabCreateDate($value);
- break;
- case 7:
- $this->setRepTabStatus($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ReportTablePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setRepTabUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setRepTabName($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setRepTabType($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setRepTabGrid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setRepTabConnection($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setRepTabCreateDate($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setRepTabStatus($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ReportTablePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ReportTablePeer::REP_TAB_UID)) $criteria->add(ReportTablePeer::REP_TAB_UID, $this->rep_tab_uid);
- if ($this->isColumnModified(ReportTablePeer::PRO_UID)) $criteria->add(ReportTablePeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(ReportTablePeer::REP_TAB_NAME)) $criteria->add(ReportTablePeer::REP_TAB_NAME, $this->rep_tab_name);
- if ($this->isColumnModified(ReportTablePeer::REP_TAB_TYPE)) $criteria->add(ReportTablePeer::REP_TAB_TYPE, $this->rep_tab_type);
- if ($this->isColumnModified(ReportTablePeer::REP_TAB_GRID)) $criteria->add(ReportTablePeer::REP_TAB_GRID, $this->rep_tab_grid);
- if ($this->isColumnModified(ReportTablePeer::REP_TAB_CONNECTION)) $criteria->add(ReportTablePeer::REP_TAB_CONNECTION, $this->rep_tab_connection);
- if ($this->isColumnModified(ReportTablePeer::REP_TAB_CREATE_DATE)) $criteria->add(ReportTablePeer::REP_TAB_CREATE_DATE, $this->rep_tab_create_date);
- if ($this->isColumnModified(ReportTablePeer::REP_TAB_STATUS)) $criteria->add(ReportTablePeer::REP_TAB_STATUS, $this->rep_tab_status);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ReportTablePeer::DATABASE_NAME);
-
- $criteria->add(ReportTablePeer::REP_TAB_UID, $this->rep_tab_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getRepTabUid();
- }
-
- /**
- * Generic method to set the primary key (rep_tab_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setRepTabUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of ReportTable (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setRepTabName($this->rep_tab_name);
-
- $copyObj->setRepTabType($this->rep_tab_type);
-
- $copyObj->setRepTabGrid($this->rep_tab_grid);
-
- $copyObj->setRepTabConnection($this->rep_tab_connection);
-
- $copyObj->setRepTabCreateDate($this->rep_tab_create_date);
-
- $copyObj->setRepTabStatus($this->rep_tab_status);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setRepTabUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return ReportTable Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ReportTablePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ReportTablePeer();
- }
- return self::$peer;
- }
-
-} // BaseReportTable
diff --git a/workflow/engine/classes/model/om/BaseReportTablePeer.php b/workflow/engine/classes/model/om/BaseReportTablePeer.php
index 2d493ac66..aa3d05563 100755
--- a/workflow/engine/classes/model/om/BaseReportTablePeer.php
+++ b/workflow/engine/classes/model/om/BaseReportTablePeer.php
@@ -12,607 +12,609 @@ include_once 'classes/model/ReportTable.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseReportTablePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'REPORT_TABLE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.ReportTable';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the REP_TAB_UID field */
- const REP_TAB_UID = 'REPORT_TABLE.REP_TAB_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'REPORT_TABLE.PRO_UID';
-
- /** the column name for the REP_TAB_NAME field */
- const REP_TAB_NAME = 'REPORT_TABLE.REP_TAB_NAME';
-
- /** the column name for the REP_TAB_TYPE field */
- const REP_TAB_TYPE = 'REPORT_TABLE.REP_TAB_TYPE';
-
- /** the column name for the REP_TAB_GRID field */
- const REP_TAB_GRID = 'REPORT_TABLE.REP_TAB_GRID';
-
- /** the column name for the REP_TAB_CONNECTION field */
- const REP_TAB_CONNECTION = 'REPORT_TABLE.REP_TAB_CONNECTION';
-
- /** the column name for the REP_TAB_CREATE_DATE field */
- const REP_TAB_CREATE_DATE = 'REPORT_TABLE.REP_TAB_CREATE_DATE';
-
- /** the column name for the REP_TAB_STATUS field */
- const REP_TAB_STATUS = 'REPORT_TABLE.REP_TAB_STATUS';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('RepTabUid', 'ProUid', 'RepTabName', 'RepTabType', 'RepTabGrid', 'RepTabConnection', 'RepTabCreateDate', 'RepTabStatus', ),
- BasePeer::TYPE_COLNAME => array (ReportTablePeer::REP_TAB_UID, ReportTablePeer::PRO_UID, ReportTablePeer::REP_TAB_NAME, ReportTablePeer::REP_TAB_TYPE, ReportTablePeer::REP_TAB_GRID, ReportTablePeer::REP_TAB_CONNECTION, ReportTablePeer::REP_TAB_CREATE_DATE, ReportTablePeer::REP_TAB_STATUS, ),
- BasePeer::TYPE_FIELDNAME => array ('REP_TAB_UID', 'PRO_UID', 'REP_TAB_NAME', 'REP_TAB_TYPE', 'REP_TAB_GRID', 'REP_TAB_CONNECTION', 'REP_TAB_CREATE_DATE', 'REP_TAB_STATUS', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('RepTabUid' => 0, 'ProUid' => 1, 'RepTabName' => 2, 'RepTabType' => 3, 'RepTabGrid' => 4, 'RepTabConnection' => 5, 'RepTabCreateDate' => 6, 'RepTabStatus' => 7, ),
- BasePeer::TYPE_COLNAME => array (ReportTablePeer::REP_TAB_UID => 0, ReportTablePeer::PRO_UID => 1, ReportTablePeer::REP_TAB_NAME => 2, ReportTablePeer::REP_TAB_TYPE => 3, ReportTablePeer::REP_TAB_GRID => 4, ReportTablePeer::REP_TAB_CONNECTION => 5, ReportTablePeer::REP_TAB_CREATE_DATE => 6, ReportTablePeer::REP_TAB_STATUS => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('REP_TAB_UID' => 0, 'PRO_UID' => 1, 'REP_TAB_NAME' => 2, 'REP_TAB_TYPE' => 3, 'REP_TAB_GRID' => 4, 'REP_TAB_CONNECTION' => 5, 'REP_TAB_CREATE_DATE' => 6, 'REP_TAB_STATUS' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ReportTableMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ReportTableMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ReportTablePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ReportTablePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ReportTablePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ReportTablePeer::REP_TAB_UID);
-
- $criteria->addSelectColumn(ReportTablePeer::PRO_UID);
-
- $criteria->addSelectColumn(ReportTablePeer::REP_TAB_NAME);
-
- $criteria->addSelectColumn(ReportTablePeer::REP_TAB_TYPE);
-
- $criteria->addSelectColumn(ReportTablePeer::REP_TAB_GRID);
-
- $criteria->addSelectColumn(ReportTablePeer::REP_TAB_CONNECTION);
-
- $criteria->addSelectColumn(ReportTablePeer::REP_TAB_CREATE_DATE);
-
- $criteria->addSelectColumn(ReportTablePeer::REP_TAB_STATUS);
-
- }
-
- const COUNT = 'COUNT(REPORT_TABLE.REP_TAB_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT REPORT_TABLE.REP_TAB_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ReportTablePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ReportTablePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ReportTablePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return ReportTable
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ReportTablePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ReportTablePeer::populateObjects(ReportTablePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ReportTablePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ReportTablePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ReportTablePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a ReportTable or Criteria object.
- *
- * @param mixed $values Criteria or ReportTable object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from ReportTable object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a ReportTable or Criteria object.
- *
- * @param mixed $values Criteria or ReportTable object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ReportTablePeer::REP_TAB_UID);
- $selectCriteria->add(ReportTablePeer::REP_TAB_UID, $criteria->remove(ReportTablePeer::REP_TAB_UID), $comparison);
-
- } else { // $values is ReportTable object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the REPORT_TABLE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ReportTablePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a ReportTable or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ReportTable object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof ReportTable) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ReportTablePeer::REP_TAB_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given ReportTable object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param ReportTable $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(ReportTable $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ReportTablePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ReportTablePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_UID))
- $columns[ReportTablePeer::REP_TAB_UID] = $obj->getRepTabUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::PRO_UID))
- $columns[ReportTablePeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_NAME))
- $columns[ReportTablePeer::REP_TAB_NAME] = $obj->getRepTabName();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_TYPE))
- $columns[ReportTablePeer::REP_TAB_TYPE] = $obj->getRepTabType();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_CONNECTION))
- $columns[ReportTablePeer::REP_TAB_CONNECTION] = $obj->getRepTabConnection();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_STATUS))
- $columns[ReportTablePeer::REP_TAB_STATUS] = $obj->getRepTabStatus();
-
- }
-
- return BasePeer::doValidate(ReportTablePeer::DATABASE_NAME, ReportTablePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return ReportTable
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ReportTablePeer::DATABASE_NAME);
-
- $criteria->add(ReportTablePeer::REP_TAB_UID, $pk);
-
-
- $v = ReportTablePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ReportTablePeer::REP_TAB_UID, $pks, Criteria::IN);
- $objs = ReportTablePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseReportTablePeer
+abstract class BaseReportTablePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'REPORT_TABLE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.ReportTable';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the REP_TAB_UID field */
+ const REP_TAB_UID = 'REPORT_TABLE.REP_TAB_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'REPORT_TABLE.PRO_UID';
+
+ /** the column name for the REP_TAB_NAME field */
+ const REP_TAB_NAME = 'REPORT_TABLE.REP_TAB_NAME';
+
+ /** the column name for the REP_TAB_TYPE field */
+ const REP_TAB_TYPE = 'REPORT_TABLE.REP_TAB_TYPE';
+
+ /** the column name for the REP_TAB_GRID field */
+ const REP_TAB_GRID = 'REPORT_TABLE.REP_TAB_GRID';
+
+ /** the column name for the REP_TAB_CONNECTION field */
+ const REP_TAB_CONNECTION = 'REPORT_TABLE.REP_TAB_CONNECTION';
+
+ /** the column name for the REP_TAB_CREATE_DATE field */
+ const REP_TAB_CREATE_DATE = 'REPORT_TABLE.REP_TAB_CREATE_DATE';
+
+ /** the column name for the REP_TAB_STATUS field */
+ const REP_TAB_STATUS = 'REPORT_TABLE.REP_TAB_STATUS';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('RepTabUid', 'ProUid', 'RepTabName', 'RepTabType', 'RepTabGrid', 'RepTabConnection', 'RepTabCreateDate', 'RepTabStatus', ),
+ BasePeer::TYPE_COLNAME => array (ReportTablePeer::REP_TAB_UID, ReportTablePeer::PRO_UID, ReportTablePeer::REP_TAB_NAME, ReportTablePeer::REP_TAB_TYPE, ReportTablePeer::REP_TAB_GRID, ReportTablePeer::REP_TAB_CONNECTION, ReportTablePeer::REP_TAB_CREATE_DATE, ReportTablePeer::REP_TAB_STATUS, ),
+ BasePeer::TYPE_FIELDNAME => array ('REP_TAB_UID', 'PRO_UID', 'REP_TAB_NAME', 'REP_TAB_TYPE', 'REP_TAB_GRID', 'REP_TAB_CONNECTION', 'REP_TAB_CREATE_DATE', 'REP_TAB_STATUS', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('RepTabUid' => 0, 'ProUid' => 1, 'RepTabName' => 2, 'RepTabType' => 3, 'RepTabGrid' => 4, 'RepTabConnection' => 5, 'RepTabCreateDate' => 6, 'RepTabStatus' => 7, ),
+ BasePeer::TYPE_COLNAME => array (ReportTablePeer::REP_TAB_UID => 0, ReportTablePeer::PRO_UID => 1, ReportTablePeer::REP_TAB_NAME => 2, ReportTablePeer::REP_TAB_TYPE => 3, ReportTablePeer::REP_TAB_GRID => 4, ReportTablePeer::REP_TAB_CONNECTION => 5, ReportTablePeer::REP_TAB_CREATE_DATE => 6, ReportTablePeer::REP_TAB_STATUS => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('REP_TAB_UID' => 0, 'PRO_UID' => 1, 'REP_TAB_NAME' => 2, 'REP_TAB_TYPE' => 3, 'REP_TAB_GRID' => 4, 'REP_TAB_CONNECTION' => 5, 'REP_TAB_CREATE_DATE' => 6, 'REP_TAB_STATUS' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ReportTableMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ReportTableMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ReportTablePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ReportTablePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ReportTablePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ReportTablePeer::REP_TAB_UID);
+
+ $criteria->addSelectColumn(ReportTablePeer::PRO_UID);
+
+ $criteria->addSelectColumn(ReportTablePeer::REP_TAB_NAME);
+
+ $criteria->addSelectColumn(ReportTablePeer::REP_TAB_TYPE);
+
+ $criteria->addSelectColumn(ReportTablePeer::REP_TAB_GRID);
+
+ $criteria->addSelectColumn(ReportTablePeer::REP_TAB_CONNECTION);
+
+ $criteria->addSelectColumn(ReportTablePeer::REP_TAB_CREATE_DATE);
+
+ $criteria->addSelectColumn(ReportTablePeer::REP_TAB_STATUS);
+
+ }
+
+ const COUNT = 'COUNT(REPORT_TABLE.REP_TAB_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT REPORT_TABLE.REP_TAB_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ReportTablePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ReportTablePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ReportTablePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return ReportTable
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ReportTablePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ReportTablePeer::populateObjects(ReportTablePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ReportTablePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ReportTablePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ReportTablePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a ReportTable or Criteria object.
+ *
+ * @param mixed $values Criteria or ReportTable object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from ReportTable object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a ReportTable or Criteria object.
+ *
+ * @param mixed $values Criteria or ReportTable object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ReportTablePeer::REP_TAB_UID);
+ $selectCriteria->add(ReportTablePeer::REP_TAB_UID, $criteria->remove(ReportTablePeer::REP_TAB_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the REPORT_TABLE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ReportTablePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a ReportTable or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ReportTable object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof ReportTable) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ReportTablePeer::REP_TAB_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given ReportTable object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param ReportTable $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(ReportTable $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ReportTablePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ReportTablePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_UID))
+ $columns[ReportTablePeer::REP_TAB_UID] = $obj->getRepTabUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::PRO_UID))
+ $columns[ReportTablePeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_NAME))
+ $columns[ReportTablePeer::REP_TAB_NAME] = $obj->getRepTabName();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_TYPE))
+ $columns[ReportTablePeer::REP_TAB_TYPE] = $obj->getRepTabType();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_CONNECTION))
+ $columns[ReportTablePeer::REP_TAB_CONNECTION] = $obj->getRepTabConnection();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportTablePeer::REP_TAB_STATUS))
+ $columns[ReportTablePeer::REP_TAB_STATUS] = $obj->getRepTabStatus();
+
+ }
+
+ return BasePeer::doValidate(ReportTablePeer::DATABASE_NAME, ReportTablePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return ReportTable
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ReportTablePeer::DATABASE_NAME);
+
+ $criteria->add(ReportTablePeer::REP_TAB_UID, $pk);
+
+
+ $v = ReportTablePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ReportTablePeer::REP_TAB_UID, $pks, Criteria::IN);
+ $objs = ReportTablePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseReportTablePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseReportTablePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ReportTableMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ReportTableMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ReportTableMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ReportTableMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseReportVar.php b/workflow/engine/classes/model/om/BaseReportVar.php
index 5468ac913..737ce15c7 100755
--- a/workflow/engine/classes/model/om/BaseReportVar.php
+++ b/workflow/engine/classes/model/om/BaseReportVar.php
@@ -16,701 +16,727 @@ include_once 'classes/model/ReportVarPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseReportVar extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ReportVarPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the rep_var_uid field.
- * @var string
- */
- protected $rep_var_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the rep_tab_uid field.
- * @var string
- */
- protected $rep_tab_uid = '';
-
-
- /**
- * The value for the rep_var_name field.
- * @var string
- */
- protected $rep_var_name = '';
-
-
- /**
- * The value for the rep_var_type field.
- * @var string
- */
- protected $rep_var_type = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [rep_var_uid] column value.
- *
- * @return string
- */
- public function getRepVarUid()
- {
-
- return $this->rep_var_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [rep_tab_uid] column value.
- *
- * @return string
- */
- public function getRepTabUid()
- {
-
- return $this->rep_tab_uid;
- }
-
- /**
- * Get the [rep_var_name] column value.
- *
- * @return string
- */
- public function getRepVarName()
- {
-
- return $this->rep_var_name;
- }
-
- /**
- * Get the [rep_var_type] column value.
- *
- * @return string
- */
- public function getRepVarType()
- {
-
- return $this->rep_var_type;
- }
-
- /**
- * Set the value of [rep_var_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepVarUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_var_uid !== $v || $v === '') {
- $this->rep_var_uid = $v;
- $this->modifiedColumns[] = ReportVarPeer::REP_VAR_UID;
- }
-
- } // setRepVarUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = ReportVarPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [rep_tab_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepTabUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_tab_uid !== $v || $v === '') {
- $this->rep_tab_uid = $v;
- $this->modifiedColumns[] = ReportVarPeer::REP_TAB_UID;
- }
-
- } // setRepTabUid()
-
- /**
- * Set the value of [rep_var_name] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepVarName($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_var_name !== $v || $v === '') {
- $this->rep_var_name = $v;
- $this->modifiedColumns[] = ReportVarPeer::REP_VAR_NAME;
- }
-
- } // setRepVarName()
-
- /**
- * Set the value of [rep_var_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRepVarType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rep_var_type !== $v || $v === '') {
- $this->rep_var_type = $v;
- $this->modifiedColumns[] = ReportVarPeer::REP_VAR_TYPE;
- }
-
- } // setRepVarType()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->rep_var_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->rep_tab_uid = $rs->getString($startcol + 2);
-
- $this->rep_var_name = $rs->getString($startcol + 3);
-
- $this->rep_var_type = $rs->getString($startcol + 4);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = ReportVarPeer::NUM_COLUMNS - ReportVarPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating ReportVar object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ReportVarPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ReportVarPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ReportVarPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ReportVarPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ReportVarPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ReportVarPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ReportVarPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getRepVarUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getRepTabUid();
- break;
- case 3:
- return $this->getRepVarName();
- break;
- case 4:
- return $this->getRepVarType();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ReportVarPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getRepVarUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getRepTabUid(),
- $keys[3] => $this->getRepVarName(),
- $keys[4] => $this->getRepVarType(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ReportVarPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setRepVarUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setRepTabUid($value);
- break;
- case 3:
- $this->setRepVarName($value);
- break;
- case 4:
- $this->setRepVarType($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ReportVarPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setRepVarUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setRepTabUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setRepVarName($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setRepVarType($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ReportVarPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ReportVarPeer::REP_VAR_UID)) $criteria->add(ReportVarPeer::REP_VAR_UID, $this->rep_var_uid);
- if ($this->isColumnModified(ReportVarPeer::PRO_UID)) $criteria->add(ReportVarPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(ReportVarPeer::REP_TAB_UID)) $criteria->add(ReportVarPeer::REP_TAB_UID, $this->rep_tab_uid);
- if ($this->isColumnModified(ReportVarPeer::REP_VAR_NAME)) $criteria->add(ReportVarPeer::REP_VAR_NAME, $this->rep_var_name);
- if ($this->isColumnModified(ReportVarPeer::REP_VAR_TYPE)) $criteria->add(ReportVarPeer::REP_VAR_TYPE, $this->rep_var_type);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ReportVarPeer::DATABASE_NAME);
-
- $criteria->add(ReportVarPeer::REP_VAR_UID, $this->rep_var_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getRepVarUid();
- }
-
- /**
- * Generic method to set the primary key (rep_var_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setRepVarUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of ReportVar (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setRepTabUid($this->rep_tab_uid);
-
- $copyObj->setRepVarName($this->rep_var_name);
-
- $copyObj->setRepVarType($this->rep_var_type);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setRepVarUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return ReportVar Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ReportVarPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ReportVarPeer();
- }
- return self::$peer;
- }
-
-} // BaseReportVar
+abstract class BaseReportVar extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ReportVarPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the rep_var_uid field.
+ * @var string
+ */
+ protected $rep_var_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the rep_tab_uid field.
+ * @var string
+ */
+ protected $rep_tab_uid = '';
+
+ /**
+ * The value for the rep_var_name field.
+ * @var string
+ */
+ protected $rep_var_name = '';
+
+ /**
+ * The value for the rep_var_type field.
+ * @var string
+ */
+ protected $rep_var_type = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [rep_var_uid] column value.
+ *
+ * @return string
+ */
+ public function getRepVarUid()
+ {
+
+ return $this->rep_var_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [rep_tab_uid] column value.
+ *
+ * @return string
+ */
+ public function getRepTabUid()
+ {
+
+ return $this->rep_tab_uid;
+ }
+
+ /**
+ * Get the [rep_var_name] column value.
+ *
+ * @return string
+ */
+ public function getRepVarName()
+ {
+
+ return $this->rep_var_name;
+ }
+
+ /**
+ * Get the [rep_var_type] column value.
+ *
+ * @return string
+ */
+ public function getRepVarType()
+ {
+
+ return $this->rep_var_type;
+ }
+
+ /**
+ * Set the value of [rep_var_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepVarUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_var_uid !== $v || $v === '') {
+ $this->rep_var_uid = $v;
+ $this->modifiedColumns[] = ReportVarPeer::REP_VAR_UID;
+ }
+
+ } // setRepVarUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = ReportVarPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [rep_tab_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepTabUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_tab_uid !== $v || $v === '') {
+ $this->rep_tab_uid = $v;
+ $this->modifiedColumns[] = ReportVarPeer::REP_TAB_UID;
+ }
+
+ } // setRepTabUid()
+
+ /**
+ * Set the value of [rep_var_name] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepVarName($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_var_name !== $v || $v === '') {
+ $this->rep_var_name = $v;
+ $this->modifiedColumns[] = ReportVarPeer::REP_VAR_NAME;
+ }
+
+ } // setRepVarName()
+
+ /**
+ * Set the value of [rep_var_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRepVarType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rep_var_type !== $v || $v === '') {
+ $this->rep_var_type = $v;
+ $this->modifiedColumns[] = ReportVarPeer::REP_VAR_TYPE;
+ }
+
+ } // setRepVarType()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->rep_var_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->rep_tab_uid = $rs->getString($startcol + 2);
+
+ $this->rep_var_name = $rs->getString($startcol + 3);
+
+ $this->rep_var_type = $rs->getString($startcol + 4);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = ReportVarPeer::NUM_COLUMNS - ReportVarPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating ReportVar object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ReportVarPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ReportVarPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ReportVarPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ReportVarPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ReportVarPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ReportVarPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ReportVarPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getRepVarUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getRepTabUid();
+ break;
+ case 3:
+ return $this->getRepVarName();
+ break;
+ case 4:
+ return $this->getRepVarType();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ReportVarPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getRepVarUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getRepTabUid(),
+ $keys[3] => $this->getRepVarName(),
+ $keys[4] => $this->getRepVarType(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ReportVarPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setRepVarUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setRepTabUid($value);
+ break;
+ case 3:
+ $this->setRepVarName($value);
+ break;
+ case 4:
+ $this->setRepVarType($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ReportVarPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setRepVarUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setRepTabUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setRepVarName($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setRepVarType($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ReportVarPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ReportVarPeer::REP_VAR_UID)) {
+ $criteria->add(ReportVarPeer::REP_VAR_UID, $this->rep_var_uid);
+ }
+
+ if ($this->isColumnModified(ReportVarPeer::PRO_UID)) {
+ $criteria->add(ReportVarPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(ReportVarPeer::REP_TAB_UID)) {
+ $criteria->add(ReportVarPeer::REP_TAB_UID, $this->rep_tab_uid);
+ }
+
+ if ($this->isColumnModified(ReportVarPeer::REP_VAR_NAME)) {
+ $criteria->add(ReportVarPeer::REP_VAR_NAME, $this->rep_var_name);
+ }
+
+ if ($this->isColumnModified(ReportVarPeer::REP_VAR_TYPE)) {
+ $criteria->add(ReportVarPeer::REP_VAR_TYPE, $this->rep_var_type);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ReportVarPeer::DATABASE_NAME);
+
+ $criteria->add(ReportVarPeer::REP_VAR_UID, $this->rep_var_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getRepVarUid();
+ }
+
+ /**
+ * Generic method to set the primary key (rep_var_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setRepVarUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of ReportVar (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setRepTabUid($this->rep_tab_uid);
+
+ $copyObj->setRepVarName($this->rep_var_name);
+
+ $copyObj->setRepVarType($this->rep_var_type);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setRepVarUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return ReportVar Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ReportVarPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ReportVarPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseReportVarPeer.php b/workflow/engine/classes/model/om/BaseReportVarPeer.php
index f51f66d5c..112b4c3c0 100755
--- a/workflow/engine/classes/model/om/BaseReportVarPeer.php
+++ b/workflow/engine/classes/model/om/BaseReportVarPeer.php
@@ -12,586 +12,588 @@ include_once 'classes/model/ReportVar.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseReportVarPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'REPORT_VAR';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.ReportVar';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the REP_VAR_UID field */
- const REP_VAR_UID = 'REPORT_VAR.REP_VAR_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'REPORT_VAR.PRO_UID';
-
- /** the column name for the REP_TAB_UID field */
- const REP_TAB_UID = 'REPORT_VAR.REP_TAB_UID';
-
- /** the column name for the REP_VAR_NAME field */
- const REP_VAR_NAME = 'REPORT_VAR.REP_VAR_NAME';
-
- /** the column name for the REP_VAR_TYPE field */
- const REP_VAR_TYPE = 'REPORT_VAR.REP_VAR_TYPE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('RepVarUid', 'ProUid', 'RepTabUid', 'RepVarName', 'RepVarType', ),
- BasePeer::TYPE_COLNAME => array (ReportVarPeer::REP_VAR_UID, ReportVarPeer::PRO_UID, ReportVarPeer::REP_TAB_UID, ReportVarPeer::REP_VAR_NAME, ReportVarPeer::REP_VAR_TYPE, ),
- BasePeer::TYPE_FIELDNAME => array ('REP_VAR_UID', 'PRO_UID', 'REP_TAB_UID', 'REP_VAR_NAME', 'REP_VAR_TYPE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('RepVarUid' => 0, 'ProUid' => 1, 'RepTabUid' => 2, 'RepVarName' => 3, 'RepVarType' => 4, ),
- BasePeer::TYPE_COLNAME => array (ReportVarPeer::REP_VAR_UID => 0, ReportVarPeer::PRO_UID => 1, ReportVarPeer::REP_TAB_UID => 2, ReportVarPeer::REP_VAR_NAME => 3, ReportVarPeer::REP_VAR_TYPE => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('REP_VAR_UID' => 0, 'PRO_UID' => 1, 'REP_TAB_UID' => 2, 'REP_VAR_NAME' => 3, 'REP_VAR_TYPE' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ReportVarMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ReportVarMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ReportVarPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ReportVarPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ReportVarPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ReportVarPeer::REP_VAR_UID);
-
- $criteria->addSelectColumn(ReportVarPeer::PRO_UID);
-
- $criteria->addSelectColumn(ReportVarPeer::REP_TAB_UID);
-
- $criteria->addSelectColumn(ReportVarPeer::REP_VAR_NAME);
-
- $criteria->addSelectColumn(ReportVarPeer::REP_VAR_TYPE);
-
- }
-
- const COUNT = 'COUNT(REPORT_VAR.REP_VAR_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT REPORT_VAR.REP_VAR_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ReportVarPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ReportVarPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ReportVarPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return ReportVar
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ReportVarPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ReportVarPeer::populateObjects(ReportVarPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ReportVarPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ReportVarPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ReportVarPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a ReportVar or Criteria object.
- *
- * @param mixed $values Criteria or ReportVar object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from ReportVar object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a ReportVar or Criteria object.
- *
- * @param mixed $values Criteria or ReportVar object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ReportVarPeer::REP_VAR_UID);
- $selectCriteria->add(ReportVarPeer::REP_VAR_UID, $criteria->remove(ReportVarPeer::REP_VAR_UID), $comparison);
-
- } else { // $values is ReportVar object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the REPORT_VAR table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ReportVarPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a ReportVar or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ReportVar object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ReportVarPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof ReportVar) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ReportVarPeer::REP_VAR_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given ReportVar object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param ReportVar $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(ReportVar $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ReportVarPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ReportVarPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_VAR_UID))
- $columns[ReportVarPeer::REP_VAR_UID] = $obj->getRepVarUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_TAB_UID))
- $columns[ReportVarPeer::REP_TAB_UID] = $obj->getRepTabUid();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_VAR_NAME))
- $columns[ReportVarPeer::REP_VAR_NAME] = $obj->getRepVarName();
-
- if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_VAR_TYPE))
- $columns[ReportVarPeer::REP_VAR_TYPE] = $obj->getRepVarType();
-
- }
-
- return BasePeer::doValidate(ReportVarPeer::DATABASE_NAME, ReportVarPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return ReportVar
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ReportVarPeer::DATABASE_NAME);
-
- $criteria->add(ReportVarPeer::REP_VAR_UID, $pk);
-
-
- $v = ReportVarPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ReportVarPeer::REP_VAR_UID, $pks, Criteria::IN);
- $objs = ReportVarPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseReportVarPeer
+abstract class BaseReportVarPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'REPORT_VAR';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.ReportVar';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the REP_VAR_UID field */
+ const REP_VAR_UID = 'REPORT_VAR.REP_VAR_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'REPORT_VAR.PRO_UID';
+
+ /** the column name for the REP_TAB_UID field */
+ const REP_TAB_UID = 'REPORT_VAR.REP_TAB_UID';
+
+ /** the column name for the REP_VAR_NAME field */
+ const REP_VAR_NAME = 'REPORT_VAR.REP_VAR_NAME';
+
+ /** the column name for the REP_VAR_TYPE field */
+ const REP_VAR_TYPE = 'REPORT_VAR.REP_VAR_TYPE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('RepVarUid', 'ProUid', 'RepTabUid', 'RepVarName', 'RepVarType', ),
+ BasePeer::TYPE_COLNAME => array (ReportVarPeer::REP_VAR_UID, ReportVarPeer::PRO_UID, ReportVarPeer::REP_TAB_UID, ReportVarPeer::REP_VAR_NAME, ReportVarPeer::REP_VAR_TYPE, ),
+ BasePeer::TYPE_FIELDNAME => array ('REP_VAR_UID', 'PRO_UID', 'REP_TAB_UID', 'REP_VAR_NAME', 'REP_VAR_TYPE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('RepVarUid' => 0, 'ProUid' => 1, 'RepTabUid' => 2, 'RepVarName' => 3, 'RepVarType' => 4, ),
+ BasePeer::TYPE_COLNAME => array (ReportVarPeer::REP_VAR_UID => 0, ReportVarPeer::PRO_UID => 1, ReportVarPeer::REP_TAB_UID => 2, ReportVarPeer::REP_VAR_NAME => 3, ReportVarPeer::REP_VAR_TYPE => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('REP_VAR_UID' => 0, 'PRO_UID' => 1, 'REP_TAB_UID' => 2, 'REP_VAR_NAME' => 3, 'REP_VAR_TYPE' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ReportVarMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ReportVarMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ReportVarPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ReportVarPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ReportVarPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ReportVarPeer::REP_VAR_UID);
+
+ $criteria->addSelectColumn(ReportVarPeer::PRO_UID);
+
+ $criteria->addSelectColumn(ReportVarPeer::REP_TAB_UID);
+
+ $criteria->addSelectColumn(ReportVarPeer::REP_VAR_NAME);
+
+ $criteria->addSelectColumn(ReportVarPeer::REP_VAR_TYPE);
+
+ }
+
+ const COUNT = 'COUNT(REPORT_VAR.REP_VAR_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT REPORT_VAR.REP_VAR_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ReportVarPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ReportVarPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ReportVarPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return ReportVar
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ReportVarPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ReportVarPeer::populateObjects(ReportVarPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ReportVarPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ReportVarPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ReportVarPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a ReportVar or Criteria object.
+ *
+ * @param mixed $values Criteria or ReportVar object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from ReportVar object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a ReportVar or Criteria object.
+ *
+ * @param mixed $values Criteria or ReportVar object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ReportVarPeer::REP_VAR_UID);
+ $selectCriteria->add(ReportVarPeer::REP_VAR_UID, $criteria->remove(ReportVarPeer::REP_VAR_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the REPORT_VAR table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ReportVarPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a ReportVar or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ReportVar object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ReportVarPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof ReportVar) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ReportVarPeer::REP_VAR_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given ReportVar object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param ReportVar $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(ReportVar $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ReportVarPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ReportVarPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_VAR_UID))
+ $columns[ReportVarPeer::REP_VAR_UID] = $obj->getRepVarUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_TAB_UID))
+ $columns[ReportVarPeer::REP_TAB_UID] = $obj->getRepTabUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_VAR_NAME))
+ $columns[ReportVarPeer::REP_VAR_NAME] = $obj->getRepVarName();
+
+ if ($obj->isNew() || $obj->isColumnModified(ReportVarPeer::REP_VAR_TYPE))
+ $columns[ReportVarPeer::REP_VAR_TYPE] = $obj->getRepVarType();
+
+ }
+
+ return BasePeer::doValidate(ReportVarPeer::DATABASE_NAME, ReportVarPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return ReportVar
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ReportVarPeer::DATABASE_NAME);
+
+ $criteria->add(ReportVarPeer::REP_VAR_UID, $pk);
+
+
+ $v = ReportVarPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ReportVarPeer::REP_VAR_UID, $pks, Criteria::IN);
+ $objs = ReportVarPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseReportVarPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseReportVarPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ReportVarMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ReportVarMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ReportVarMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ReportVarMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseRoute.php b/workflow/engine/classes/model/om/BaseRoute.php
index 25a75da84..52efc60d8 100755
--- a/workflow/engine/classes/model/om/BaseRoute.php
+++ b/workflow/engine/classes/model/om/BaseRoute.php
@@ -16,1337 +16,1423 @@ include_once 'classes/model/RoutePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseRoute extends BaseObject implements Persistent {
+abstract class BaseRoute extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var RoutePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the rou_uid field.
+ * @var string
+ */
+ protected $rou_uid = '';
+
+ /**
+ * The value for the rou_parent field.
+ * @var string
+ */
+ protected $rou_parent = '0';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the rou_next_task field.
+ * @var string
+ */
+ protected $rou_next_task = '0';
+
+ /**
+ * The value for the rou_case field.
+ * @var int
+ */
+ protected $rou_case = 0;
+
+ /**
+ * The value for the rou_type field.
+ * @var string
+ */
+ protected $rou_type = 'SEQUENTIAL';
+
+ /**
+ * The value for the rou_condition field.
+ * @var string
+ */
+ protected $rou_condition = '';
+
+ /**
+ * The value for the rou_to_last_user field.
+ * @var string
+ */
+ protected $rou_to_last_user = 'FALSE';
+
+ /**
+ * The value for the rou_optional field.
+ * @var string
+ */
+ protected $rou_optional = 'FALSE';
+
+ /**
+ * The value for the rou_send_email field.
+ * @var string
+ */
+ protected $rou_send_email = 'TRUE';
+
+ /**
+ * The value for the rou_sourceanchor field.
+ * @var int
+ */
+ protected $rou_sourceanchor = 1;
+
+ /**
+ * The value for the rou_targetanchor field.
+ * @var int
+ */
+ protected $rou_targetanchor = 0;
+
+ /**
+ * The value for the rou_to_port field.
+ * @var int
+ */
+ protected $rou_to_port = 1;
+
+ /**
+ * The value for the rou_from_port field.
+ * @var int
+ */
+ protected $rou_from_port = 2;
+
+ /**
+ * The value for the rou_evn_uid field.
+ * @var string
+ */
+ protected $rou_evn_uid = '';
+
+ /**
+ * The value for the gat_uid field.
+ * @var string
+ */
+ protected $gat_uid = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [rou_uid] column value.
+ *
+ * @return string
+ */
+ public function getRouUid()
+ {
+
+ return $this->rou_uid;
+ }
+
+ /**
+ * Get the [rou_parent] column value.
+ *
+ * @return string
+ */
+ public function getRouParent()
+ {
+
+ return $this->rou_parent;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [rou_next_task] column value.
+ *
+ * @return string
+ */
+ public function getRouNextTask()
+ {
+
+ return $this->rou_next_task;
+ }
+
+ /**
+ * Get the [rou_case] column value.
+ *
+ * @return int
+ */
+ public function getRouCase()
+ {
+
+ return $this->rou_case;
+ }
+
+ /**
+ * Get the [rou_type] column value.
+ *
+ * @return string
+ */
+ public function getRouType()
+ {
+
+ return $this->rou_type;
+ }
+
+ /**
+ * Get the [rou_condition] column value.
+ *
+ * @return string
+ */
+ public function getRouCondition()
+ {
+
+ return $this->rou_condition;
+ }
+
+ /**
+ * Get the [rou_to_last_user] column value.
+ *
+ * @return string
+ */
+ public function getRouToLastUser()
+ {
+
+ return $this->rou_to_last_user;
+ }
+
+ /**
+ * Get the [rou_optional] column value.
+ *
+ * @return string
+ */
+ public function getRouOptional()
+ {
+
+ return $this->rou_optional;
+ }
+
+ /**
+ * Get the [rou_send_email] column value.
+ *
+ * @return string
+ */
+ public function getRouSendEmail()
+ {
+
+ return $this->rou_send_email;
+ }
+
+ /**
+ * Get the [rou_sourceanchor] column value.
+ *
+ * @return int
+ */
+ public function getRouSourceanchor()
+ {
+
+ return $this->rou_sourceanchor;
+ }
+
+ /**
+ * Get the [rou_targetanchor] column value.
+ *
+ * @return int
+ */
+ public function getRouTargetanchor()
+ {
+
+ return $this->rou_targetanchor;
+ }
+
+ /**
+ * Get the [rou_to_port] column value.
+ *
+ * @return int
+ */
+ public function getRouToPort()
+ {
+
+ return $this->rou_to_port;
+ }
+
+ /**
+ * Get the [rou_from_port] column value.
+ *
+ * @return int
+ */
+ public function getRouFromPort()
+ {
+
+ return $this->rou_from_port;
+ }
+
+ /**
+ * Get the [rou_evn_uid] column value.
+ *
+ * @return string
+ */
+ public function getRouEvnUid()
+ {
+
+ return $this->rou_evn_uid;
+ }
+
+ /**
+ * Get the [gat_uid] column value.
+ *
+ * @return string
+ */
+ public function getGatUid()
+ {
+
+ return $this->gat_uid;
+ }
+
+ /**
+ * Set the value of [rou_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_uid !== $v || $v === '') {
+ $this->rou_uid = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_UID;
+ }
+
+ } // setRouUid()
+
+ /**
+ * Set the value of [rou_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_parent !== $v || $v === '0') {
+ $this->rou_parent = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_PARENT;
+ }
+
+ } // setRouParent()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = RoutePeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = RoutePeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [rou_next_task] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouNextTask($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_next_task !== $v || $v === '0') {
+ $this->rou_next_task = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_NEXT_TASK;
+ }
+
+ } // setRouNextTask()
+
+ /**
+ * Set the value of [rou_case] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setRouCase($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->rou_case !== $v || $v === 0) {
+ $this->rou_case = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_CASE;
+ }
+
+ } // setRouCase()
+
+ /**
+ * Set the value of [rou_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_type !== $v || $v === 'SEQUENTIAL') {
+ $this->rou_type = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_TYPE;
+ }
+
+ } // setRouType()
+
+ /**
+ * Set the value of [rou_condition] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouCondition($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_condition !== $v || $v === '') {
+ $this->rou_condition = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_CONDITION;
+ }
+
+ } // setRouCondition()
+
+ /**
+ * Set the value of [rou_to_last_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouToLastUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_to_last_user !== $v || $v === 'FALSE') {
+ $this->rou_to_last_user = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_TO_LAST_USER;
+ }
+
+ } // setRouToLastUser()
+
+ /**
+ * Set the value of [rou_optional] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouOptional($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_optional !== $v || $v === 'FALSE') {
+ $this->rou_optional = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_OPTIONAL;
+ }
+
+ } // setRouOptional()
+
+ /**
+ * Set the value of [rou_send_email] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouSendEmail($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_send_email !== $v || $v === 'TRUE') {
+ $this->rou_send_email = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_SEND_EMAIL;
+ }
+
+ } // setRouSendEmail()
+
+ /**
+ * Set the value of [rou_sourceanchor] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setRouSourceanchor($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->rou_sourceanchor !== $v || $v === 1) {
+ $this->rou_sourceanchor = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_SOURCEANCHOR;
+ }
+
+ } // setRouSourceanchor()
+
+ /**
+ * Set the value of [rou_targetanchor] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setRouTargetanchor($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->rou_targetanchor !== $v || $v === 0) {
+ $this->rou_targetanchor = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_TARGETANCHOR;
+ }
+
+ } // setRouTargetanchor()
+
+ /**
+ * Set the value of [rou_to_port] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setRouToPort($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->rou_to_port !== $v || $v === 1) {
+ $this->rou_to_port = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_TO_PORT;
+ }
+
+ } // setRouToPort()
+
+ /**
+ * Set the value of [rou_from_port] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setRouFromPort($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->rou_from_port !== $v || $v === 2) {
+ $this->rou_from_port = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_FROM_PORT;
+ }
+
+ } // setRouFromPort()
+
+ /**
+ * Set the value of [rou_evn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setRouEvnUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->rou_evn_uid !== $v || $v === '') {
+ $this->rou_evn_uid = $v;
+ $this->modifiedColumns[] = RoutePeer::ROU_EVN_UID;
+ }
+
+ } // setRouEvnUid()
+
+ /**
+ * Set the value of [gat_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setGatUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->gat_uid !== $v || $v === '') {
+ $this->gat_uid = $v;
+ $this->modifiedColumns[] = RoutePeer::GAT_UID;
+ }
+
+ } // setGatUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->rou_uid = $rs->getString($startcol + 0);
+
+ $this->rou_parent = $rs->getString($startcol + 1);
+
+ $this->pro_uid = $rs->getString($startcol + 2);
+
+ $this->tas_uid = $rs->getString($startcol + 3);
+
+ $this->rou_next_task = $rs->getString($startcol + 4);
+
+ $this->rou_case = $rs->getInt($startcol + 5);
+
+ $this->rou_type = $rs->getString($startcol + 6);
+
+ $this->rou_condition = $rs->getString($startcol + 7);
+
+ $this->rou_to_last_user = $rs->getString($startcol + 8);
+
+ $this->rou_optional = $rs->getString($startcol + 9);
+
+ $this->rou_send_email = $rs->getString($startcol + 10);
+
+ $this->rou_sourceanchor = $rs->getInt($startcol + 11);
+
+ $this->rou_targetanchor = $rs->getInt($startcol + 12);
+
+ $this->rou_to_port = $rs->getInt($startcol + 13);
+
+ $this->rou_from_port = $rs->getInt($startcol + 14);
+
+ $this->rou_evn_uid = $rs->getString($startcol + 15);
+
+ $this->gat_uid = $rs->getString($startcol + 16);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 17; // 17 = RoutePeer::NUM_COLUMNS - RoutePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Route object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(RoutePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ RoutePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(RoutePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = RoutePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += RoutePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = RoutePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = RoutePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getRouUid();
+ break;
+ case 1:
+ return $this->getRouParent();
+ break;
+ case 2:
+ return $this->getProUid();
+ break;
+ case 3:
+ return $this->getTasUid();
+ break;
+ case 4:
+ return $this->getRouNextTask();
+ break;
+ case 5:
+ return $this->getRouCase();
+ break;
+ case 6:
+ return $this->getRouType();
+ break;
+ case 7:
+ return $this->getRouCondition();
+ break;
+ case 8:
+ return $this->getRouToLastUser();
+ break;
+ case 9:
+ return $this->getRouOptional();
+ break;
+ case 10:
+ return $this->getRouSendEmail();
+ break;
+ case 11:
+ return $this->getRouSourceanchor();
+ break;
+ case 12:
+ return $this->getRouTargetanchor();
+ break;
+ case 13:
+ return $this->getRouToPort();
+ break;
+ case 14:
+ return $this->getRouFromPort();
+ break;
+ case 15:
+ return $this->getRouEvnUid();
+ break;
+ case 16:
+ return $this->getGatUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = RoutePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getRouUid(),
+ $keys[1] => $this->getRouParent(),
+ $keys[2] => $this->getProUid(),
+ $keys[3] => $this->getTasUid(),
+ $keys[4] => $this->getRouNextTask(),
+ $keys[5] => $this->getRouCase(),
+ $keys[6] => $this->getRouType(),
+ $keys[7] => $this->getRouCondition(),
+ $keys[8] => $this->getRouToLastUser(),
+ $keys[9] => $this->getRouOptional(),
+ $keys[10] => $this->getRouSendEmail(),
+ $keys[11] => $this->getRouSourceanchor(),
+ $keys[12] => $this->getRouTargetanchor(),
+ $keys[13] => $this->getRouToPort(),
+ $keys[14] => $this->getRouFromPort(),
+ $keys[15] => $this->getRouEvnUid(),
+ $keys[16] => $this->getGatUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = RoutePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setRouUid($value);
+ break;
+ case 1:
+ $this->setRouParent($value);
+ break;
+ case 2:
+ $this->setProUid($value);
+ break;
+ case 3:
+ $this->setTasUid($value);
+ break;
+ case 4:
+ $this->setRouNextTask($value);
+ break;
+ case 5:
+ $this->setRouCase($value);
+ break;
+ case 6:
+ $this->setRouType($value);
+ break;
+ case 7:
+ $this->setRouCondition($value);
+ break;
+ case 8:
+ $this->setRouToLastUser($value);
+ break;
+ case 9:
+ $this->setRouOptional($value);
+ break;
+ case 10:
+ $this->setRouSendEmail($value);
+ break;
+ case 11:
+ $this->setRouSourceanchor($value);
+ break;
+ case 12:
+ $this->setRouTargetanchor($value);
+ break;
+ case 13:
+ $this->setRouToPort($value);
+ break;
+ case 14:
+ $this->setRouFromPort($value);
+ break;
+ case 15:
+ $this->setRouEvnUid($value);
+ break;
+ case 16:
+ $this->setGatUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = RoutePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setRouUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setRouParent($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setProUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setTasUid($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setRouNextTask($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setRouCase($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setRouType($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setRouCondition($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setRouToLastUser($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setRouOptional($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setRouSendEmail($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setRouSourceanchor($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setRouTargetanchor($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setRouToPort($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setRouFromPort($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setRouEvnUid($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setGatUid($arr[$keys[16]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(RoutePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(RoutePeer::ROU_UID)) {
+ $criteria->add(RoutePeer::ROU_UID, $this->rou_uid);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_PARENT)) {
+ $criteria->add(RoutePeer::ROU_PARENT, $this->rou_parent);
+ }
+
+ if ($this->isColumnModified(RoutePeer::PRO_UID)) {
+ $criteria->add(RoutePeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(RoutePeer::TAS_UID)) {
+ $criteria->add(RoutePeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_NEXT_TASK)) {
+ $criteria->add(RoutePeer::ROU_NEXT_TASK, $this->rou_next_task);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_CASE)) {
+ $criteria->add(RoutePeer::ROU_CASE, $this->rou_case);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_TYPE)) {
+ $criteria->add(RoutePeer::ROU_TYPE, $this->rou_type);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_CONDITION)) {
+ $criteria->add(RoutePeer::ROU_CONDITION, $this->rou_condition);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_TO_LAST_USER)) {
+ $criteria->add(RoutePeer::ROU_TO_LAST_USER, $this->rou_to_last_user);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_OPTIONAL)) {
+ $criteria->add(RoutePeer::ROU_OPTIONAL, $this->rou_optional);
+ }
+
+ if ($this->isColumnModified(RoutePeer::ROU_SEND_EMAIL)) {
+ $criteria->add(RoutePeer::ROU_SEND_EMAIL, $this->rou_send_email);
+ }
+ if ($this->isColumnModified(RoutePeer::ROU_SOURCEANCHOR)) {
+ $criteria->add(RoutePeer::ROU_SOURCEANCHOR, $this->rou_sourceanchor);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var RoutePeer
- */
- protected static $peer;
+ if ($this->isColumnModified(RoutePeer::ROU_TARGETANCHOR)) {
+ $criteria->add(RoutePeer::ROU_TARGETANCHOR, $this->rou_targetanchor);
+ }
+ if ($this->isColumnModified(RoutePeer::ROU_TO_PORT)) {
+ $criteria->add(RoutePeer::ROU_TO_PORT, $this->rou_to_port);
+ }
- /**
- * The value for the rou_uid field.
- * @var string
- */
- protected $rou_uid = '';
+ if ($this->isColumnModified(RoutePeer::ROU_FROM_PORT)) {
+ $criteria->add(RoutePeer::ROU_FROM_PORT, $this->rou_from_port);
+ }
+ if ($this->isColumnModified(RoutePeer::ROU_EVN_UID)) {
+ $criteria->add(RoutePeer::ROU_EVN_UID, $this->rou_evn_uid);
+ }
- /**
- * The value for the rou_parent field.
- * @var string
- */
- protected $rou_parent = '0';
+ if ($this->isColumnModified(RoutePeer::GAT_UID)) {
+ $criteria->add(RoutePeer::GAT_UID, $this->gat_uid);
+ }
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(RoutePeer::DATABASE_NAME);
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
+ $criteria->add(RoutePeer::ROU_UID, $this->rou_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getRouUid();
+ }
+
+ /**
+ * Generic method to set the primary key (rou_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setRouUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Route (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setRouParent($this->rou_parent);
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTasUid($this->tas_uid);
+
+ $copyObj->setRouNextTask($this->rou_next_task);
+
+ $copyObj->setRouCase($this->rou_case);
+
+ $copyObj->setRouType($this->rou_type);
+
+ $copyObj->setRouCondition($this->rou_condition);
+
+ $copyObj->setRouToLastUser($this->rou_to_last_user);
+
+ $copyObj->setRouOptional($this->rou_optional);
+
+ $copyObj->setRouSendEmail($this->rou_send_email);
+
+ $copyObj->setRouSourceanchor($this->rou_sourceanchor);
+
+ $copyObj->setRouTargetanchor($this->rou_targetanchor);
+
+ $copyObj->setRouToPort($this->rou_to_port);
+
+ $copyObj->setRouFromPort($this->rou_from_port);
+
+ $copyObj->setRouEvnUid($this->rou_evn_uid);
+
+ $copyObj->setGatUid($this->gat_uid);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setRouUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Route Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return RoutePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new RoutePeer();
+ }
+ return self::$peer;
+ }
+}
-
- /**
- * The value for the rou_next_task field.
- * @var string
- */
- protected $rou_next_task = '0';
-
-
- /**
- * The value for the rou_case field.
- * @var int
- */
- protected $rou_case = 0;
-
-
- /**
- * The value for the rou_type field.
- * @var string
- */
- protected $rou_type = 'SEQUENTIAL';
-
-
- /**
- * The value for the rou_condition field.
- * @var string
- */
- protected $rou_condition = '';
-
-
- /**
- * The value for the rou_to_last_user field.
- * @var string
- */
- protected $rou_to_last_user = 'FALSE';
-
-
- /**
- * The value for the rou_optional field.
- * @var string
- */
- protected $rou_optional = 'FALSE';
-
-
- /**
- * The value for the rou_send_email field.
- * @var string
- */
- protected $rou_send_email = 'TRUE';
-
-
- /**
- * The value for the rou_sourceanchor field.
- * @var int
- */
- protected $rou_sourceanchor = 1;
-
-
- /**
- * The value for the rou_targetanchor field.
- * @var int
- */
- protected $rou_targetanchor = 0;
-
-
- /**
- * The value for the rou_to_port field.
- * @var int
- */
- protected $rou_to_port = 1;
-
-
- /**
- * The value for the rou_from_port field.
- * @var int
- */
- protected $rou_from_port = 2;
-
-
- /**
- * The value for the rou_evn_uid field.
- * @var string
- */
- protected $rou_evn_uid = '';
-
-
- /**
- * The value for the gat_uid field.
- * @var string
- */
- protected $gat_uid = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [rou_uid] column value.
- *
- * @return string
- */
- public function getRouUid()
- {
-
- return $this->rou_uid;
- }
-
- /**
- * Get the [rou_parent] column value.
- *
- * @return string
- */
- public function getRouParent()
- {
-
- return $this->rou_parent;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [rou_next_task] column value.
- *
- * @return string
- */
- public function getRouNextTask()
- {
-
- return $this->rou_next_task;
- }
-
- /**
- * Get the [rou_case] column value.
- *
- * @return int
- */
- public function getRouCase()
- {
-
- return $this->rou_case;
- }
-
- /**
- * Get the [rou_type] column value.
- *
- * @return string
- */
- public function getRouType()
- {
-
- return $this->rou_type;
- }
-
- /**
- * Get the [rou_condition] column value.
- *
- * @return string
- */
- public function getRouCondition()
- {
-
- return $this->rou_condition;
- }
-
- /**
- * Get the [rou_to_last_user] column value.
- *
- * @return string
- */
- public function getRouToLastUser()
- {
-
- return $this->rou_to_last_user;
- }
-
- /**
- * Get the [rou_optional] column value.
- *
- * @return string
- */
- public function getRouOptional()
- {
-
- return $this->rou_optional;
- }
-
- /**
- * Get the [rou_send_email] column value.
- *
- * @return string
- */
- public function getRouSendEmail()
- {
-
- return $this->rou_send_email;
- }
-
- /**
- * Get the [rou_sourceanchor] column value.
- *
- * @return int
- */
- public function getRouSourceanchor()
- {
-
- return $this->rou_sourceanchor;
- }
-
- /**
- * Get the [rou_targetanchor] column value.
- *
- * @return int
- */
- public function getRouTargetanchor()
- {
-
- return $this->rou_targetanchor;
- }
-
- /**
- * Get the [rou_to_port] column value.
- *
- * @return int
- */
- public function getRouToPort()
- {
-
- return $this->rou_to_port;
- }
-
- /**
- * Get the [rou_from_port] column value.
- *
- * @return int
- */
- public function getRouFromPort()
- {
-
- return $this->rou_from_port;
- }
-
- /**
- * Get the [rou_evn_uid] column value.
- *
- * @return string
- */
- public function getRouEvnUid()
- {
-
- return $this->rou_evn_uid;
- }
-
- /**
- * Get the [gat_uid] column value.
- *
- * @return string
- */
- public function getGatUid()
- {
-
- return $this->gat_uid;
- }
-
- /**
- * Set the value of [rou_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_uid !== $v || $v === '') {
- $this->rou_uid = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_UID;
- }
-
- } // setRouUid()
-
- /**
- * Set the value of [rou_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_parent !== $v || $v === '0') {
- $this->rou_parent = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_PARENT;
- }
-
- } // setRouParent()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = RoutePeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = RoutePeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [rou_next_task] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouNextTask($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_next_task !== $v || $v === '0') {
- $this->rou_next_task = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_NEXT_TASK;
- }
-
- } // setRouNextTask()
-
- /**
- * Set the value of [rou_case] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setRouCase($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->rou_case !== $v || $v === 0) {
- $this->rou_case = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_CASE;
- }
-
- } // setRouCase()
-
- /**
- * Set the value of [rou_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_type !== $v || $v === 'SEQUENTIAL') {
- $this->rou_type = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_TYPE;
- }
-
- } // setRouType()
-
- /**
- * Set the value of [rou_condition] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouCondition($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_condition !== $v || $v === '') {
- $this->rou_condition = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_CONDITION;
- }
-
- } // setRouCondition()
-
- /**
- * Set the value of [rou_to_last_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouToLastUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_to_last_user !== $v || $v === 'FALSE') {
- $this->rou_to_last_user = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_TO_LAST_USER;
- }
-
- } // setRouToLastUser()
-
- /**
- * Set the value of [rou_optional] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouOptional($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_optional !== $v || $v === 'FALSE') {
- $this->rou_optional = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_OPTIONAL;
- }
-
- } // setRouOptional()
-
- /**
- * Set the value of [rou_send_email] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouSendEmail($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_send_email !== $v || $v === 'TRUE') {
- $this->rou_send_email = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_SEND_EMAIL;
- }
-
- } // setRouSendEmail()
-
- /**
- * Set the value of [rou_sourceanchor] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setRouSourceanchor($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->rou_sourceanchor !== $v || $v === 1) {
- $this->rou_sourceanchor = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_SOURCEANCHOR;
- }
-
- } // setRouSourceanchor()
-
- /**
- * Set the value of [rou_targetanchor] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setRouTargetanchor($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->rou_targetanchor !== $v || $v === 0) {
- $this->rou_targetanchor = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_TARGETANCHOR;
- }
-
- } // setRouTargetanchor()
-
- /**
- * Set the value of [rou_to_port] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setRouToPort($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->rou_to_port !== $v || $v === 1) {
- $this->rou_to_port = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_TO_PORT;
- }
-
- } // setRouToPort()
-
- /**
- * Set the value of [rou_from_port] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setRouFromPort($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->rou_from_port !== $v || $v === 2) {
- $this->rou_from_port = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_FROM_PORT;
- }
-
- } // setRouFromPort()
-
- /**
- * Set the value of [rou_evn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setRouEvnUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->rou_evn_uid !== $v || $v === '') {
- $this->rou_evn_uid = $v;
- $this->modifiedColumns[] = RoutePeer::ROU_EVN_UID;
- }
-
- } // setRouEvnUid()
-
- /**
- * Set the value of [gat_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setGatUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->gat_uid !== $v || $v === '') {
- $this->gat_uid = $v;
- $this->modifiedColumns[] = RoutePeer::GAT_UID;
- }
-
- } // setGatUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->rou_uid = $rs->getString($startcol + 0);
-
- $this->rou_parent = $rs->getString($startcol + 1);
-
- $this->pro_uid = $rs->getString($startcol + 2);
-
- $this->tas_uid = $rs->getString($startcol + 3);
-
- $this->rou_next_task = $rs->getString($startcol + 4);
-
- $this->rou_case = $rs->getInt($startcol + 5);
-
- $this->rou_type = $rs->getString($startcol + 6);
-
- $this->rou_condition = $rs->getString($startcol + 7);
-
- $this->rou_to_last_user = $rs->getString($startcol + 8);
-
- $this->rou_optional = $rs->getString($startcol + 9);
-
- $this->rou_send_email = $rs->getString($startcol + 10);
-
- $this->rou_sourceanchor = $rs->getInt($startcol + 11);
-
- $this->rou_targetanchor = $rs->getInt($startcol + 12);
-
- $this->rou_to_port = $rs->getInt($startcol + 13);
-
- $this->rou_from_port = $rs->getInt($startcol + 14);
-
- $this->rou_evn_uid = $rs->getString($startcol + 15);
-
- $this->gat_uid = $rs->getString($startcol + 16);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 17; // 17 = RoutePeer::NUM_COLUMNS - RoutePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Route object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(RoutePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- RoutePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(RoutePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = RoutePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += RoutePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = RoutePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = RoutePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getRouUid();
- break;
- case 1:
- return $this->getRouParent();
- break;
- case 2:
- return $this->getProUid();
- break;
- case 3:
- return $this->getTasUid();
- break;
- case 4:
- return $this->getRouNextTask();
- break;
- case 5:
- return $this->getRouCase();
- break;
- case 6:
- return $this->getRouType();
- break;
- case 7:
- return $this->getRouCondition();
- break;
- case 8:
- return $this->getRouToLastUser();
- break;
- case 9:
- return $this->getRouOptional();
- break;
- case 10:
- return $this->getRouSendEmail();
- break;
- case 11:
- return $this->getRouSourceanchor();
- break;
- case 12:
- return $this->getRouTargetanchor();
- break;
- case 13:
- return $this->getRouToPort();
- break;
- case 14:
- return $this->getRouFromPort();
- break;
- case 15:
- return $this->getRouEvnUid();
- break;
- case 16:
- return $this->getGatUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = RoutePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getRouUid(),
- $keys[1] => $this->getRouParent(),
- $keys[2] => $this->getProUid(),
- $keys[3] => $this->getTasUid(),
- $keys[4] => $this->getRouNextTask(),
- $keys[5] => $this->getRouCase(),
- $keys[6] => $this->getRouType(),
- $keys[7] => $this->getRouCondition(),
- $keys[8] => $this->getRouToLastUser(),
- $keys[9] => $this->getRouOptional(),
- $keys[10] => $this->getRouSendEmail(),
- $keys[11] => $this->getRouSourceanchor(),
- $keys[12] => $this->getRouTargetanchor(),
- $keys[13] => $this->getRouToPort(),
- $keys[14] => $this->getRouFromPort(),
- $keys[15] => $this->getRouEvnUid(),
- $keys[16] => $this->getGatUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = RoutePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setRouUid($value);
- break;
- case 1:
- $this->setRouParent($value);
- break;
- case 2:
- $this->setProUid($value);
- break;
- case 3:
- $this->setTasUid($value);
- break;
- case 4:
- $this->setRouNextTask($value);
- break;
- case 5:
- $this->setRouCase($value);
- break;
- case 6:
- $this->setRouType($value);
- break;
- case 7:
- $this->setRouCondition($value);
- break;
- case 8:
- $this->setRouToLastUser($value);
- break;
- case 9:
- $this->setRouOptional($value);
- break;
- case 10:
- $this->setRouSendEmail($value);
- break;
- case 11:
- $this->setRouSourceanchor($value);
- break;
- case 12:
- $this->setRouTargetanchor($value);
- break;
- case 13:
- $this->setRouToPort($value);
- break;
- case 14:
- $this->setRouFromPort($value);
- break;
- case 15:
- $this->setRouEvnUid($value);
- break;
- case 16:
- $this->setGatUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = RoutePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setRouUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setRouParent($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setProUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setTasUid($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setRouNextTask($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setRouCase($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setRouType($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setRouCondition($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setRouToLastUser($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setRouOptional($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setRouSendEmail($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setRouSourceanchor($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setRouTargetanchor($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setRouToPort($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setRouFromPort($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setRouEvnUid($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setGatUid($arr[$keys[16]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(RoutePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(RoutePeer::ROU_UID)) $criteria->add(RoutePeer::ROU_UID, $this->rou_uid);
- if ($this->isColumnModified(RoutePeer::ROU_PARENT)) $criteria->add(RoutePeer::ROU_PARENT, $this->rou_parent);
- if ($this->isColumnModified(RoutePeer::PRO_UID)) $criteria->add(RoutePeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(RoutePeer::TAS_UID)) $criteria->add(RoutePeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(RoutePeer::ROU_NEXT_TASK)) $criteria->add(RoutePeer::ROU_NEXT_TASK, $this->rou_next_task);
- if ($this->isColumnModified(RoutePeer::ROU_CASE)) $criteria->add(RoutePeer::ROU_CASE, $this->rou_case);
- if ($this->isColumnModified(RoutePeer::ROU_TYPE)) $criteria->add(RoutePeer::ROU_TYPE, $this->rou_type);
- if ($this->isColumnModified(RoutePeer::ROU_CONDITION)) $criteria->add(RoutePeer::ROU_CONDITION, $this->rou_condition);
- if ($this->isColumnModified(RoutePeer::ROU_TO_LAST_USER)) $criteria->add(RoutePeer::ROU_TO_LAST_USER, $this->rou_to_last_user);
- if ($this->isColumnModified(RoutePeer::ROU_OPTIONAL)) $criteria->add(RoutePeer::ROU_OPTIONAL, $this->rou_optional);
- if ($this->isColumnModified(RoutePeer::ROU_SEND_EMAIL)) $criteria->add(RoutePeer::ROU_SEND_EMAIL, $this->rou_send_email);
- if ($this->isColumnModified(RoutePeer::ROU_SOURCEANCHOR)) $criteria->add(RoutePeer::ROU_SOURCEANCHOR, $this->rou_sourceanchor);
- if ($this->isColumnModified(RoutePeer::ROU_TARGETANCHOR)) $criteria->add(RoutePeer::ROU_TARGETANCHOR, $this->rou_targetanchor);
- if ($this->isColumnModified(RoutePeer::ROU_TO_PORT)) $criteria->add(RoutePeer::ROU_TO_PORT, $this->rou_to_port);
- if ($this->isColumnModified(RoutePeer::ROU_FROM_PORT)) $criteria->add(RoutePeer::ROU_FROM_PORT, $this->rou_from_port);
- if ($this->isColumnModified(RoutePeer::ROU_EVN_UID)) $criteria->add(RoutePeer::ROU_EVN_UID, $this->rou_evn_uid);
- if ($this->isColumnModified(RoutePeer::GAT_UID)) $criteria->add(RoutePeer::GAT_UID, $this->gat_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(RoutePeer::DATABASE_NAME);
-
- $criteria->add(RoutePeer::ROU_UID, $this->rou_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getRouUid();
- }
-
- /**
- * Generic method to set the primary key (rou_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setRouUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Route (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setRouParent($this->rou_parent);
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setRouNextTask($this->rou_next_task);
-
- $copyObj->setRouCase($this->rou_case);
-
- $copyObj->setRouType($this->rou_type);
-
- $copyObj->setRouCondition($this->rou_condition);
-
- $copyObj->setRouToLastUser($this->rou_to_last_user);
-
- $copyObj->setRouOptional($this->rou_optional);
-
- $copyObj->setRouSendEmail($this->rou_send_email);
-
- $copyObj->setRouSourceanchor($this->rou_sourceanchor);
-
- $copyObj->setRouTargetanchor($this->rou_targetanchor);
-
- $copyObj->setRouToPort($this->rou_to_port);
-
- $copyObj->setRouFromPort($this->rou_from_port);
-
- $copyObj->setRouEvnUid($this->rou_evn_uid);
-
- $copyObj->setGatUid($this->gat_uid);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setRouUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Route Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return RoutePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new RoutePeer();
- }
- return self::$peer;
- }
-
-} // BaseRoute
diff --git a/workflow/engine/classes/model/om/BaseRoutePeer.php b/workflow/engine/classes/model/om/BaseRoutePeer.php
index 0c5d13317..b7a6d6bd8 100755
--- a/workflow/engine/classes/model/om/BaseRoutePeer.php
+++ b/workflow/engine/classes/model/om/BaseRoutePeer.php
@@ -12,658 +12,660 @@ include_once 'classes/model/Route.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseRoutePeer {
+abstract class BaseRoutePeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'ROUTE';
+ /** the table name for this class */
+ const TABLE_NAME = 'ROUTE';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Route';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Route';
- /** The total number of columns. */
- const NUM_COLUMNS = 17;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 17;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the ROU_UID field */
+ const ROU_UID = 'ROUTE.ROU_UID';
+
+ /** the column name for the ROU_PARENT field */
+ const ROU_PARENT = 'ROUTE.ROU_PARENT';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'ROUTE.PRO_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'ROUTE.TAS_UID';
+
+ /** the column name for the ROU_NEXT_TASK field */
+ const ROU_NEXT_TASK = 'ROUTE.ROU_NEXT_TASK';
+
+ /** the column name for the ROU_CASE field */
+ const ROU_CASE = 'ROUTE.ROU_CASE';
+
+ /** the column name for the ROU_TYPE field */
+ const ROU_TYPE = 'ROUTE.ROU_TYPE';
+
+ /** the column name for the ROU_CONDITION field */
+ const ROU_CONDITION = 'ROUTE.ROU_CONDITION';
+
+ /** the column name for the ROU_TO_LAST_USER field */
+ const ROU_TO_LAST_USER = 'ROUTE.ROU_TO_LAST_USER';
+
+ /** the column name for the ROU_OPTIONAL field */
+ const ROU_OPTIONAL = 'ROUTE.ROU_OPTIONAL';
+
+ /** the column name for the ROU_SEND_EMAIL field */
+ const ROU_SEND_EMAIL = 'ROUTE.ROU_SEND_EMAIL';
+
+ /** the column name for the ROU_SOURCEANCHOR field */
+ const ROU_SOURCEANCHOR = 'ROUTE.ROU_SOURCEANCHOR';
+
+ /** the column name for the ROU_TARGETANCHOR field */
+ const ROU_TARGETANCHOR = 'ROUTE.ROU_TARGETANCHOR';
+
+ /** the column name for the ROU_TO_PORT field */
+ const ROU_TO_PORT = 'ROUTE.ROU_TO_PORT';
+
+ /** the column name for the ROU_FROM_PORT field */
+ const ROU_FROM_PORT = 'ROUTE.ROU_FROM_PORT';
+
+ /** the column name for the ROU_EVN_UID field */
+ const ROU_EVN_UID = 'ROUTE.ROU_EVN_UID';
+
+ /** the column name for the GAT_UID field */
+ const GAT_UID = 'ROUTE.GAT_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('RouUid', 'RouParent', 'ProUid', 'TasUid', 'RouNextTask', 'RouCase', 'RouType', 'RouCondition', 'RouToLastUser', 'RouOptional', 'RouSendEmail', 'RouSourceanchor', 'RouTargetanchor', 'RouToPort', 'RouFromPort', 'RouEvnUid', 'GatUid', ),
+ BasePeer::TYPE_COLNAME => array (RoutePeer::ROU_UID, RoutePeer::ROU_PARENT, RoutePeer::PRO_UID, RoutePeer::TAS_UID, RoutePeer::ROU_NEXT_TASK, RoutePeer::ROU_CASE, RoutePeer::ROU_TYPE, RoutePeer::ROU_CONDITION, RoutePeer::ROU_TO_LAST_USER, RoutePeer::ROU_OPTIONAL, RoutePeer::ROU_SEND_EMAIL, RoutePeer::ROU_SOURCEANCHOR, RoutePeer::ROU_TARGETANCHOR, RoutePeer::ROU_TO_PORT, RoutePeer::ROU_FROM_PORT, RoutePeer::ROU_EVN_UID, RoutePeer::GAT_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('ROU_UID', 'ROU_PARENT', 'PRO_UID', 'TAS_UID', 'ROU_NEXT_TASK', 'ROU_CASE', 'ROU_TYPE', 'ROU_CONDITION', 'ROU_TO_LAST_USER', 'ROU_OPTIONAL', 'ROU_SEND_EMAIL', 'ROU_SOURCEANCHOR', 'ROU_TARGETANCHOR', 'ROU_TO_PORT', 'ROU_FROM_PORT', 'ROU_EVN_UID', 'GAT_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('RouUid' => 0, 'RouParent' => 1, 'ProUid' => 2, 'TasUid' => 3, 'RouNextTask' => 4, 'RouCase' => 5, 'RouType' => 6, 'RouCondition' => 7, 'RouToLastUser' => 8, 'RouOptional' => 9, 'RouSendEmail' => 10, 'RouSourceanchor' => 11, 'RouTargetanchor' => 12, 'RouToPort' => 13, 'RouFromPort' => 14, 'RouEvnUid' => 15, 'GatUid' => 16, ),
+ BasePeer::TYPE_COLNAME => array (RoutePeer::ROU_UID => 0, RoutePeer::ROU_PARENT => 1, RoutePeer::PRO_UID => 2, RoutePeer::TAS_UID => 3, RoutePeer::ROU_NEXT_TASK => 4, RoutePeer::ROU_CASE => 5, RoutePeer::ROU_TYPE => 6, RoutePeer::ROU_CONDITION => 7, RoutePeer::ROU_TO_LAST_USER => 8, RoutePeer::ROU_OPTIONAL => 9, RoutePeer::ROU_SEND_EMAIL => 10, RoutePeer::ROU_SOURCEANCHOR => 11, RoutePeer::ROU_TARGETANCHOR => 12, RoutePeer::ROU_TO_PORT => 13, RoutePeer::ROU_FROM_PORT => 14, RoutePeer::ROU_EVN_UID => 15, RoutePeer::GAT_UID => 16, ),
+ BasePeer::TYPE_FIELDNAME => array ('ROU_UID' => 0, 'ROU_PARENT' => 1, 'PRO_UID' => 2, 'TAS_UID' => 3, 'ROU_NEXT_TASK' => 4, 'ROU_CASE' => 5, 'ROU_TYPE' => 6, 'ROU_CONDITION' => 7, 'ROU_TO_LAST_USER' => 8, 'ROU_OPTIONAL' => 9, 'ROU_SEND_EMAIL' => 10, 'ROU_SOURCEANCHOR' => 11, 'ROU_TARGETANCHOR' => 12, 'ROU_TO_PORT' => 13, 'ROU_FROM_PORT' => 14, 'ROU_EVN_UID' => 15, 'GAT_UID' => 16, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/RouteMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.RouteMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = RoutePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. RoutePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(RoutePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(RoutePeer::ROU_UID);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_PARENT);
+
+ $criteria->addSelectColumn(RoutePeer::PRO_UID);
+
+ $criteria->addSelectColumn(RoutePeer::TAS_UID);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_NEXT_TASK);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_CASE);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_TYPE);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_CONDITION);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_TO_LAST_USER);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_OPTIONAL);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_SEND_EMAIL);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_SOURCEANCHOR);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_TARGETANCHOR);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_TO_PORT);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_FROM_PORT);
+
+ $criteria->addSelectColumn(RoutePeer::ROU_EVN_UID);
+
+ $criteria->addSelectColumn(RoutePeer::GAT_UID);
+
+ }
+
+ const COUNT = 'COUNT(ROUTE.ROU_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT ROUTE.ROU_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(RoutePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(RoutePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = RoutePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Route
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = RoutePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return RoutePeer::populateObjects(RoutePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ RoutePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = RoutePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return RoutePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Route or Criteria object.
+ *
+ * @param mixed $values Criteria or Route object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Route object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Route or Criteria object.
+ *
+ * @param mixed $values Criteria or Route object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(RoutePeer::ROU_UID);
+ $selectCriteria->add(RoutePeer::ROU_UID, $criteria->remove(RoutePeer::ROU_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the ROUTE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(RoutePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Route or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Route object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(RoutePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Route) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(RoutePeer::ROU_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Route object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Route $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Route $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(RoutePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(RoutePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_UID))
+ $columns[RoutePeer::ROU_UID] = $obj->getRouUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::PRO_UID))
+ $columns[RoutePeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::TAS_UID))
+ $columns[RoutePeer::TAS_UID] = $obj->getTasUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_NEXT_TASK))
+ $columns[RoutePeer::ROU_NEXT_TASK] = $obj->getRouNextTask();
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_TYPE))
+ $columns[RoutePeer::ROU_TYPE] = $obj->getRouType();
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_TO_LAST_USER))
+ $columns[RoutePeer::ROU_TO_LAST_USER] = $obj->getRouToLastUser();
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_OPTIONAL))
+ $columns[RoutePeer::ROU_OPTIONAL] = $obj->getRouOptional();
+
+ if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_SEND_EMAIL))
+ $columns[RoutePeer::ROU_SEND_EMAIL] = $obj->getRouSendEmail();
+
+ }
+
+ return BasePeer::doValidate(RoutePeer::DATABASE_NAME, RoutePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Route
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(RoutePeer::DATABASE_NAME);
+
+ $criteria->add(RoutePeer::ROU_UID, $pk);
+
+
+ $v = RoutePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(RoutePeer::ROU_UID, $pks, Criteria::IN);
+ $objs = RoutePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the ROU_UID field */
- const ROU_UID = 'ROUTE.ROU_UID';
-
- /** the column name for the ROU_PARENT field */
- const ROU_PARENT = 'ROUTE.ROU_PARENT';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'ROUTE.PRO_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'ROUTE.TAS_UID';
-
- /** the column name for the ROU_NEXT_TASK field */
- const ROU_NEXT_TASK = 'ROUTE.ROU_NEXT_TASK';
-
- /** the column name for the ROU_CASE field */
- const ROU_CASE = 'ROUTE.ROU_CASE';
-
- /** the column name for the ROU_TYPE field */
- const ROU_TYPE = 'ROUTE.ROU_TYPE';
-
- /** the column name for the ROU_CONDITION field */
- const ROU_CONDITION = 'ROUTE.ROU_CONDITION';
-
- /** the column name for the ROU_TO_LAST_USER field */
- const ROU_TO_LAST_USER = 'ROUTE.ROU_TO_LAST_USER';
-
- /** the column name for the ROU_OPTIONAL field */
- const ROU_OPTIONAL = 'ROUTE.ROU_OPTIONAL';
-
- /** the column name for the ROU_SEND_EMAIL field */
- const ROU_SEND_EMAIL = 'ROUTE.ROU_SEND_EMAIL';
-
- /** the column name for the ROU_SOURCEANCHOR field */
- const ROU_SOURCEANCHOR = 'ROUTE.ROU_SOURCEANCHOR';
-
- /** the column name for the ROU_TARGETANCHOR field */
- const ROU_TARGETANCHOR = 'ROUTE.ROU_TARGETANCHOR';
-
- /** the column name for the ROU_TO_PORT field */
- const ROU_TO_PORT = 'ROUTE.ROU_TO_PORT';
-
- /** the column name for the ROU_FROM_PORT field */
- const ROU_FROM_PORT = 'ROUTE.ROU_FROM_PORT';
-
- /** the column name for the ROU_EVN_UID field */
- const ROU_EVN_UID = 'ROUTE.ROU_EVN_UID';
-
- /** the column name for the GAT_UID field */
- const GAT_UID = 'ROUTE.GAT_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('RouUid', 'RouParent', 'ProUid', 'TasUid', 'RouNextTask', 'RouCase', 'RouType', 'RouCondition', 'RouToLastUser', 'RouOptional', 'RouSendEmail', 'RouSourceanchor', 'RouTargetanchor', 'RouToPort', 'RouFromPort', 'RouEvnUid', 'GatUid', ),
- BasePeer::TYPE_COLNAME => array (RoutePeer::ROU_UID, RoutePeer::ROU_PARENT, RoutePeer::PRO_UID, RoutePeer::TAS_UID, RoutePeer::ROU_NEXT_TASK, RoutePeer::ROU_CASE, RoutePeer::ROU_TYPE, RoutePeer::ROU_CONDITION, RoutePeer::ROU_TO_LAST_USER, RoutePeer::ROU_OPTIONAL, RoutePeer::ROU_SEND_EMAIL, RoutePeer::ROU_SOURCEANCHOR, RoutePeer::ROU_TARGETANCHOR, RoutePeer::ROU_TO_PORT, RoutePeer::ROU_FROM_PORT, RoutePeer::ROU_EVN_UID, RoutePeer::GAT_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('ROU_UID', 'ROU_PARENT', 'PRO_UID', 'TAS_UID', 'ROU_NEXT_TASK', 'ROU_CASE', 'ROU_TYPE', 'ROU_CONDITION', 'ROU_TO_LAST_USER', 'ROU_OPTIONAL', 'ROU_SEND_EMAIL', 'ROU_SOURCEANCHOR', 'ROU_TARGETANCHOR', 'ROU_TO_PORT', 'ROU_FROM_PORT', 'ROU_EVN_UID', 'GAT_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('RouUid' => 0, 'RouParent' => 1, 'ProUid' => 2, 'TasUid' => 3, 'RouNextTask' => 4, 'RouCase' => 5, 'RouType' => 6, 'RouCondition' => 7, 'RouToLastUser' => 8, 'RouOptional' => 9, 'RouSendEmail' => 10, 'RouSourceanchor' => 11, 'RouTargetanchor' => 12, 'RouToPort' => 13, 'RouFromPort' => 14, 'RouEvnUid' => 15, 'GatUid' => 16, ),
- BasePeer::TYPE_COLNAME => array (RoutePeer::ROU_UID => 0, RoutePeer::ROU_PARENT => 1, RoutePeer::PRO_UID => 2, RoutePeer::TAS_UID => 3, RoutePeer::ROU_NEXT_TASK => 4, RoutePeer::ROU_CASE => 5, RoutePeer::ROU_TYPE => 6, RoutePeer::ROU_CONDITION => 7, RoutePeer::ROU_TO_LAST_USER => 8, RoutePeer::ROU_OPTIONAL => 9, RoutePeer::ROU_SEND_EMAIL => 10, RoutePeer::ROU_SOURCEANCHOR => 11, RoutePeer::ROU_TARGETANCHOR => 12, RoutePeer::ROU_TO_PORT => 13, RoutePeer::ROU_FROM_PORT => 14, RoutePeer::ROU_EVN_UID => 15, RoutePeer::GAT_UID => 16, ),
- BasePeer::TYPE_FIELDNAME => array ('ROU_UID' => 0, 'ROU_PARENT' => 1, 'PRO_UID' => 2, 'TAS_UID' => 3, 'ROU_NEXT_TASK' => 4, 'ROU_CASE' => 5, 'ROU_TYPE' => 6, 'ROU_CONDITION' => 7, 'ROU_TO_LAST_USER' => 8, 'ROU_OPTIONAL' => 9, 'ROU_SEND_EMAIL' => 10, 'ROU_SOURCEANCHOR' => 11, 'ROU_TARGETANCHOR' => 12, 'ROU_TO_PORT' => 13, 'ROU_FROM_PORT' => 14, 'ROU_EVN_UID' => 15, 'GAT_UID' => 16, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/RouteMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.RouteMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = RoutePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. RoutePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(RoutePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(RoutePeer::ROU_UID);
-
- $criteria->addSelectColumn(RoutePeer::ROU_PARENT);
-
- $criteria->addSelectColumn(RoutePeer::PRO_UID);
-
- $criteria->addSelectColumn(RoutePeer::TAS_UID);
-
- $criteria->addSelectColumn(RoutePeer::ROU_NEXT_TASK);
-
- $criteria->addSelectColumn(RoutePeer::ROU_CASE);
-
- $criteria->addSelectColumn(RoutePeer::ROU_TYPE);
-
- $criteria->addSelectColumn(RoutePeer::ROU_CONDITION);
-
- $criteria->addSelectColumn(RoutePeer::ROU_TO_LAST_USER);
-
- $criteria->addSelectColumn(RoutePeer::ROU_OPTIONAL);
-
- $criteria->addSelectColumn(RoutePeer::ROU_SEND_EMAIL);
-
- $criteria->addSelectColumn(RoutePeer::ROU_SOURCEANCHOR);
-
- $criteria->addSelectColumn(RoutePeer::ROU_TARGETANCHOR);
-
- $criteria->addSelectColumn(RoutePeer::ROU_TO_PORT);
-
- $criteria->addSelectColumn(RoutePeer::ROU_FROM_PORT);
-
- $criteria->addSelectColumn(RoutePeer::ROU_EVN_UID);
-
- $criteria->addSelectColumn(RoutePeer::GAT_UID);
-
- }
-
- const COUNT = 'COUNT(ROUTE.ROU_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT ROUTE.ROU_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(RoutePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(RoutePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = RoutePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Route
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = RoutePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return RoutePeer::populateObjects(RoutePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- RoutePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = RoutePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return RoutePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Route or Criteria object.
- *
- * @param mixed $values Criteria or Route object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Route object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Route or Criteria object.
- *
- * @param mixed $values Criteria or Route object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(RoutePeer::ROU_UID);
- $selectCriteria->add(RoutePeer::ROU_UID, $criteria->remove(RoutePeer::ROU_UID), $comparison);
-
- } else { // $values is Route object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the ROUTE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(RoutePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Route or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Route object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(RoutePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Route) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(RoutePeer::ROU_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Route object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Route $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Route $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(RoutePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(RoutePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_UID))
- $columns[RoutePeer::ROU_UID] = $obj->getRouUid();
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::PRO_UID))
- $columns[RoutePeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::TAS_UID))
- $columns[RoutePeer::TAS_UID] = $obj->getTasUid();
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_NEXT_TASK))
- $columns[RoutePeer::ROU_NEXT_TASK] = $obj->getRouNextTask();
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_TYPE))
- $columns[RoutePeer::ROU_TYPE] = $obj->getRouType();
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_TO_LAST_USER))
- $columns[RoutePeer::ROU_TO_LAST_USER] = $obj->getRouToLastUser();
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_OPTIONAL))
- $columns[RoutePeer::ROU_OPTIONAL] = $obj->getRouOptional();
-
- if ($obj->isNew() || $obj->isColumnModified(RoutePeer::ROU_SEND_EMAIL))
- $columns[RoutePeer::ROU_SEND_EMAIL] = $obj->getRouSendEmail();
-
- }
-
- return BasePeer::doValidate(RoutePeer::DATABASE_NAME, RoutePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Route
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(RoutePeer::DATABASE_NAME);
-
- $criteria->add(RoutePeer::ROU_UID, $pk);
-
-
- $v = RoutePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(RoutePeer::ROU_UID, $pks, Criteria::IN);
- $objs = RoutePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseRoutePeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseRoutePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseRoutePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/RouteMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.RouteMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/RouteMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.RouteMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseSession.php b/workflow/engine/classes/model/om/BaseSession.php
index 7105aaa3d..4fc113e4c 100755
--- a/workflow/engine/classes/model/om/BaseSession.php
+++ b/workflow/engine/classes/model/om/BaseSession.php
@@ -16,807 +16,843 @@ include_once 'classes/model/SessionPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSession extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var SessionPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the ses_uid field.
- * @var string
- */
- protected $ses_uid = '';
-
-
- /**
- * The value for the ses_status field.
- * @var string
- */
- protected $ses_status = 'ACTIVE';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = 'ACTIVE';
-
-
- /**
- * The value for the ses_remote_ip field.
- * @var string
- */
- protected $ses_remote_ip = '0.0.0.0';
-
-
- /**
- * The value for the ses_init_date field.
- * @var string
- */
- protected $ses_init_date = '';
-
-
- /**
- * The value for the ses_due_date field.
- * @var string
- */
- protected $ses_due_date = '';
-
-
- /**
- * The value for the ses_end_date field.
- * @var string
- */
- protected $ses_end_date = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [ses_uid] column value.
- *
- * @return string
- */
- public function getSesUid()
- {
-
- return $this->ses_uid;
- }
-
- /**
- * Get the [ses_status] column value.
- *
- * @return string
- */
- public function getSesStatus()
- {
-
- return $this->ses_status;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [ses_remote_ip] column value.
- *
- * @return string
- */
- public function getSesRemoteIp()
- {
-
- return $this->ses_remote_ip;
- }
-
- /**
- * Get the [ses_init_date] column value.
- *
- * @return string
- */
- public function getSesInitDate()
- {
-
- return $this->ses_init_date;
- }
-
- /**
- * Get the [ses_due_date] column value.
- *
- * @return string
- */
- public function getSesDueDate()
- {
-
- return $this->ses_due_date;
- }
-
- /**
- * Get the [ses_end_date] column value.
- *
- * @return string
- */
- public function getSesEndDate()
- {
-
- return $this->ses_end_date;
- }
-
- /**
- * Set the value of [ses_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSesUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ses_uid !== $v || $v === '') {
- $this->ses_uid = $v;
- $this->modifiedColumns[] = SessionPeer::SES_UID;
- }
-
- } // setSesUid()
-
- /**
- * Set the value of [ses_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSesStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ses_status !== $v || $v === 'ACTIVE') {
- $this->ses_status = $v;
- $this->modifiedColumns[] = SessionPeer::SES_STATUS;
- }
-
- } // setSesStatus()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === 'ACTIVE') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = SessionPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [ses_remote_ip] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSesRemoteIp($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ses_remote_ip !== $v || $v === '0.0.0.0') {
- $this->ses_remote_ip = $v;
- $this->modifiedColumns[] = SessionPeer::SES_REMOTE_IP;
- }
-
- } // setSesRemoteIp()
-
- /**
- * Set the value of [ses_init_date] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSesInitDate($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ses_init_date !== $v || $v === '') {
- $this->ses_init_date = $v;
- $this->modifiedColumns[] = SessionPeer::SES_INIT_DATE;
- }
-
- } // setSesInitDate()
-
- /**
- * Set the value of [ses_due_date] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSesDueDate($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ses_due_date !== $v || $v === '') {
- $this->ses_due_date = $v;
- $this->modifiedColumns[] = SessionPeer::SES_DUE_DATE;
- }
-
- } // setSesDueDate()
-
- /**
- * Set the value of [ses_end_date] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSesEndDate($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->ses_end_date !== $v || $v === '') {
- $this->ses_end_date = $v;
- $this->modifiedColumns[] = SessionPeer::SES_END_DATE;
- }
-
- } // setSesEndDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->ses_uid = $rs->getString($startcol + 0);
-
- $this->ses_status = $rs->getString($startcol + 1);
-
- $this->usr_uid = $rs->getString($startcol + 2);
-
- $this->ses_remote_ip = $rs->getString($startcol + 3);
-
- $this->ses_init_date = $rs->getString($startcol + 4);
-
- $this->ses_due_date = $rs->getString($startcol + 5);
-
- $this->ses_end_date = $rs->getString($startcol + 6);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 7; // 7 = SessionPeer::NUM_COLUMNS - SessionPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Session object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SessionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- SessionPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SessionPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = SessionPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += SessionPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = SessionPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SessionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getSesUid();
- break;
- case 1:
- return $this->getSesStatus();
- break;
- case 2:
- return $this->getUsrUid();
- break;
- case 3:
- return $this->getSesRemoteIp();
- break;
- case 4:
- return $this->getSesInitDate();
- break;
- case 5:
- return $this->getSesDueDate();
- break;
- case 6:
- return $this->getSesEndDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SessionPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getSesUid(),
- $keys[1] => $this->getSesStatus(),
- $keys[2] => $this->getUsrUid(),
- $keys[3] => $this->getSesRemoteIp(),
- $keys[4] => $this->getSesInitDate(),
- $keys[5] => $this->getSesDueDate(),
- $keys[6] => $this->getSesEndDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SessionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setSesUid($value);
- break;
- case 1:
- $this->setSesStatus($value);
- break;
- case 2:
- $this->setUsrUid($value);
- break;
- case 3:
- $this->setSesRemoteIp($value);
- break;
- case 4:
- $this->setSesInitDate($value);
- break;
- case 5:
- $this->setSesDueDate($value);
- break;
- case 6:
- $this->setSesEndDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SessionPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setSesUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setSesStatus($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setUsrUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setSesRemoteIp($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setSesInitDate($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setSesDueDate($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setSesEndDate($arr[$keys[6]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(SessionPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(SessionPeer::SES_UID)) $criteria->add(SessionPeer::SES_UID, $this->ses_uid);
- if ($this->isColumnModified(SessionPeer::SES_STATUS)) $criteria->add(SessionPeer::SES_STATUS, $this->ses_status);
- if ($this->isColumnModified(SessionPeer::USR_UID)) $criteria->add(SessionPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(SessionPeer::SES_REMOTE_IP)) $criteria->add(SessionPeer::SES_REMOTE_IP, $this->ses_remote_ip);
- if ($this->isColumnModified(SessionPeer::SES_INIT_DATE)) $criteria->add(SessionPeer::SES_INIT_DATE, $this->ses_init_date);
- if ($this->isColumnModified(SessionPeer::SES_DUE_DATE)) $criteria->add(SessionPeer::SES_DUE_DATE, $this->ses_due_date);
- if ($this->isColumnModified(SessionPeer::SES_END_DATE)) $criteria->add(SessionPeer::SES_END_DATE, $this->ses_end_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(SessionPeer::DATABASE_NAME);
-
- $criteria->add(SessionPeer::SES_UID, $this->ses_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getSesUid();
- }
-
- /**
- * Generic method to set the primary key (ses_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setSesUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Session (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setSesStatus($this->ses_status);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setSesRemoteIp($this->ses_remote_ip);
-
- $copyObj->setSesInitDate($this->ses_init_date);
-
- $copyObj->setSesDueDate($this->ses_due_date);
-
- $copyObj->setSesEndDate($this->ses_end_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setSesUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Session Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return SessionPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new SessionPeer();
- }
- return self::$peer;
- }
-
-} // BaseSession
+abstract class BaseSession extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var SessionPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the ses_uid field.
+ * @var string
+ */
+ protected $ses_uid = '';
+
+ /**
+ * The value for the ses_status field.
+ * @var string
+ */
+ protected $ses_status = 'ACTIVE';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = 'ACTIVE';
+
+ /**
+ * The value for the ses_remote_ip field.
+ * @var string
+ */
+ protected $ses_remote_ip = '0.0.0.0';
+
+ /**
+ * The value for the ses_init_date field.
+ * @var string
+ */
+ protected $ses_init_date = '';
+
+ /**
+ * The value for the ses_due_date field.
+ * @var string
+ */
+ protected $ses_due_date = '';
+
+ /**
+ * The value for the ses_end_date field.
+ * @var string
+ */
+ protected $ses_end_date = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [ses_uid] column value.
+ *
+ * @return string
+ */
+ public function getSesUid()
+ {
+
+ return $this->ses_uid;
+ }
+
+ /**
+ * Get the [ses_status] column value.
+ *
+ * @return string
+ */
+ public function getSesStatus()
+ {
+
+ return $this->ses_status;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [ses_remote_ip] column value.
+ *
+ * @return string
+ */
+ public function getSesRemoteIp()
+ {
+
+ return $this->ses_remote_ip;
+ }
+
+ /**
+ * Get the [ses_init_date] column value.
+ *
+ * @return string
+ */
+ public function getSesInitDate()
+ {
+
+ return $this->ses_init_date;
+ }
+
+ /**
+ * Get the [ses_due_date] column value.
+ *
+ * @return string
+ */
+ public function getSesDueDate()
+ {
+
+ return $this->ses_due_date;
+ }
+
+ /**
+ * Get the [ses_end_date] column value.
+ *
+ * @return string
+ */
+ public function getSesEndDate()
+ {
+
+ return $this->ses_end_date;
+ }
+
+ /**
+ * Set the value of [ses_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSesUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ses_uid !== $v || $v === '') {
+ $this->ses_uid = $v;
+ $this->modifiedColumns[] = SessionPeer::SES_UID;
+ }
+
+ } // setSesUid()
+
+ /**
+ * Set the value of [ses_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSesStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ses_status !== $v || $v === 'ACTIVE') {
+ $this->ses_status = $v;
+ $this->modifiedColumns[] = SessionPeer::SES_STATUS;
+ }
+
+ } // setSesStatus()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === 'ACTIVE') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = SessionPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [ses_remote_ip] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSesRemoteIp($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ses_remote_ip !== $v || $v === '0.0.0.0') {
+ $this->ses_remote_ip = $v;
+ $this->modifiedColumns[] = SessionPeer::SES_REMOTE_IP;
+ }
+
+ } // setSesRemoteIp()
+
+ /**
+ * Set the value of [ses_init_date] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSesInitDate($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ses_init_date !== $v || $v === '') {
+ $this->ses_init_date = $v;
+ $this->modifiedColumns[] = SessionPeer::SES_INIT_DATE;
+ }
+
+ } // setSesInitDate()
+
+ /**
+ * Set the value of [ses_due_date] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSesDueDate($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ses_due_date !== $v || $v === '') {
+ $this->ses_due_date = $v;
+ $this->modifiedColumns[] = SessionPeer::SES_DUE_DATE;
+ }
+
+ } // setSesDueDate()
+
+ /**
+ * Set the value of [ses_end_date] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSesEndDate($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->ses_end_date !== $v || $v === '') {
+ $this->ses_end_date = $v;
+ $this->modifiedColumns[] = SessionPeer::SES_END_DATE;
+ }
+
+ } // setSesEndDate()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->ses_uid = $rs->getString($startcol + 0);
+
+ $this->ses_status = $rs->getString($startcol + 1);
+
+ $this->usr_uid = $rs->getString($startcol + 2);
+
+ $this->ses_remote_ip = $rs->getString($startcol + 3);
+
+ $this->ses_init_date = $rs->getString($startcol + 4);
+
+ $this->ses_due_date = $rs->getString($startcol + 5);
+
+ $this->ses_end_date = $rs->getString($startcol + 6);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 7; // 7 = SessionPeer::NUM_COLUMNS - SessionPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Session object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SessionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ SessionPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SessionPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = SessionPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += SessionPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = SessionPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SessionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getSesUid();
+ break;
+ case 1:
+ return $this->getSesStatus();
+ break;
+ case 2:
+ return $this->getUsrUid();
+ break;
+ case 3:
+ return $this->getSesRemoteIp();
+ break;
+ case 4:
+ return $this->getSesInitDate();
+ break;
+ case 5:
+ return $this->getSesDueDate();
+ break;
+ case 6:
+ return $this->getSesEndDate();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SessionPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getSesUid(),
+ $keys[1] => $this->getSesStatus(),
+ $keys[2] => $this->getUsrUid(),
+ $keys[3] => $this->getSesRemoteIp(),
+ $keys[4] => $this->getSesInitDate(),
+ $keys[5] => $this->getSesDueDate(),
+ $keys[6] => $this->getSesEndDate(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SessionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setSesUid($value);
+ break;
+ case 1:
+ $this->setSesStatus($value);
+ break;
+ case 2:
+ $this->setUsrUid($value);
+ break;
+ case 3:
+ $this->setSesRemoteIp($value);
+ break;
+ case 4:
+ $this->setSesInitDate($value);
+ break;
+ case 5:
+ $this->setSesDueDate($value);
+ break;
+ case 6:
+ $this->setSesEndDate($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SessionPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setSesUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setSesStatus($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setUsrUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setSesRemoteIp($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setSesInitDate($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setSesDueDate($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setSesEndDate($arr[$keys[6]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SessionPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(SessionPeer::SES_UID)) {
+ $criteria->add(SessionPeer::SES_UID, $this->ses_uid);
+ }
+
+ if ($this->isColumnModified(SessionPeer::SES_STATUS)) {
+ $criteria->add(SessionPeer::SES_STATUS, $this->ses_status);
+ }
+
+ if ($this->isColumnModified(SessionPeer::USR_UID)) {
+ $criteria->add(SessionPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(SessionPeer::SES_REMOTE_IP)) {
+ $criteria->add(SessionPeer::SES_REMOTE_IP, $this->ses_remote_ip);
+ }
+
+ if ($this->isColumnModified(SessionPeer::SES_INIT_DATE)) {
+ $criteria->add(SessionPeer::SES_INIT_DATE, $this->ses_init_date);
+ }
+
+ if ($this->isColumnModified(SessionPeer::SES_DUE_DATE)) {
+ $criteria->add(SessionPeer::SES_DUE_DATE, $this->ses_due_date);
+ }
+
+ if ($this->isColumnModified(SessionPeer::SES_END_DATE)) {
+ $criteria->add(SessionPeer::SES_END_DATE, $this->ses_end_date);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SessionPeer::DATABASE_NAME);
+
+ $criteria->add(SessionPeer::SES_UID, $this->ses_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getSesUid();
+ }
+
+ /**
+ * Generic method to set the primary key (ses_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setSesUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Session (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setSesStatus($this->ses_status);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+ $copyObj->setSesRemoteIp($this->ses_remote_ip);
+
+ $copyObj->setSesInitDate($this->ses_init_date);
+
+ $copyObj->setSesDueDate($this->ses_due_date);
+
+ $copyObj->setSesEndDate($this->ses_end_date);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setSesUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Session Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return SessionPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new SessionPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseSessionPeer.php b/workflow/engine/classes/model/om/BaseSessionPeer.php
index 6ebe0b876..62909004e 100755
--- a/workflow/engine/classes/model/om/BaseSessionPeer.php
+++ b/workflow/engine/classes/model/om/BaseSessionPeer.php
@@ -12,584 +12,586 @@ include_once 'classes/model/Session.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSessionPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'SESSION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Session';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 7;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the SES_UID field */
- const SES_UID = 'SESSION.SES_UID';
-
- /** the column name for the SES_STATUS field */
- const SES_STATUS = 'SESSION.SES_STATUS';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'SESSION.USR_UID';
-
- /** the column name for the SES_REMOTE_IP field */
- const SES_REMOTE_IP = 'SESSION.SES_REMOTE_IP';
-
- /** the column name for the SES_INIT_DATE field */
- const SES_INIT_DATE = 'SESSION.SES_INIT_DATE';
-
- /** the column name for the SES_DUE_DATE field */
- const SES_DUE_DATE = 'SESSION.SES_DUE_DATE';
-
- /** the column name for the SES_END_DATE field */
- const SES_END_DATE = 'SESSION.SES_END_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('SesUid', 'SesStatus', 'UsrUid', 'SesRemoteIp', 'SesInitDate', 'SesDueDate', 'SesEndDate', ),
- BasePeer::TYPE_COLNAME => array (SessionPeer::SES_UID, SessionPeer::SES_STATUS, SessionPeer::USR_UID, SessionPeer::SES_REMOTE_IP, SessionPeer::SES_INIT_DATE, SessionPeer::SES_DUE_DATE, SessionPeer::SES_END_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('SES_UID', 'SES_STATUS', 'USR_UID', 'SES_REMOTE_IP', 'SES_INIT_DATE', 'SES_DUE_DATE', 'SES_END_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('SesUid' => 0, 'SesStatus' => 1, 'UsrUid' => 2, 'SesRemoteIp' => 3, 'SesInitDate' => 4, 'SesDueDate' => 5, 'SesEndDate' => 6, ),
- BasePeer::TYPE_COLNAME => array (SessionPeer::SES_UID => 0, SessionPeer::SES_STATUS => 1, SessionPeer::USR_UID => 2, SessionPeer::SES_REMOTE_IP => 3, SessionPeer::SES_INIT_DATE => 4, SessionPeer::SES_DUE_DATE => 5, SessionPeer::SES_END_DATE => 6, ),
- BasePeer::TYPE_FIELDNAME => array ('SES_UID' => 0, 'SES_STATUS' => 1, 'USR_UID' => 2, 'SES_REMOTE_IP' => 3, 'SES_INIT_DATE' => 4, 'SES_DUE_DATE' => 5, 'SES_END_DATE' => 6, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/SessionMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.SessionMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = SessionPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. SessionPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(SessionPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(SessionPeer::SES_UID);
-
- $criteria->addSelectColumn(SessionPeer::SES_STATUS);
-
- $criteria->addSelectColumn(SessionPeer::USR_UID);
-
- $criteria->addSelectColumn(SessionPeer::SES_REMOTE_IP);
-
- $criteria->addSelectColumn(SessionPeer::SES_INIT_DATE);
-
- $criteria->addSelectColumn(SessionPeer::SES_DUE_DATE);
-
- $criteria->addSelectColumn(SessionPeer::SES_END_DATE);
-
- }
-
- const COUNT = 'COUNT(SESSION.SES_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT SESSION.SES_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(SessionPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(SessionPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = SessionPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Session
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = SessionPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return SessionPeer::populateObjects(SessionPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- SessionPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = SessionPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return SessionPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Session or Criteria object.
- *
- * @param mixed $values Criteria or Session object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Session object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Session or Criteria object.
- *
- * @param mixed $values Criteria or Session object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(SessionPeer::SES_UID);
- $selectCriteria->add(SessionPeer::SES_UID, $criteria->remove(SessionPeer::SES_UID), $comparison);
-
- } else { // $values is Session object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the SESSION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(SessionPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Session or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Session object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(SessionPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Session) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(SessionPeer::SES_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Session object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Session $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Session $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(SessionPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(SessionPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(SessionPeer::DATABASE_NAME, SessionPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Session
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(SessionPeer::DATABASE_NAME);
-
- $criteria->add(SessionPeer::SES_UID, $pk);
-
-
- $v = SessionPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(SessionPeer::SES_UID, $pks, Criteria::IN);
- $objs = SessionPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseSessionPeer
+abstract class BaseSessionPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'SESSION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Session';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 7;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the SES_UID field */
+ const SES_UID = 'SESSION.SES_UID';
+
+ /** the column name for the SES_STATUS field */
+ const SES_STATUS = 'SESSION.SES_STATUS';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'SESSION.USR_UID';
+
+ /** the column name for the SES_REMOTE_IP field */
+ const SES_REMOTE_IP = 'SESSION.SES_REMOTE_IP';
+
+ /** the column name for the SES_INIT_DATE field */
+ const SES_INIT_DATE = 'SESSION.SES_INIT_DATE';
+
+ /** the column name for the SES_DUE_DATE field */
+ const SES_DUE_DATE = 'SESSION.SES_DUE_DATE';
+
+ /** the column name for the SES_END_DATE field */
+ const SES_END_DATE = 'SESSION.SES_END_DATE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('SesUid', 'SesStatus', 'UsrUid', 'SesRemoteIp', 'SesInitDate', 'SesDueDate', 'SesEndDate', ),
+ BasePeer::TYPE_COLNAME => array (SessionPeer::SES_UID, SessionPeer::SES_STATUS, SessionPeer::USR_UID, SessionPeer::SES_REMOTE_IP, SessionPeer::SES_INIT_DATE, SessionPeer::SES_DUE_DATE, SessionPeer::SES_END_DATE, ),
+ BasePeer::TYPE_FIELDNAME => array ('SES_UID', 'SES_STATUS', 'USR_UID', 'SES_REMOTE_IP', 'SES_INIT_DATE', 'SES_DUE_DATE', 'SES_END_DATE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('SesUid' => 0, 'SesStatus' => 1, 'UsrUid' => 2, 'SesRemoteIp' => 3, 'SesInitDate' => 4, 'SesDueDate' => 5, 'SesEndDate' => 6, ),
+ BasePeer::TYPE_COLNAME => array (SessionPeer::SES_UID => 0, SessionPeer::SES_STATUS => 1, SessionPeer::USR_UID => 2, SessionPeer::SES_REMOTE_IP => 3, SessionPeer::SES_INIT_DATE => 4, SessionPeer::SES_DUE_DATE => 5, SessionPeer::SES_END_DATE => 6, ),
+ BasePeer::TYPE_FIELDNAME => array ('SES_UID' => 0, 'SES_STATUS' => 1, 'USR_UID' => 2, 'SES_REMOTE_IP' => 3, 'SES_INIT_DATE' => 4, 'SES_DUE_DATE' => 5, 'SES_END_DATE' => 6, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/SessionMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.SessionMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = SessionPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. SessionPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(SessionPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(SessionPeer::SES_UID);
+
+ $criteria->addSelectColumn(SessionPeer::SES_STATUS);
+
+ $criteria->addSelectColumn(SessionPeer::USR_UID);
+
+ $criteria->addSelectColumn(SessionPeer::SES_REMOTE_IP);
+
+ $criteria->addSelectColumn(SessionPeer::SES_INIT_DATE);
+
+ $criteria->addSelectColumn(SessionPeer::SES_DUE_DATE);
+
+ $criteria->addSelectColumn(SessionPeer::SES_END_DATE);
+
+ }
+
+ const COUNT = 'COUNT(SESSION.SES_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT SESSION.SES_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(SessionPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(SessionPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = SessionPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Session
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = SessionPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return SessionPeer::populateObjects(SessionPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ SessionPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = SessionPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return SessionPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Session or Criteria object.
+ *
+ * @param mixed $values Criteria or Session object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Session object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Session or Criteria object.
+ *
+ * @param mixed $values Criteria or Session object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(SessionPeer::SES_UID);
+ $selectCriteria->add(SessionPeer::SES_UID, $criteria->remove(SessionPeer::SES_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the SESSION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(SessionPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Session or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Session object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(SessionPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Session) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(SessionPeer::SES_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Session object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Session $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Session $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(SessionPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(SessionPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(SessionPeer::DATABASE_NAME, SessionPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Session
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(SessionPeer::DATABASE_NAME);
+
+ $criteria->add(SessionPeer::SES_UID, $pk);
+
+
+ $v = SessionPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(SessionPeer::SES_UID, $pks, Criteria::IN);
+ $objs = SessionPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseSessionPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseSessionPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/SessionMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.SessionMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/SessionMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.SessionMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseShadowTable.php b/workflow/engine/classes/model/om/BaseShadowTable.php
index 4e83bd1c7..a8dea3e6f 100755
--- a/workflow/engine/classes/model/om/BaseShadowTable.php
+++ b/workflow/engine/classes/model/om/BaseShadowTable.php
@@ -16,829 +16,867 @@ include_once 'classes/model/ShadowTablePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseShadowTable extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var ShadowTablePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the shd_uid field.
- * @var string
- */
- protected $shd_uid = '';
-
-
- /**
- * The value for the add_tab_uid field.
- * @var string
- */
- protected $add_tab_uid = '';
-
-
- /**
- * The value for the shd_action field.
- * @var string
- */
- protected $shd_action = '';
-
-
- /**
- * The value for the shd_details field.
- * @var string
- */
- protected $shd_details;
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
-
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the shd_date field.
- * @var int
- */
- protected $shd_date;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [shd_uid] column value.
- *
- * @return string
- */
- public function getShdUid()
- {
-
- return $this->shd_uid;
- }
-
- /**
- * Get the [add_tab_uid] column value.
- *
- * @return string
- */
- public function getAddTabUid()
- {
-
- return $this->add_tab_uid;
- }
-
- /**
- * Get the [shd_action] column value.
- *
- * @return string
- */
- public function getShdAction()
- {
-
- return $this->shd_action;
- }
-
- /**
- * Get the [shd_details] column value.
- *
- * @return string
- */
- public function getShdDetails()
- {
-
- return $this->shd_details;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [optionally formatted] [shd_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getShdDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->shd_date === null || $this->shd_date === '') {
- return null;
- } elseif (!is_int($this->shd_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->shd_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [shd_date] as date/time value: " . var_export($this->shd_date, true));
- }
- } else {
- $ts = $this->shd_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [shd_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setShdUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->shd_uid !== $v || $v === '') {
- $this->shd_uid = $v;
- $this->modifiedColumns[] = ShadowTablePeer::SHD_UID;
- }
-
- } // setShdUid()
-
- /**
- * Set the value of [add_tab_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAddTabUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->add_tab_uid !== $v || $v === '') {
- $this->add_tab_uid = $v;
- $this->modifiedColumns[] = ShadowTablePeer::ADD_TAB_UID;
- }
-
- } // setAddTabUid()
-
- /**
- * Set the value of [shd_action] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setShdAction($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->shd_action !== $v || $v === '') {
- $this->shd_action = $v;
- $this->modifiedColumns[] = ShadowTablePeer::SHD_ACTION;
- }
-
- } // setShdAction()
-
- /**
- * Set the value of [shd_details] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setShdDetails($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->shd_details !== $v) {
- $this->shd_details = $v;
- $this->modifiedColumns[] = ShadowTablePeer::SHD_DETAILS;
- }
-
- } // setShdDetails()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = ShadowTablePeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = ShadowTablePeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [shd_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setShdDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [shd_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->shd_date !== $ts) {
- $this->shd_date = $ts;
- $this->modifiedColumns[] = ShadowTablePeer::SHD_DATE;
- }
-
- } // setShdDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->shd_uid = $rs->getString($startcol + 0);
-
- $this->add_tab_uid = $rs->getString($startcol + 1);
-
- $this->shd_action = $rs->getString($startcol + 2);
-
- $this->shd_details = $rs->getString($startcol + 3);
-
- $this->usr_uid = $rs->getString($startcol + 4);
-
- $this->app_uid = $rs->getString($startcol + 5);
-
- $this->shd_date = $rs->getTimestamp($startcol + 6, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 7; // 7 = ShadowTablePeer::NUM_COLUMNS - ShadowTablePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating ShadowTable object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- ShadowTablePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = ShadowTablePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += ShadowTablePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = ShadowTablePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ShadowTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getShdUid();
- break;
- case 1:
- return $this->getAddTabUid();
- break;
- case 2:
- return $this->getShdAction();
- break;
- case 3:
- return $this->getShdDetails();
- break;
- case 4:
- return $this->getUsrUid();
- break;
- case 5:
- return $this->getAppUid();
- break;
- case 6:
- return $this->getShdDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ShadowTablePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getShdUid(),
- $keys[1] => $this->getAddTabUid(),
- $keys[2] => $this->getShdAction(),
- $keys[3] => $this->getShdDetails(),
- $keys[4] => $this->getUsrUid(),
- $keys[5] => $this->getAppUid(),
- $keys[6] => $this->getShdDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = ShadowTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setShdUid($value);
- break;
- case 1:
- $this->setAddTabUid($value);
- break;
- case 2:
- $this->setShdAction($value);
- break;
- case 3:
- $this->setShdDetails($value);
- break;
- case 4:
- $this->setUsrUid($value);
- break;
- case 5:
- $this->setAppUid($value);
- break;
- case 6:
- $this->setShdDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = ShadowTablePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setShdUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAddTabUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setShdAction($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setShdDetails($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setUsrUid($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setAppUid($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setShdDate($arr[$keys[6]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(ShadowTablePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(ShadowTablePeer::SHD_UID)) $criteria->add(ShadowTablePeer::SHD_UID, $this->shd_uid);
- if ($this->isColumnModified(ShadowTablePeer::ADD_TAB_UID)) $criteria->add(ShadowTablePeer::ADD_TAB_UID, $this->add_tab_uid);
- if ($this->isColumnModified(ShadowTablePeer::SHD_ACTION)) $criteria->add(ShadowTablePeer::SHD_ACTION, $this->shd_action);
- if ($this->isColumnModified(ShadowTablePeer::SHD_DETAILS)) $criteria->add(ShadowTablePeer::SHD_DETAILS, $this->shd_details);
- if ($this->isColumnModified(ShadowTablePeer::USR_UID)) $criteria->add(ShadowTablePeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(ShadowTablePeer::APP_UID)) $criteria->add(ShadowTablePeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(ShadowTablePeer::SHD_DATE)) $criteria->add(ShadowTablePeer::SHD_DATE, $this->shd_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(ShadowTablePeer::DATABASE_NAME);
-
- $criteria->add(ShadowTablePeer::SHD_UID, $this->shd_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getShdUid();
- }
-
- /**
- * Generic method to set the primary key (shd_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setShdUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of ShadowTable (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setAddTabUid($this->add_tab_uid);
-
- $copyObj->setShdAction($this->shd_action);
-
- $copyObj->setShdDetails($this->shd_details);
-
- $copyObj->setUsrUid($this->usr_uid);
-
- $copyObj->setAppUid($this->app_uid);
-
- $copyObj->setShdDate($this->shd_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setShdUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return ShadowTable Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return ShadowTablePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new ShadowTablePeer();
- }
- return self::$peer;
- }
-
-} // BaseShadowTable
+abstract class BaseShadowTable extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var ShadowTablePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the shd_uid field.
+ * @var string
+ */
+ protected $shd_uid = '';
+
+ /**
+ * The value for the add_tab_uid field.
+ * @var string
+ */
+ protected $add_tab_uid = '';
+
+ /**
+ * The value for the shd_action field.
+ * @var string
+ */
+ protected $shd_action = '';
+
+ /**
+ * The value for the shd_details field.
+ * @var string
+ */
+ protected $shd_details;
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the shd_date field.
+ * @var int
+ */
+ protected $shd_date;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [shd_uid] column value.
+ *
+ * @return string
+ */
+ public function getShdUid()
+ {
+
+ return $this->shd_uid;
+ }
+
+ /**
+ * Get the [add_tab_uid] column value.
+ *
+ * @return string
+ */
+ public function getAddTabUid()
+ {
+
+ return $this->add_tab_uid;
+ }
+
+ /**
+ * Get the [shd_action] column value.
+ *
+ * @return string
+ */
+ public function getShdAction()
+ {
+
+ return $this->shd_action;
+ }
+
+ /**
+ * Get the [shd_details] column value.
+ *
+ * @return string
+ */
+ public function getShdDetails()
+ {
+
+ return $this->shd_details;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [optionally formatted] [shd_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getShdDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->shd_date === null || $this->shd_date === '') {
+ return null;
+ } elseif (!is_int($this->shd_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->shd_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [shd_date] as date/time value: " .
+ var_export($this->shd_date, true));
+ }
+ } else {
+ $ts = $this->shd_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Set the value of [shd_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setShdUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->shd_uid !== $v || $v === '') {
+ $this->shd_uid = $v;
+ $this->modifiedColumns[] = ShadowTablePeer::SHD_UID;
+ }
+
+ } // setShdUid()
+
+ /**
+ * Set the value of [add_tab_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAddTabUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->add_tab_uid !== $v || $v === '') {
+ $this->add_tab_uid = $v;
+ $this->modifiedColumns[] = ShadowTablePeer::ADD_TAB_UID;
+ }
+
+ } // setAddTabUid()
+
+ /**
+ * Set the value of [shd_action] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setShdAction($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->shd_action !== $v || $v === '') {
+ $this->shd_action = $v;
+ $this->modifiedColumns[] = ShadowTablePeer::SHD_ACTION;
+ }
+
+ } // setShdAction()
+
+ /**
+ * Set the value of [shd_details] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setShdDetails($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->shd_details !== $v) {
+ $this->shd_details = $v;
+ $this->modifiedColumns[] = ShadowTablePeer::SHD_DETAILS;
+ }
+
+ } // setShdDetails()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = ShadowTablePeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = ShadowTablePeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [shd_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setShdDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [shd_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->shd_date !== $ts) {
+ $this->shd_date = $ts;
+ $this->modifiedColumns[] = ShadowTablePeer::SHD_DATE;
+ }
+
+ } // setShdDate()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->shd_uid = $rs->getString($startcol + 0);
+
+ $this->add_tab_uid = $rs->getString($startcol + 1);
+
+ $this->shd_action = $rs->getString($startcol + 2);
+
+ $this->shd_details = $rs->getString($startcol + 3);
+
+ $this->usr_uid = $rs->getString($startcol + 4);
+
+ $this->app_uid = $rs->getString($startcol + 5);
+
+ $this->shd_date = $rs->getTimestamp($startcol + 6, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 7; // 7 = ShadowTablePeer::NUM_COLUMNS - ShadowTablePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating ShadowTable object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ ShadowTablePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = ShadowTablePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += ShadowTablePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = ShadowTablePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ShadowTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getShdUid();
+ break;
+ case 1:
+ return $this->getAddTabUid();
+ break;
+ case 2:
+ return $this->getShdAction();
+ break;
+ case 3:
+ return $this->getShdDetails();
+ break;
+ case 4:
+ return $this->getUsrUid();
+ break;
+ case 5:
+ return $this->getAppUid();
+ break;
+ case 6:
+ return $this->getShdDate();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ShadowTablePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getShdUid(),
+ $keys[1] => $this->getAddTabUid(),
+ $keys[2] => $this->getShdAction(),
+ $keys[3] => $this->getShdDetails(),
+ $keys[4] => $this->getUsrUid(),
+ $keys[5] => $this->getAppUid(),
+ $keys[6] => $this->getShdDate(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = ShadowTablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setShdUid($value);
+ break;
+ case 1:
+ $this->setAddTabUid($value);
+ break;
+ case 2:
+ $this->setShdAction($value);
+ break;
+ case 3:
+ $this->setShdDetails($value);
+ break;
+ case 4:
+ $this->setUsrUid($value);
+ break;
+ case 5:
+ $this->setAppUid($value);
+ break;
+ case 6:
+ $this->setShdDate($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = ShadowTablePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setShdUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setAddTabUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setShdAction($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setShdDetails($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setUsrUid($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setAppUid($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setShdDate($arr[$keys[6]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(ShadowTablePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(ShadowTablePeer::SHD_UID)) {
+ $criteria->add(ShadowTablePeer::SHD_UID, $this->shd_uid);
+ }
+
+ if ($this->isColumnModified(ShadowTablePeer::ADD_TAB_UID)) {
+ $criteria->add(ShadowTablePeer::ADD_TAB_UID, $this->add_tab_uid);
+ }
+
+ if ($this->isColumnModified(ShadowTablePeer::SHD_ACTION)) {
+ $criteria->add(ShadowTablePeer::SHD_ACTION, $this->shd_action);
+ }
+
+ if ($this->isColumnModified(ShadowTablePeer::SHD_DETAILS)) {
+ $criteria->add(ShadowTablePeer::SHD_DETAILS, $this->shd_details);
+ }
+
+ if ($this->isColumnModified(ShadowTablePeer::USR_UID)) {
+ $criteria->add(ShadowTablePeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(ShadowTablePeer::APP_UID)) {
+ $criteria->add(ShadowTablePeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(ShadowTablePeer::SHD_DATE)) {
+ $criteria->add(ShadowTablePeer::SHD_DATE, $this->shd_date);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(ShadowTablePeer::DATABASE_NAME);
+
+ $criteria->add(ShadowTablePeer::SHD_UID, $this->shd_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getShdUid();
+ }
+
+ /**
+ * Generic method to set the primary key (shd_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setShdUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of ShadowTable (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setAddTabUid($this->add_tab_uid);
+
+ $copyObj->setShdAction($this->shd_action);
+
+ $copyObj->setShdDetails($this->shd_details);
+
+ $copyObj->setUsrUid($this->usr_uid);
+
+ $copyObj->setAppUid($this->app_uid);
+
+ $copyObj->setShdDate($this->shd_date);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setShdUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return ShadowTable Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return ShadowTablePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new ShadowTablePeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseShadowTablePeer.php b/workflow/engine/classes/model/om/BaseShadowTablePeer.php
index f9263b472..74a65d10c 100755
--- a/workflow/engine/classes/model/om/BaseShadowTablePeer.php
+++ b/workflow/engine/classes/model/om/BaseShadowTablePeer.php
@@ -12,584 +12,586 @@ include_once 'classes/model/ShadowTable.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseShadowTablePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'SHADOW_TABLE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.ShadowTable';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 7;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the SHD_UID field */
- const SHD_UID = 'SHADOW_TABLE.SHD_UID';
-
- /** the column name for the ADD_TAB_UID field */
- const ADD_TAB_UID = 'SHADOW_TABLE.ADD_TAB_UID';
-
- /** the column name for the SHD_ACTION field */
- const SHD_ACTION = 'SHADOW_TABLE.SHD_ACTION';
-
- /** the column name for the SHD_DETAILS field */
- const SHD_DETAILS = 'SHADOW_TABLE.SHD_DETAILS';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'SHADOW_TABLE.USR_UID';
-
- /** the column name for the APP_UID field */
- const APP_UID = 'SHADOW_TABLE.APP_UID';
-
- /** the column name for the SHD_DATE field */
- const SHD_DATE = 'SHADOW_TABLE.SHD_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('ShdUid', 'AddTabUid', 'ShdAction', 'ShdDetails', 'UsrUid', 'AppUid', 'ShdDate', ),
- BasePeer::TYPE_COLNAME => array (ShadowTablePeer::SHD_UID, ShadowTablePeer::ADD_TAB_UID, ShadowTablePeer::SHD_ACTION, ShadowTablePeer::SHD_DETAILS, ShadowTablePeer::USR_UID, ShadowTablePeer::APP_UID, ShadowTablePeer::SHD_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('SHD_UID', 'ADD_TAB_UID', 'SHD_ACTION', 'SHD_DETAILS', 'USR_UID', 'APP_UID', 'SHD_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('ShdUid' => 0, 'AddTabUid' => 1, 'ShdAction' => 2, 'ShdDetails' => 3, 'UsrUid' => 4, 'AppUid' => 5, 'ShdDate' => 6, ),
- BasePeer::TYPE_COLNAME => array (ShadowTablePeer::SHD_UID => 0, ShadowTablePeer::ADD_TAB_UID => 1, ShadowTablePeer::SHD_ACTION => 2, ShadowTablePeer::SHD_DETAILS => 3, ShadowTablePeer::USR_UID => 4, ShadowTablePeer::APP_UID => 5, ShadowTablePeer::SHD_DATE => 6, ),
- BasePeer::TYPE_FIELDNAME => array ('SHD_UID' => 0, 'ADD_TAB_UID' => 1, 'SHD_ACTION' => 2, 'SHD_DETAILS' => 3, 'USR_UID' => 4, 'APP_UID' => 5, 'SHD_DATE' => 6, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/ShadowTableMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.ShadowTableMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = ShadowTablePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. ShadowTablePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(ShadowTablePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(ShadowTablePeer::SHD_UID);
-
- $criteria->addSelectColumn(ShadowTablePeer::ADD_TAB_UID);
-
- $criteria->addSelectColumn(ShadowTablePeer::SHD_ACTION);
-
- $criteria->addSelectColumn(ShadowTablePeer::SHD_DETAILS);
-
- $criteria->addSelectColumn(ShadowTablePeer::USR_UID);
-
- $criteria->addSelectColumn(ShadowTablePeer::APP_UID);
-
- $criteria->addSelectColumn(ShadowTablePeer::SHD_DATE);
-
- }
-
- const COUNT = 'COUNT(SHADOW_TABLE.SHD_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT SHADOW_TABLE.SHD_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(ShadowTablePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(ShadowTablePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = ShadowTablePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return ShadowTable
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = ShadowTablePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return ShadowTablePeer::populateObjects(ShadowTablePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- ShadowTablePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = ShadowTablePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return ShadowTablePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a ShadowTable or Criteria object.
- *
- * @param mixed $values Criteria or ShadowTable object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from ShadowTable object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a ShadowTable or Criteria object.
- *
- * @param mixed $values Criteria or ShadowTable object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(ShadowTablePeer::SHD_UID);
- $selectCriteria->add(ShadowTablePeer::SHD_UID, $criteria->remove(ShadowTablePeer::SHD_UID), $comparison);
-
- } else { // $values is ShadowTable object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the SHADOW_TABLE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(ShadowTablePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a ShadowTable or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or ShadowTable object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof ShadowTable) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(ShadowTablePeer::SHD_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given ShadowTable object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param ShadowTable $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(ShadowTable $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(ShadowTablePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(ShadowTablePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(ShadowTablePeer::DATABASE_NAME, ShadowTablePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return ShadowTable
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(ShadowTablePeer::DATABASE_NAME);
-
- $criteria->add(ShadowTablePeer::SHD_UID, $pk);
-
-
- $v = ShadowTablePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(ShadowTablePeer::SHD_UID, $pks, Criteria::IN);
- $objs = ShadowTablePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseShadowTablePeer
+abstract class BaseShadowTablePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'SHADOW_TABLE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.ShadowTable';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 7;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the SHD_UID field */
+ const SHD_UID = 'SHADOW_TABLE.SHD_UID';
+
+ /** the column name for the ADD_TAB_UID field */
+ const ADD_TAB_UID = 'SHADOW_TABLE.ADD_TAB_UID';
+
+ /** the column name for the SHD_ACTION field */
+ const SHD_ACTION = 'SHADOW_TABLE.SHD_ACTION';
+
+ /** the column name for the SHD_DETAILS field */
+ const SHD_DETAILS = 'SHADOW_TABLE.SHD_DETAILS';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'SHADOW_TABLE.USR_UID';
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'SHADOW_TABLE.APP_UID';
+
+ /** the column name for the SHD_DATE field */
+ const SHD_DATE = 'SHADOW_TABLE.SHD_DATE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('ShdUid', 'AddTabUid', 'ShdAction', 'ShdDetails', 'UsrUid', 'AppUid', 'ShdDate', ),
+ BasePeer::TYPE_COLNAME => array (ShadowTablePeer::SHD_UID, ShadowTablePeer::ADD_TAB_UID, ShadowTablePeer::SHD_ACTION, ShadowTablePeer::SHD_DETAILS, ShadowTablePeer::USR_UID, ShadowTablePeer::APP_UID, ShadowTablePeer::SHD_DATE, ),
+ BasePeer::TYPE_FIELDNAME => array ('SHD_UID', 'ADD_TAB_UID', 'SHD_ACTION', 'SHD_DETAILS', 'USR_UID', 'APP_UID', 'SHD_DATE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('ShdUid' => 0, 'AddTabUid' => 1, 'ShdAction' => 2, 'ShdDetails' => 3, 'UsrUid' => 4, 'AppUid' => 5, 'ShdDate' => 6, ),
+ BasePeer::TYPE_COLNAME => array (ShadowTablePeer::SHD_UID => 0, ShadowTablePeer::ADD_TAB_UID => 1, ShadowTablePeer::SHD_ACTION => 2, ShadowTablePeer::SHD_DETAILS => 3, ShadowTablePeer::USR_UID => 4, ShadowTablePeer::APP_UID => 5, ShadowTablePeer::SHD_DATE => 6, ),
+ BasePeer::TYPE_FIELDNAME => array ('SHD_UID' => 0, 'ADD_TAB_UID' => 1, 'SHD_ACTION' => 2, 'SHD_DETAILS' => 3, 'USR_UID' => 4, 'APP_UID' => 5, 'SHD_DATE' => 6, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/ShadowTableMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.ShadowTableMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = ShadowTablePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. ShadowTablePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(ShadowTablePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(ShadowTablePeer::SHD_UID);
+
+ $criteria->addSelectColumn(ShadowTablePeer::ADD_TAB_UID);
+
+ $criteria->addSelectColumn(ShadowTablePeer::SHD_ACTION);
+
+ $criteria->addSelectColumn(ShadowTablePeer::SHD_DETAILS);
+
+ $criteria->addSelectColumn(ShadowTablePeer::USR_UID);
+
+ $criteria->addSelectColumn(ShadowTablePeer::APP_UID);
+
+ $criteria->addSelectColumn(ShadowTablePeer::SHD_DATE);
+
+ }
+
+ const COUNT = 'COUNT(SHADOW_TABLE.SHD_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT SHADOW_TABLE.SHD_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(ShadowTablePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(ShadowTablePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = ShadowTablePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return ShadowTable
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = ShadowTablePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return ShadowTablePeer::populateObjects(ShadowTablePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ ShadowTablePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = ShadowTablePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return ShadowTablePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a ShadowTable or Criteria object.
+ *
+ * @param mixed $values Criteria or ShadowTable object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from ShadowTable object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a ShadowTable or Criteria object.
+ *
+ * @param mixed $values Criteria or ShadowTable object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(ShadowTablePeer::SHD_UID);
+ $selectCriteria->add(ShadowTablePeer::SHD_UID, $criteria->remove(ShadowTablePeer::SHD_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the SHADOW_TABLE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(ShadowTablePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a ShadowTable or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or ShadowTable object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof ShadowTable) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(ShadowTablePeer::SHD_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given ShadowTable object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param ShadowTable $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(ShadowTable $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(ShadowTablePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(ShadowTablePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(ShadowTablePeer::DATABASE_NAME, ShadowTablePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return ShadowTable
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(ShadowTablePeer::DATABASE_NAME);
+
+ $criteria->add(ShadowTablePeer::SHD_UID, $pk);
+
+
+ $v = ShadowTablePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(ShadowTablePeer::SHD_UID, $pks, Criteria::IN);
+ $objs = ShadowTablePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseShadowTablePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseShadowTablePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/ShadowTableMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.ShadowTableMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/ShadowTableMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.ShadowTableMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseStage.php b/workflow/engine/classes/model/om/BaseStage.php
index 1495b8261..673e713b7 100755
--- a/workflow/engine/classes/model/om/BaseStage.php
+++ b/workflow/engine/classes/model/om/BaseStage.php
@@ -16,701 +16,727 @@ include_once 'classes/model/StagePeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStage extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var StagePeer
- */
- protected static $peer;
-
-
- /**
- * The value for the stg_uid field.
- * @var string
- */
- protected $stg_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the stg_posx field.
- * @var int
- */
- protected $stg_posx = 0;
-
-
- /**
- * The value for the stg_posy field.
- * @var int
- */
- protected $stg_posy = 0;
-
-
- /**
- * The value for the stg_index field.
- * @var int
- */
- protected $stg_index = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [stg_uid] column value.
- *
- * @return string
- */
- public function getStgUid()
- {
-
- return $this->stg_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [stg_posx] column value.
- *
- * @return int
- */
- public function getStgPosx()
- {
-
- return $this->stg_posx;
- }
-
- /**
- * Get the [stg_posy] column value.
- *
- * @return int
- */
- public function getStgPosy()
- {
-
- return $this->stg_posy;
- }
-
- /**
- * Get the [stg_index] column value.
- *
- * @return int
- */
- public function getStgIndex()
- {
-
- return $this->stg_index;
- }
-
- /**
- * Set the value of [stg_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStgUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->stg_uid !== $v || $v === '') {
- $this->stg_uid = $v;
- $this->modifiedColumns[] = StagePeer::STG_UID;
- }
-
- } // setStgUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = StagePeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [stg_posx] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setStgPosx($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->stg_posx !== $v || $v === 0) {
- $this->stg_posx = $v;
- $this->modifiedColumns[] = StagePeer::STG_POSX;
- }
-
- } // setStgPosx()
-
- /**
- * Set the value of [stg_posy] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setStgPosy($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->stg_posy !== $v || $v === 0) {
- $this->stg_posy = $v;
- $this->modifiedColumns[] = StagePeer::STG_POSY;
- }
-
- } // setStgPosy()
-
- /**
- * Set the value of [stg_index] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setStgIndex($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->stg_index !== $v || $v === 0) {
- $this->stg_index = $v;
- $this->modifiedColumns[] = StagePeer::STG_INDEX;
- }
-
- } // setStgIndex()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->stg_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->stg_posx = $rs->getInt($startcol + 2);
-
- $this->stg_posy = $rs->getInt($startcol + 3);
-
- $this->stg_index = $rs->getInt($startcol + 4);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = StagePeer::NUM_COLUMNS - StagePeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Stage object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StagePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- StagePeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StagePeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = StagePeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += StagePeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = StagePeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getStgUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getStgPosx();
- break;
- case 3:
- return $this->getStgPosy();
- break;
- case 4:
- return $this->getStgIndex();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StagePeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getStgUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getStgPosx(),
- $keys[3] => $this->getStgPosy(),
- $keys[4] => $this->getStgIndex(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setStgUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setStgPosx($value);
- break;
- case 3:
- $this->setStgPosy($value);
- break;
- case 4:
- $this->setStgIndex($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StagePeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setStgUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setStgPosx($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setStgPosy($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setStgIndex($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(StagePeer::DATABASE_NAME);
-
- if ($this->isColumnModified(StagePeer::STG_UID)) $criteria->add(StagePeer::STG_UID, $this->stg_uid);
- if ($this->isColumnModified(StagePeer::PRO_UID)) $criteria->add(StagePeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(StagePeer::STG_POSX)) $criteria->add(StagePeer::STG_POSX, $this->stg_posx);
- if ($this->isColumnModified(StagePeer::STG_POSY)) $criteria->add(StagePeer::STG_POSY, $this->stg_posy);
- if ($this->isColumnModified(StagePeer::STG_INDEX)) $criteria->add(StagePeer::STG_INDEX, $this->stg_index);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(StagePeer::DATABASE_NAME);
-
- $criteria->add(StagePeer::STG_UID, $this->stg_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getStgUid();
- }
-
- /**
- * Generic method to set the primary key (stg_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setStgUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Stage (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setStgPosx($this->stg_posx);
-
- $copyObj->setStgPosy($this->stg_posy);
-
- $copyObj->setStgIndex($this->stg_index);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setStgUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Stage Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return StagePeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new StagePeer();
- }
- return self::$peer;
- }
-
-} // BaseStage
+abstract class BaseStage extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var StagePeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the stg_uid field.
+ * @var string
+ */
+ protected $stg_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the stg_posx field.
+ * @var int
+ */
+ protected $stg_posx = 0;
+
+ /**
+ * The value for the stg_posy field.
+ * @var int
+ */
+ protected $stg_posy = 0;
+
+ /**
+ * The value for the stg_index field.
+ * @var int
+ */
+ protected $stg_index = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [stg_uid] column value.
+ *
+ * @return string
+ */
+ public function getStgUid()
+ {
+
+ return $this->stg_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [stg_posx] column value.
+ *
+ * @return int
+ */
+ public function getStgPosx()
+ {
+
+ return $this->stg_posx;
+ }
+
+ /**
+ * Get the [stg_posy] column value.
+ *
+ * @return int
+ */
+ public function getStgPosy()
+ {
+
+ return $this->stg_posy;
+ }
+
+ /**
+ * Get the [stg_index] column value.
+ *
+ * @return int
+ */
+ public function getStgIndex()
+ {
+
+ return $this->stg_index;
+ }
+
+ /**
+ * Set the value of [stg_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStgUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->stg_uid !== $v || $v === '') {
+ $this->stg_uid = $v;
+ $this->modifiedColumns[] = StagePeer::STG_UID;
+ }
+
+ } // setStgUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = StagePeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [stg_posx] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setStgPosx($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->stg_posx !== $v || $v === 0) {
+ $this->stg_posx = $v;
+ $this->modifiedColumns[] = StagePeer::STG_POSX;
+ }
+
+ } // setStgPosx()
+
+ /**
+ * Set the value of [stg_posy] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setStgPosy($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->stg_posy !== $v || $v === 0) {
+ $this->stg_posy = $v;
+ $this->modifiedColumns[] = StagePeer::STG_POSY;
+ }
+
+ } // setStgPosy()
+
+ /**
+ * Set the value of [stg_index] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setStgIndex($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->stg_index !== $v || $v === 0) {
+ $this->stg_index = $v;
+ $this->modifiedColumns[] = StagePeer::STG_INDEX;
+ }
+
+ } // setStgIndex()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->stg_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->stg_posx = $rs->getInt($startcol + 2);
+
+ $this->stg_posy = $rs->getInt($startcol + 3);
+
+ $this->stg_index = $rs->getInt($startcol + 4);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = StagePeer::NUM_COLUMNS - StagePeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Stage object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StagePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ StagePeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StagePeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = StagePeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += StagePeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = StagePeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getStgUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getStgPosx();
+ break;
+ case 3:
+ return $this->getStgPosy();
+ break;
+ case 4:
+ return $this->getStgIndex();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StagePeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getStgUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getStgPosx(),
+ $keys[3] => $this->getStgPosy(),
+ $keys[4] => $this->getStgIndex(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setStgUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setStgPosx($value);
+ break;
+ case 3:
+ $this->setStgPosy($value);
+ break;
+ case 4:
+ $this->setStgIndex($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StagePeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setStgUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setStgPosx($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setStgPosy($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setStgIndex($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(StagePeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(StagePeer::STG_UID)) {
+ $criteria->add(StagePeer::STG_UID, $this->stg_uid);
+ }
+
+ if ($this->isColumnModified(StagePeer::PRO_UID)) {
+ $criteria->add(StagePeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(StagePeer::STG_POSX)) {
+ $criteria->add(StagePeer::STG_POSX, $this->stg_posx);
+ }
+
+ if ($this->isColumnModified(StagePeer::STG_POSY)) {
+ $criteria->add(StagePeer::STG_POSY, $this->stg_posy);
+ }
+
+ if ($this->isColumnModified(StagePeer::STG_INDEX)) {
+ $criteria->add(StagePeer::STG_INDEX, $this->stg_index);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(StagePeer::DATABASE_NAME);
+
+ $criteria->add(StagePeer::STG_UID, $this->stg_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getStgUid();
+ }
+
+ /**
+ * Generic method to set the primary key (stg_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setStgUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Stage (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setStgPosx($this->stg_posx);
+
+ $copyObj->setStgPosy($this->stg_posy);
+
+ $copyObj->setStgIndex($this->stg_index);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setStgUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Stage Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return StagePeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new StagePeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseStagePeer.php b/workflow/engine/classes/model/om/BaseStagePeer.php
index 20175b3f2..63a007c02 100755
--- a/workflow/engine/classes/model/om/BaseStagePeer.php
+++ b/workflow/engine/classes/model/om/BaseStagePeer.php
@@ -12,574 +12,576 @@ include_once 'classes/model/Stage.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStagePeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'STAGE';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Stage';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the STG_UID field */
- const STG_UID = 'STAGE.STG_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'STAGE.PRO_UID';
-
- /** the column name for the STG_POSX field */
- const STG_POSX = 'STAGE.STG_POSX';
-
- /** the column name for the STG_POSY field */
- const STG_POSY = 'STAGE.STG_POSY';
-
- /** the column name for the STG_INDEX field */
- const STG_INDEX = 'STAGE.STG_INDEX';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('StgUid', 'ProUid', 'StgPosx', 'StgPosy', 'StgIndex', ),
- BasePeer::TYPE_COLNAME => array (StagePeer::STG_UID, StagePeer::PRO_UID, StagePeer::STG_POSX, StagePeer::STG_POSY, StagePeer::STG_INDEX, ),
- BasePeer::TYPE_FIELDNAME => array ('STG_UID', 'PRO_UID', 'STG_POSX', 'STG_POSY', 'STG_INDEX', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('StgUid' => 0, 'ProUid' => 1, 'StgPosx' => 2, 'StgPosy' => 3, 'StgIndex' => 4, ),
- BasePeer::TYPE_COLNAME => array (StagePeer::STG_UID => 0, StagePeer::PRO_UID => 1, StagePeer::STG_POSX => 2, StagePeer::STG_POSY => 3, StagePeer::STG_INDEX => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('STG_UID' => 0, 'PRO_UID' => 1, 'STG_POSX' => 2, 'STG_POSY' => 3, 'STG_INDEX' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/StageMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.StageMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = StagePeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. StagePeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(StagePeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(StagePeer::STG_UID);
-
- $criteria->addSelectColumn(StagePeer::PRO_UID);
-
- $criteria->addSelectColumn(StagePeer::STG_POSX);
-
- $criteria->addSelectColumn(StagePeer::STG_POSY);
-
- $criteria->addSelectColumn(StagePeer::STG_INDEX);
-
- }
-
- const COUNT = 'COUNT(STAGE.STG_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT STAGE.STG_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(StagePeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(StagePeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = StagePeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Stage
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = StagePeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return StagePeer::populateObjects(StagePeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- StagePeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = StagePeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return StagePeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Stage or Criteria object.
- *
- * @param mixed $values Criteria or Stage object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Stage object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Stage or Criteria object.
- *
- * @param mixed $values Criteria or Stage object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(StagePeer::STG_UID);
- $selectCriteria->add(StagePeer::STG_UID, $criteria->remove(StagePeer::STG_UID), $comparison);
-
- } else { // $values is Stage object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the STAGE table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(StagePeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Stage or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Stage object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(StagePeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Stage) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(StagePeer::STG_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Stage object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Stage $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Stage $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(StagePeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(StagePeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(StagePeer::DATABASE_NAME, StagePeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Stage
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(StagePeer::DATABASE_NAME);
-
- $criteria->add(StagePeer::STG_UID, $pk);
-
-
- $v = StagePeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(StagePeer::STG_UID, $pks, Criteria::IN);
- $objs = StagePeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseStagePeer
+abstract class BaseStagePeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'STAGE';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Stage';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the STG_UID field */
+ const STG_UID = 'STAGE.STG_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'STAGE.PRO_UID';
+
+ /** the column name for the STG_POSX field */
+ const STG_POSX = 'STAGE.STG_POSX';
+
+ /** the column name for the STG_POSY field */
+ const STG_POSY = 'STAGE.STG_POSY';
+
+ /** the column name for the STG_INDEX field */
+ const STG_INDEX = 'STAGE.STG_INDEX';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('StgUid', 'ProUid', 'StgPosx', 'StgPosy', 'StgIndex', ),
+ BasePeer::TYPE_COLNAME => array (StagePeer::STG_UID, StagePeer::PRO_UID, StagePeer::STG_POSX, StagePeer::STG_POSY, StagePeer::STG_INDEX, ),
+ BasePeer::TYPE_FIELDNAME => array ('STG_UID', 'PRO_UID', 'STG_POSX', 'STG_POSY', 'STG_INDEX', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('StgUid' => 0, 'ProUid' => 1, 'StgPosx' => 2, 'StgPosy' => 3, 'StgIndex' => 4, ),
+ BasePeer::TYPE_COLNAME => array (StagePeer::STG_UID => 0, StagePeer::PRO_UID => 1, StagePeer::STG_POSX => 2, StagePeer::STG_POSY => 3, StagePeer::STG_INDEX => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('STG_UID' => 0, 'PRO_UID' => 1, 'STG_POSX' => 2, 'STG_POSY' => 3, 'STG_INDEX' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/StageMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.StageMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = StagePeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. StagePeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(StagePeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(StagePeer::STG_UID);
+
+ $criteria->addSelectColumn(StagePeer::PRO_UID);
+
+ $criteria->addSelectColumn(StagePeer::STG_POSX);
+
+ $criteria->addSelectColumn(StagePeer::STG_POSY);
+
+ $criteria->addSelectColumn(StagePeer::STG_INDEX);
+
+ }
+
+ const COUNT = 'COUNT(STAGE.STG_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT STAGE.STG_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(StagePeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(StagePeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = StagePeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Stage
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = StagePeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return StagePeer::populateObjects(StagePeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ StagePeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = StagePeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return StagePeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Stage or Criteria object.
+ *
+ * @param mixed $values Criteria or Stage object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Stage object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Stage or Criteria object.
+ *
+ * @param mixed $values Criteria or Stage object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(StagePeer::STG_UID);
+ $selectCriteria->add(StagePeer::STG_UID, $criteria->remove(StagePeer::STG_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the STAGE table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(StagePeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Stage or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Stage object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(StagePeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Stage) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(StagePeer::STG_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Stage object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Stage $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Stage $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(StagePeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(StagePeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(StagePeer::DATABASE_NAME, StagePeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Stage
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(StagePeer::DATABASE_NAME);
+
+ $criteria->add(StagePeer::STG_UID, $pk);
+
+
+ $v = StagePeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(StagePeer::STG_UID, $pks, Criteria::IN);
+ $objs = StagePeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseStagePeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseStagePeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/StageMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.StageMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/StageMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.StageMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseStep.php b/workflow/engine/classes/model/om/BaseStep.php
index 0d1e10760..d03018da7 100755
--- a/workflow/engine/classes/model/om/BaseStep.php
+++ b/workflow/engine/classes/model/om/BaseStep.php
@@ -16,860 +16,901 @@ include_once 'classes/model/StepPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStep extends BaseObject implements Persistent {
-
+abstract class BaseStep extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var StepPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the step_uid field.
+ * @var string
+ */
+ protected $step_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '0';
+
+ /**
+ * The value for the step_type_obj field.
+ * @var string
+ */
+ protected $step_type_obj = 'DYNAFORM';
+
+ /**
+ * The value for the step_uid_obj field.
+ * @var string
+ */
+ protected $step_uid_obj = '0';
+
+ /**
+ * The value for the step_condition field.
+ * @var string
+ */
+ protected $step_condition;
+
+ /**
+ * The value for the step_position field.
+ * @var int
+ */
+ protected $step_position = 0;
+
+ /**
+ * The value for the step_mode field.
+ * @var string
+ */
+ protected $step_mode = 'EDIT';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [step_uid] column value.
+ *
+ * @return string
+ */
+ public function getStepUid()
+ {
+
+ return $this->step_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [step_type_obj] column value.
+ *
+ * @return string
+ */
+ public function getStepTypeObj()
+ {
+
+ return $this->step_type_obj;
+ }
+
+ /**
+ * Get the [step_uid_obj] column value.
+ *
+ * @return string
+ */
+ public function getStepUidObj()
+ {
+
+ return $this->step_uid_obj;
+ }
+
+ /**
+ * Get the [step_condition] column value.
+ *
+ * @return string
+ */
+ public function getStepCondition()
+ {
+
+ return $this->step_condition;
+ }
+
+ /**
+ * Get the [step_position] column value.
+ *
+ * @return int
+ */
+ public function getStepPosition()
+ {
+
+ return $this->step_position;
+ }
+
+ /**
+ * Get the [step_mode] column value.
+ *
+ * @return string
+ */
+ public function getStepMode()
+ {
+
+ return $this->step_mode;
+ }
+
+ /**
+ * Set the value of [step_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_uid !== $v || $v === '') {
+ $this->step_uid = $v;
+ $this->modifiedColumns[] = StepPeer::STEP_UID;
+ }
+
+ } // setStepUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = StepPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '0') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = StepPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [step_type_obj] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepTypeObj($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_type_obj !== $v || $v === 'DYNAFORM') {
+ $this->step_type_obj = $v;
+ $this->modifiedColumns[] = StepPeer::STEP_TYPE_OBJ;
+ }
+
+ } // setStepTypeObj()
+
+ /**
+ * Set the value of [step_uid_obj] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepUidObj($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_uid_obj !== $v || $v === '0') {
+ $this->step_uid_obj = $v;
+ $this->modifiedColumns[] = StepPeer::STEP_UID_OBJ;
+ }
+
+ } // setStepUidObj()
+
+ /**
+ * Set the value of [step_condition] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepCondition($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_condition !== $v) {
+ $this->step_condition = $v;
+ $this->modifiedColumns[] = StepPeer::STEP_CONDITION;
+ }
+
+ } // setStepCondition()
+
+ /**
+ * Set the value of [step_position] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setStepPosition($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->step_position !== $v || $v === 0) {
+ $this->step_position = $v;
+ $this->modifiedColumns[] = StepPeer::STEP_POSITION;
+ }
+
+ } // setStepPosition()
+
+ /**
+ * Set the value of [step_mode] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepMode($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_mode !== $v || $v === 'EDIT') {
+ $this->step_mode = $v;
+ $this->modifiedColumns[] = StepPeer::STEP_MODE;
+ }
+
+ } // setStepMode()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->step_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->tas_uid = $rs->getString($startcol + 2);
+
+ $this->step_type_obj = $rs->getString($startcol + 3);
+
+ $this->step_uid_obj = $rs->getString($startcol + 4);
+
+ $this->step_condition = $rs->getString($startcol + 5);
+
+ $this->step_position = $rs->getInt($startcol + 6);
+
+ $this->step_mode = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = StepPeer::NUM_COLUMNS - StepPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Step object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StepPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ StepPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StepPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = StepPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += StepPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = StepPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StepPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getStepUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getTasUid();
+ break;
+ case 3:
+ return $this->getStepTypeObj();
+ break;
+ case 4:
+ return $this->getStepUidObj();
+ break;
+ case 5:
+ return $this->getStepCondition();
+ break;
+ case 6:
+ return $this->getStepPosition();
+ break;
+ case 7:
+ return $this->getStepMode();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StepPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getStepUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getTasUid(),
+ $keys[3] => $this->getStepTypeObj(),
+ $keys[4] => $this->getStepUidObj(),
+ $keys[5] => $this->getStepCondition(),
+ $keys[6] => $this->getStepPosition(),
+ $keys[7] => $this->getStepMode(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StepPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setStepUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setTasUid($value);
+ break;
+ case 3:
+ $this->setStepTypeObj($value);
+ break;
+ case 4:
+ $this->setStepUidObj($value);
+ break;
+ case 5:
+ $this->setStepCondition($value);
+ break;
+ case 6:
+ $this->setStepPosition($value);
+ break;
+ case 7:
+ $this->setStepMode($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StepPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setStepUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTasUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setStepTypeObj($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setStepUidObj($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setStepCondition($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setStepPosition($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setStepMode($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(StepPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(StepPeer::STEP_UID)) {
+ $criteria->add(StepPeer::STEP_UID, $this->step_uid);
+ }
+
+ if ($this->isColumnModified(StepPeer::PRO_UID)) {
+ $criteria->add(StepPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(StepPeer::TAS_UID)) {
+ $criteria->add(StepPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(StepPeer::STEP_TYPE_OBJ)) {
+ $criteria->add(StepPeer::STEP_TYPE_OBJ, $this->step_type_obj);
+ }
+
+ if ($this->isColumnModified(StepPeer::STEP_UID_OBJ)) {
+ $criteria->add(StepPeer::STEP_UID_OBJ, $this->step_uid_obj);
+ }
+
+ if ($this->isColumnModified(StepPeer::STEP_CONDITION)) {
+ $criteria->add(StepPeer::STEP_CONDITION, $this->step_condition);
+ }
+
+ if ($this->isColumnModified(StepPeer::STEP_POSITION)) {
+ $criteria->add(StepPeer::STEP_POSITION, $this->step_position);
+ }
+
+ if ($this->isColumnModified(StepPeer::STEP_MODE)) {
+ $criteria->add(StepPeer::STEP_MODE, $this->step_mode);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(StepPeer::DATABASE_NAME);
+
+ $criteria->add(StepPeer::STEP_UID, $this->step_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getStepUid();
+ }
+
+ /**
+ * Generic method to set the primary key (step_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setStepUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Step (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTasUid($this->tas_uid);
+
+ $copyObj->setStepTypeObj($this->step_type_obj);
+
+ $copyObj->setStepUidObj($this->step_uid_obj);
+
+ $copyObj->setStepCondition($this->step_condition);
+
+ $copyObj->setStepPosition($this->step_position);
+
+ $copyObj->setStepMode($this->step_mode);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setStepUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Step Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return StepPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new StepPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var StepPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the step_uid field.
- * @var string
- */
- protected $step_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '0';
-
-
- /**
- * The value for the step_type_obj field.
- * @var string
- */
- protected $step_type_obj = 'DYNAFORM';
-
-
- /**
- * The value for the step_uid_obj field.
- * @var string
- */
- protected $step_uid_obj = '0';
-
-
- /**
- * The value for the step_condition field.
- * @var string
- */
- protected $step_condition;
-
-
- /**
- * The value for the step_position field.
- * @var int
- */
- protected $step_position = 0;
-
-
- /**
- * The value for the step_mode field.
- * @var string
- */
- protected $step_mode = 'EDIT';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [step_uid] column value.
- *
- * @return string
- */
- public function getStepUid()
- {
-
- return $this->step_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [step_type_obj] column value.
- *
- * @return string
- */
- public function getStepTypeObj()
- {
-
- return $this->step_type_obj;
- }
-
- /**
- * Get the [step_uid_obj] column value.
- *
- * @return string
- */
- public function getStepUidObj()
- {
-
- return $this->step_uid_obj;
- }
-
- /**
- * Get the [step_condition] column value.
- *
- * @return string
- */
- public function getStepCondition()
- {
-
- return $this->step_condition;
- }
-
- /**
- * Get the [step_position] column value.
- *
- * @return int
- */
- public function getStepPosition()
- {
-
- return $this->step_position;
- }
-
- /**
- * Get the [step_mode] column value.
- *
- * @return string
- */
- public function getStepMode()
- {
-
- return $this->step_mode;
- }
-
- /**
- * Set the value of [step_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_uid !== $v || $v === '') {
- $this->step_uid = $v;
- $this->modifiedColumns[] = StepPeer::STEP_UID;
- }
-
- } // setStepUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = StepPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '0') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = StepPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [step_type_obj] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepTypeObj($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_type_obj !== $v || $v === 'DYNAFORM') {
- $this->step_type_obj = $v;
- $this->modifiedColumns[] = StepPeer::STEP_TYPE_OBJ;
- }
-
- } // setStepTypeObj()
-
- /**
- * Set the value of [step_uid_obj] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepUidObj($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_uid_obj !== $v || $v === '0') {
- $this->step_uid_obj = $v;
- $this->modifiedColumns[] = StepPeer::STEP_UID_OBJ;
- }
-
- } // setStepUidObj()
-
- /**
- * Set the value of [step_condition] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepCondition($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_condition !== $v) {
- $this->step_condition = $v;
- $this->modifiedColumns[] = StepPeer::STEP_CONDITION;
- }
-
- } // setStepCondition()
-
- /**
- * Set the value of [step_position] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setStepPosition($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->step_position !== $v || $v === 0) {
- $this->step_position = $v;
- $this->modifiedColumns[] = StepPeer::STEP_POSITION;
- }
-
- } // setStepPosition()
-
- /**
- * Set the value of [step_mode] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepMode($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_mode !== $v || $v === 'EDIT') {
- $this->step_mode = $v;
- $this->modifiedColumns[] = StepPeer::STEP_MODE;
- }
-
- } // setStepMode()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->step_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->tas_uid = $rs->getString($startcol + 2);
-
- $this->step_type_obj = $rs->getString($startcol + 3);
-
- $this->step_uid_obj = $rs->getString($startcol + 4);
-
- $this->step_condition = $rs->getString($startcol + 5);
-
- $this->step_position = $rs->getInt($startcol + 6);
-
- $this->step_mode = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = StepPeer::NUM_COLUMNS - StepPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Step object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StepPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- StepPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StepPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = StepPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += StepPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = StepPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StepPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getStepUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getTasUid();
- break;
- case 3:
- return $this->getStepTypeObj();
- break;
- case 4:
- return $this->getStepUidObj();
- break;
- case 5:
- return $this->getStepCondition();
- break;
- case 6:
- return $this->getStepPosition();
- break;
- case 7:
- return $this->getStepMode();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StepPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getStepUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getTasUid(),
- $keys[3] => $this->getStepTypeObj(),
- $keys[4] => $this->getStepUidObj(),
- $keys[5] => $this->getStepCondition(),
- $keys[6] => $this->getStepPosition(),
- $keys[7] => $this->getStepMode(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StepPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setStepUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setTasUid($value);
- break;
- case 3:
- $this->setStepTypeObj($value);
- break;
- case 4:
- $this->setStepUidObj($value);
- break;
- case 5:
- $this->setStepCondition($value);
- break;
- case 6:
- $this->setStepPosition($value);
- break;
- case 7:
- $this->setStepMode($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StepPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setStepUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTasUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setStepTypeObj($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setStepUidObj($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setStepCondition($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setStepPosition($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setStepMode($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(StepPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(StepPeer::STEP_UID)) $criteria->add(StepPeer::STEP_UID, $this->step_uid);
- if ($this->isColumnModified(StepPeer::PRO_UID)) $criteria->add(StepPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(StepPeer::TAS_UID)) $criteria->add(StepPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(StepPeer::STEP_TYPE_OBJ)) $criteria->add(StepPeer::STEP_TYPE_OBJ, $this->step_type_obj);
- if ($this->isColumnModified(StepPeer::STEP_UID_OBJ)) $criteria->add(StepPeer::STEP_UID_OBJ, $this->step_uid_obj);
- if ($this->isColumnModified(StepPeer::STEP_CONDITION)) $criteria->add(StepPeer::STEP_CONDITION, $this->step_condition);
- if ($this->isColumnModified(StepPeer::STEP_POSITION)) $criteria->add(StepPeer::STEP_POSITION, $this->step_position);
- if ($this->isColumnModified(StepPeer::STEP_MODE)) $criteria->add(StepPeer::STEP_MODE, $this->step_mode);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(StepPeer::DATABASE_NAME);
-
- $criteria->add(StepPeer::STEP_UID, $this->step_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getStepUid();
- }
-
- /**
- * Generic method to set the primary key (step_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setStepUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Step (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setStepTypeObj($this->step_type_obj);
-
- $copyObj->setStepUidObj($this->step_uid_obj);
-
- $copyObj->setStepCondition($this->step_condition);
-
- $copyObj->setStepPosition($this->step_position);
-
- $copyObj->setStepMode($this->step_mode);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setStepUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Step Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return StepPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new StepPeer();
- }
- return self::$peer;
- }
-
-} // BaseStep
diff --git a/workflow/engine/classes/model/om/BaseStepPeer.php b/workflow/engine/classes/model/om/BaseStepPeer.php
index 08dddae04..a342473ff 100755
--- a/workflow/engine/classes/model/om/BaseStepPeer.php
+++ b/workflow/engine/classes/model/om/BaseStepPeer.php
@@ -12,592 +12,594 @@ include_once 'classes/model/Step.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStepPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'STEP';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Step';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the STEP_UID field */
- const STEP_UID = 'STEP.STEP_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'STEP.PRO_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'STEP.TAS_UID';
-
- /** the column name for the STEP_TYPE_OBJ field */
- const STEP_TYPE_OBJ = 'STEP.STEP_TYPE_OBJ';
-
- /** the column name for the STEP_UID_OBJ field */
- const STEP_UID_OBJ = 'STEP.STEP_UID_OBJ';
-
- /** the column name for the STEP_CONDITION field */
- const STEP_CONDITION = 'STEP.STEP_CONDITION';
-
- /** the column name for the STEP_POSITION field */
- const STEP_POSITION = 'STEP.STEP_POSITION';
-
- /** the column name for the STEP_MODE field */
- const STEP_MODE = 'STEP.STEP_MODE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('StepUid', 'ProUid', 'TasUid', 'StepTypeObj', 'StepUidObj', 'StepCondition', 'StepPosition', 'StepMode', ),
- BasePeer::TYPE_COLNAME => array (StepPeer::STEP_UID, StepPeer::PRO_UID, StepPeer::TAS_UID, StepPeer::STEP_TYPE_OBJ, StepPeer::STEP_UID_OBJ, StepPeer::STEP_CONDITION, StepPeer::STEP_POSITION, StepPeer::STEP_MODE, ),
- BasePeer::TYPE_FIELDNAME => array ('STEP_UID', 'PRO_UID', 'TAS_UID', 'STEP_TYPE_OBJ', 'STEP_UID_OBJ', 'STEP_CONDITION', 'STEP_POSITION', 'STEP_MODE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('StepUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'StepTypeObj' => 3, 'StepUidObj' => 4, 'StepCondition' => 5, 'StepPosition' => 6, 'StepMode' => 7, ),
- BasePeer::TYPE_COLNAME => array (StepPeer::STEP_UID => 0, StepPeer::PRO_UID => 1, StepPeer::TAS_UID => 2, StepPeer::STEP_TYPE_OBJ => 3, StepPeer::STEP_UID_OBJ => 4, StepPeer::STEP_CONDITION => 5, StepPeer::STEP_POSITION => 6, StepPeer::STEP_MODE => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('STEP_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'STEP_TYPE_OBJ' => 3, 'STEP_UID_OBJ' => 4, 'STEP_CONDITION' => 5, 'STEP_POSITION' => 6, 'STEP_MODE' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/StepMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.StepMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = StepPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. StepPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(StepPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(StepPeer::STEP_UID);
-
- $criteria->addSelectColumn(StepPeer::PRO_UID);
-
- $criteria->addSelectColumn(StepPeer::TAS_UID);
-
- $criteria->addSelectColumn(StepPeer::STEP_TYPE_OBJ);
-
- $criteria->addSelectColumn(StepPeer::STEP_UID_OBJ);
-
- $criteria->addSelectColumn(StepPeer::STEP_CONDITION);
-
- $criteria->addSelectColumn(StepPeer::STEP_POSITION);
-
- $criteria->addSelectColumn(StepPeer::STEP_MODE);
-
- }
-
- const COUNT = 'COUNT(STEP.STEP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT STEP.STEP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(StepPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(StepPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = StepPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Step
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = StepPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return StepPeer::populateObjects(StepPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- StepPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = StepPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return StepPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Step or Criteria object.
- *
- * @param mixed $values Criteria or Step object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Step object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Step or Criteria object.
- *
- * @param mixed $values Criteria or Step object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(StepPeer::STEP_UID);
- $selectCriteria->add(StepPeer::STEP_UID, $criteria->remove(StepPeer::STEP_UID), $comparison);
-
- } else { // $values is Step object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the STEP table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(StepPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Step or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Step object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(StepPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Step) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(StepPeer::STEP_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Step object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Step $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Step $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(StepPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(StepPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(StepPeer::STEP_TYPE_OBJ))
- $columns[StepPeer::STEP_TYPE_OBJ] = $obj->getStepTypeObj();
-
- }
-
- return BasePeer::doValidate(StepPeer::DATABASE_NAME, StepPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Step
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(StepPeer::DATABASE_NAME);
-
- $criteria->add(StepPeer::STEP_UID, $pk);
-
-
- $v = StepPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(StepPeer::STEP_UID, $pks, Criteria::IN);
- $objs = StepPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseStepPeer
+abstract class BaseStepPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'STEP';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Step';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the STEP_UID field */
+ const STEP_UID = 'STEP.STEP_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'STEP.PRO_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'STEP.TAS_UID';
+
+ /** the column name for the STEP_TYPE_OBJ field */
+ const STEP_TYPE_OBJ = 'STEP.STEP_TYPE_OBJ';
+
+ /** the column name for the STEP_UID_OBJ field */
+ const STEP_UID_OBJ = 'STEP.STEP_UID_OBJ';
+
+ /** the column name for the STEP_CONDITION field */
+ const STEP_CONDITION = 'STEP.STEP_CONDITION';
+
+ /** the column name for the STEP_POSITION field */
+ const STEP_POSITION = 'STEP.STEP_POSITION';
+
+ /** the column name for the STEP_MODE field */
+ const STEP_MODE = 'STEP.STEP_MODE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('StepUid', 'ProUid', 'TasUid', 'StepTypeObj', 'StepUidObj', 'StepCondition', 'StepPosition', 'StepMode', ),
+ BasePeer::TYPE_COLNAME => array (StepPeer::STEP_UID, StepPeer::PRO_UID, StepPeer::TAS_UID, StepPeer::STEP_TYPE_OBJ, StepPeer::STEP_UID_OBJ, StepPeer::STEP_CONDITION, StepPeer::STEP_POSITION, StepPeer::STEP_MODE, ),
+ BasePeer::TYPE_FIELDNAME => array ('STEP_UID', 'PRO_UID', 'TAS_UID', 'STEP_TYPE_OBJ', 'STEP_UID_OBJ', 'STEP_CONDITION', 'STEP_POSITION', 'STEP_MODE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('StepUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'StepTypeObj' => 3, 'StepUidObj' => 4, 'StepCondition' => 5, 'StepPosition' => 6, 'StepMode' => 7, ),
+ BasePeer::TYPE_COLNAME => array (StepPeer::STEP_UID => 0, StepPeer::PRO_UID => 1, StepPeer::TAS_UID => 2, StepPeer::STEP_TYPE_OBJ => 3, StepPeer::STEP_UID_OBJ => 4, StepPeer::STEP_CONDITION => 5, StepPeer::STEP_POSITION => 6, StepPeer::STEP_MODE => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('STEP_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'STEP_TYPE_OBJ' => 3, 'STEP_UID_OBJ' => 4, 'STEP_CONDITION' => 5, 'STEP_POSITION' => 6, 'STEP_MODE' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/StepMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.StepMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = StepPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. StepPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(StepPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(StepPeer::STEP_UID);
+
+ $criteria->addSelectColumn(StepPeer::PRO_UID);
+
+ $criteria->addSelectColumn(StepPeer::TAS_UID);
+
+ $criteria->addSelectColumn(StepPeer::STEP_TYPE_OBJ);
+
+ $criteria->addSelectColumn(StepPeer::STEP_UID_OBJ);
+
+ $criteria->addSelectColumn(StepPeer::STEP_CONDITION);
+
+ $criteria->addSelectColumn(StepPeer::STEP_POSITION);
+
+ $criteria->addSelectColumn(StepPeer::STEP_MODE);
+
+ }
+
+ const COUNT = 'COUNT(STEP.STEP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT STEP.STEP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(StepPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(StepPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = StepPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Step
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = StepPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return StepPeer::populateObjects(StepPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ StepPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = StepPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return StepPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Step or Criteria object.
+ *
+ * @param mixed $values Criteria or Step object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Step object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Step or Criteria object.
+ *
+ * @param mixed $values Criteria or Step object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(StepPeer::STEP_UID);
+ $selectCriteria->add(StepPeer::STEP_UID, $criteria->remove(StepPeer::STEP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the STEP table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(StepPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Step or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Step object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(StepPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Step) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(StepPeer::STEP_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Step object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Step $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Step $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(StepPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(StepPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(StepPeer::STEP_TYPE_OBJ))
+ $columns[StepPeer::STEP_TYPE_OBJ] = $obj->getStepTypeObj();
+
+ }
+
+ return BasePeer::doValidate(StepPeer::DATABASE_NAME, StepPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Step
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(StepPeer::DATABASE_NAME);
+
+ $criteria->add(StepPeer::STEP_UID, $pk);
+
+
+ $v = StepPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(StepPeer::STEP_UID, $pks, Criteria::IN);
+ $objs = StepPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseStepPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseStepPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/StepMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.StepMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/StepMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.StepMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseStepSupervisor.php b/workflow/engine/classes/model/om/BaseStepSupervisor.php
index 1c7850719..1f3fc3284 100755
--- a/workflow/engine/classes/model/om/BaseStepSupervisor.php
+++ b/workflow/engine/classes/model/om/BaseStepSupervisor.php
@@ -16,701 +16,727 @@ include_once 'classes/model/StepSupervisorPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStepSupervisor extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var StepSupervisorPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the step_uid field.
- * @var string
- */
- protected $step_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '0';
-
-
- /**
- * The value for the step_type_obj field.
- * @var string
- */
- protected $step_type_obj = 'DYNAFORM';
-
-
- /**
- * The value for the step_uid_obj field.
- * @var string
- */
- protected $step_uid_obj = '0';
-
-
- /**
- * The value for the step_position field.
- * @var int
- */
- protected $step_position = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [step_uid] column value.
- *
- * @return string
- */
- public function getStepUid()
- {
-
- return $this->step_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [step_type_obj] column value.
- *
- * @return string
- */
- public function getStepTypeObj()
- {
-
- return $this->step_type_obj;
- }
-
- /**
- * Get the [step_uid_obj] column value.
- *
- * @return string
- */
- public function getStepUidObj()
- {
-
- return $this->step_uid_obj;
- }
-
- /**
- * Get the [step_position] column value.
- *
- * @return int
- */
- public function getStepPosition()
- {
-
- return $this->step_position;
- }
-
- /**
- * Set the value of [step_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_uid !== $v || $v === '') {
- $this->step_uid = $v;
- $this->modifiedColumns[] = StepSupervisorPeer::STEP_UID;
- }
-
- } // setStepUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '0') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = StepSupervisorPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [step_type_obj] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepTypeObj($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_type_obj !== $v || $v === 'DYNAFORM') {
- $this->step_type_obj = $v;
- $this->modifiedColumns[] = StepSupervisorPeer::STEP_TYPE_OBJ;
- }
-
- } // setStepTypeObj()
-
- /**
- * Set the value of [step_uid_obj] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepUidObj($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_uid_obj !== $v || $v === '0') {
- $this->step_uid_obj = $v;
- $this->modifiedColumns[] = StepSupervisorPeer::STEP_UID_OBJ;
- }
-
- } // setStepUidObj()
-
- /**
- * Set the value of [step_position] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setStepPosition($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->step_position !== $v || $v === 0) {
- $this->step_position = $v;
- $this->modifiedColumns[] = StepSupervisorPeer::STEP_POSITION;
- }
-
- } // setStepPosition()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->step_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->step_type_obj = $rs->getString($startcol + 2);
-
- $this->step_uid_obj = $rs->getString($startcol + 3);
-
- $this->step_position = $rs->getInt($startcol + 4);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = StepSupervisorPeer::NUM_COLUMNS - StepSupervisorPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating StepSupervisor object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StepSupervisorPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- StepSupervisorPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StepSupervisorPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = StepSupervisorPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += StepSupervisorPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = StepSupervisorPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StepSupervisorPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getStepUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getStepTypeObj();
- break;
- case 3:
- return $this->getStepUidObj();
- break;
- case 4:
- return $this->getStepPosition();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StepSupervisorPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getStepUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getStepTypeObj(),
- $keys[3] => $this->getStepUidObj(),
- $keys[4] => $this->getStepPosition(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StepSupervisorPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setStepUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setStepTypeObj($value);
- break;
- case 3:
- $this->setStepUidObj($value);
- break;
- case 4:
- $this->setStepPosition($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StepSupervisorPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setStepUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setStepTypeObj($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setStepUidObj($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setStepPosition($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(StepSupervisorPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(StepSupervisorPeer::STEP_UID)) $criteria->add(StepSupervisorPeer::STEP_UID, $this->step_uid);
- if ($this->isColumnModified(StepSupervisorPeer::PRO_UID)) $criteria->add(StepSupervisorPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(StepSupervisorPeer::STEP_TYPE_OBJ)) $criteria->add(StepSupervisorPeer::STEP_TYPE_OBJ, $this->step_type_obj);
- if ($this->isColumnModified(StepSupervisorPeer::STEP_UID_OBJ)) $criteria->add(StepSupervisorPeer::STEP_UID_OBJ, $this->step_uid_obj);
- if ($this->isColumnModified(StepSupervisorPeer::STEP_POSITION)) $criteria->add(StepSupervisorPeer::STEP_POSITION, $this->step_position);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(StepSupervisorPeer::DATABASE_NAME);
-
- $criteria->add(StepSupervisorPeer::STEP_UID, $this->step_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getStepUid();
- }
-
- /**
- * Generic method to set the primary key (step_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setStepUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of StepSupervisor (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setStepTypeObj($this->step_type_obj);
-
- $copyObj->setStepUidObj($this->step_uid_obj);
-
- $copyObj->setStepPosition($this->step_position);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setStepUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return StepSupervisor Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return StepSupervisorPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new StepSupervisorPeer();
- }
- return self::$peer;
- }
-
-} // BaseStepSupervisor
+abstract class BaseStepSupervisor extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var StepSupervisorPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the step_uid field.
+ * @var string
+ */
+ protected $step_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '0';
+
+ /**
+ * The value for the step_type_obj field.
+ * @var string
+ */
+ protected $step_type_obj = 'DYNAFORM';
+
+ /**
+ * The value for the step_uid_obj field.
+ * @var string
+ */
+ protected $step_uid_obj = '0';
+
+ /**
+ * The value for the step_position field.
+ * @var int
+ */
+ protected $step_position = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [step_uid] column value.
+ *
+ * @return string
+ */
+ public function getStepUid()
+ {
+
+ return $this->step_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [step_type_obj] column value.
+ *
+ * @return string
+ */
+ public function getStepTypeObj()
+ {
+
+ return $this->step_type_obj;
+ }
+
+ /**
+ * Get the [step_uid_obj] column value.
+ *
+ * @return string
+ */
+ public function getStepUidObj()
+ {
+
+ return $this->step_uid_obj;
+ }
+
+ /**
+ * Get the [step_position] column value.
+ *
+ * @return int
+ */
+ public function getStepPosition()
+ {
+
+ return $this->step_position;
+ }
+
+ /**
+ * Set the value of [step_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_uid !== $v || $v === '') {
+ $this->step_uid = $v;
+ $this->modifiedColumns[] = StepSupervisorPeer::STEP_UID;
+ }
+
+ } // setStepUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '0') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = StepSupervisorPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [step_type_obj] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepTypeObj($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_type_obj !== $v || $v === 'DYNAFORM') {
+ $this->step_type_obj = $v;
+ $this->modifiedColumns[] = StepSupervisorPeer::STEP_TYPE_OBJ;
+ }
+
+ } // setStepTypeObj()
+
+ /**
+ * Set the value of [step_uid_obj] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepUidObj($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_uid_obj !== $v || $v === '0') {
+ $this->step_uid_obj = $v;
+ $this->modifiedColumns[] = StepSupervisorPeer::STEP_UID_OBJ;
+ }
+
+ } // setStepUidObj()
+
+ /**
+ * Set the value of [step_position] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setStepPosition($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->step_position !== $v || $v === 0) {
+ $this->step_position = $v;
+ $this->modifiedColumns[] = StepSupervisorPeer::STEP_POSITION;
+ }
+
+ } // setStepPosition()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->step_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->step_type_obj = $rs->getString($startcol + 2);
+
+ $this->step_uid_obj = $rs->getString($startcol + 3);
+
+ $this->step_position = $rs->getInt($startcol + 4);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = StepSupervisorPeer::NUM_COLUMNS - StepSupervisorPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating StepSupervisor object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StepSupervisorPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ StepSupervisorPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StepSupervisorPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = StepSupervisorPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += StepSupervisorPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = StepSupervisorPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StepSupervisorPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getStepUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getStepTypeObj();
+ break;
+ case 3:
+ return $this->getStepUidObj();
+ break;
+ case 4:
+ return $this->getStepPosition();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StepSupervisorPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getStepUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getStepTypeObj(),
+ $keys[3] => $this->getStepUidObj(),
+ $keys[4] => $this->getStepPosition(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StepSupervisorPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setStepUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setStepTypeObj($value);
+ break;
+ case 3:
+ $this->setStepUidObj($value);
+ break;
+ case 4:
+ $this->setStepPosition($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StepSupervisorPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setStepUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setStepTypeObj($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setStepUidObj($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setStepPosition($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(StepSupervisorPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(StepSupervisorPeer::STEP_UID)) {
+ $criteria->add(StepSupervisorPeer::STEP_UID, $this->step_uid);
+ }
+
+ if ($this->isColumnModified(StepSupervisorPeer::PRO_UID)) {
+ $criteria->add(StepSupervisorPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(StepSupervisorPeer::STEP_TYPE_OBJ)) {
+ $criteria->add(StepSupervisorPeer::STEP_TYPE_OBJ, $this->step_type_obj);
+ }
+
+ if ($this->isColumnModified(StepSupervisorPeer::STEP_UID_OBJ)) {
+ $criteria->add(StepSupervisorPeer::STEP_UID_OBJ, $this->step_uid_obj);
+ }
+
+ if ($this->isColumnModified(StepSupervisorPeer::STEP_POSITION)) {
+ $criteria->add(StepSupervisorPeer::STEP_POSITION, $this->step_position);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(StepSupervisorPeer::DATABASE_NAME);
+
+ $criteria->add(StepSupervisorPeer::STEP_UID, $this->step_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getStepUid();
+ }
+
+ /**
+ * Generic method to set the primary key (step_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setStepUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of StepSupervisor (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setStepTypeObj($this->step_type_obj);
+
+ $copyObj->setStepUidObj($this->step_uid_obj);
+
+ $copyObj->setStepPosition($this->step_position);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setStepUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return StepSupervisor Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return StepSupervisorPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new StepSupervisorPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseStepSupervisorPeer.php b/workflow/engine/classes/model/om/BaseStepSupervisorPeer.php
index 7ef409919..ea618ab59 100755
--- a/workflow/engine/classes/model/om/BaseStepSupervisorPeer.php
+++ b/workflow/engine/classes/model/om/BaseStepSupervisorPeer.php
@@ -12,577 +12,579 @@ include_once 'classes/model/StepSupervisor.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStepSupervisorPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'STEP_SUPERVISOR';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.StepSupervisor';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the STEP_UID field */
- const STEP_UID = 'STEP_SUPERVISOR.STEP_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'STEP_SUPERVISOR.PRO_UID';
-
- /** the column name for the STEP_TYPE_OBJ field */
- const STEP_TYPE_OBJ = 'STEP_SUPERVISOR.STEP_TYPE_OBJ';
-
- /** the column name for the STEP_UID_OBJ field */
- const STEP_UID_OBJ = 'STEP_SUPERVISOR.STEP_UID_OBJ';
-
- /** the column name for the STEP_POSITION field */
- const STEP_POSITION = 'STEP_SUPERVISOR.STEP_POSITION';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('StepUid', 'ProUid', 'StepTypeObj', 'StepUidObj', 'StepPosition', ),
- BasePeer::TYPE_COLNAME => array (StepSupervisorPeer::STEP_UID, StepSupervisorPeer::PRO_UID, StepSupervisorPeer::STEP_TYPE_OBJ, StepSupervisorPeer::STEP_UID_OBJ, StepSupervisorPeer::STEP_POSITION, ),
- BasePeer::TYPE_FIELDNAME => array ('STEP_UID', 'PRO_UID', 'STEP_TYPE_OBJ', 'STEP_UID_OBJ', 'STEP_POSITION', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('StepUid' => 0, 'ProUid' => 1, 'StepTypeObj' => 2, 'StepUidObj' => 3, 'StepPosition' => 4, ),
- BasePeer::TYPE_COLNAME => array (StepSupervisorPeer::STEP_UID => 0, StepSupervisorPeer::PRO_UID => 1, StepSupervisorPeer::STEP_TYPE_OBJ => 2, StepSupervisorPeer::STEP_UID_OBJ => 3, StepSupervisorPeer::STEP_POSITION => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('STEP_UID' => 0, 'PRO_UID' => 1, 'STEP_TYPE_OBJ' => 2, 'STEP_UID_OBJ' => 3, 'STEP_POSITION' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/StepSupervisorMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.StepSupervisorMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = StepSupervisorPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. StepSupervisorPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(StepSupervisorPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(StepSupervisorPeer::STEP_UID);
-
- $criteria->addSelectColumn(StepSupervisorPeer::PRO_UID);
-
- $criteria->addSelectColumn(StepSupervisorPeer::STEP_TYPE_OBJ);
-
- $criteria->addSelectColumn(StepSupervisorPeer::STEP_UID_OBJ);
-
- $criteria->addSelectColumn(StepSupervisorPeer::STEP_POSITION);
-
- }
-
- const COUNT = 'COUNT(STEP_SUPERVISOR.STEP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT STEP_SUPERVISOR.STEP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(StepSupervisorPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(StepSupervisorPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = StepSupervisorPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return StepSupervisor
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = StepSupervisorPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return StepSupervisorPeer::populateObjects(StepSupervisorPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- StepSupervisorPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = StepSupervisorPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return StepSupervisorPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a StepSupervisor or Criteria object.
- *
- * @param mixed $values Criteria or StepSupervisor object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from StepSupervisor object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a StepSupervisor or Criteria object.
- *
- * @param mixed $values Criteria or StepSupervisor object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(StepSupervisorPeer::STEP_UID);
- $selectCriteria->add(StepSupervisorPeer::STEP_UID, $criteria->remove(StepSupervisorPeer::STEP_UID), $comparison);
-
- } else { // $values is StepSupervisor object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the STEP_SUPERVISOR table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(StepSupervisorPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a StepSupervisor or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or StepSupervisor object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(StepSupervisorPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof StepSupervisor) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(StepSupervisorPeer::STEP_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given StepSupervisor object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param StepSupervisor $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(StepSupervisor $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(StepSupervisorPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(StepSupervisorPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(StepSupervisorPeer::STEP_TYPE_OBJ))
- $columns[StepSupervisorPeer::STEP_TYPE_OBJ] = $obj->getStepTypeObj();
-
- }
-
- return BasePeer::doValidate(StepSupervisorPeer::DATABASE_NAME, StepSupervisorPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return StepSupervisor
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(StepSupervisorPeer::DATABASE_NAME);
-
- $criteria->add(StepSupervisorPeer::STEP_UID, $pk);
-
-
- $v = StepSupervisorPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(StepSupervisorPeer::STEP_UID, $pks, Criteria::IN);
- $objs = StepSupervisorPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseStepSupervisorPeer
+abstract class BaseStepSupervisorPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'STEP_SUPERVISOR';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.StepSupervisor';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the STEP_UID field */
+ const STEP_UID = 'STEP_SUPERVISOR.STEP_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'STEP_SUPERVISOR.PRO_UID';
+
+ /** the column name for the STEP_TYPE_OBJ field */
+ const STEP_TYPE_OBJ = 'STEP_SUPERVISOR.STEP_TYPE_OBJ';
+
+ /** the column name for the STEP_UID_OBJ field */
+ const STEP_UID_OBJ = 'STEP_SUPERVISOR.STEP_UID_OBJ';
+
+ /** the column name for the STEP_POSITION field */
+ const STEP_POSITION = 'STEP_SUPERVISOR.STEP_POSITION';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('StepUid', 'ProUid', 'StepTypeObj', 'StepUidObj', 'StepPosition', ),
+ BasePeer::TYPE_COLNAME => array (StepSupervisorPeer::STEP_UID, StepSupervisorPeer::PRO_UID, StepSupervisorPeer::STEP_TYPE_OBJ, StepSupervisorPeer::STEP_UID_OBJ, StepSupervisorPeer::STEP_POSITION, ),
+ BasePeer::TYPE_FIELDNAME => array ('STEP_UID', 'PRO_UID', 'STEP_TYPE_OBJ', 'STEP_UID_OBJ', 'STEP_POSITION', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('StepUid' => 0, 'ProUid' => 1, 'StepTypeObj' => 2, 'StepUidObj' => 3, 'StepPosition' => 4, ),
+ BasePeer::TYPE_COLNAME => array (StepSupervisorPeer::STEP_UID => 0, StepSupervisorPeer::PRO_UID => 1, StepSupervisorPeer::STEP_TYPE_OBJ => 2, StepSupervisorPeer::STEP_UID_OBJ => 3, StepSupervisorPeer::STEP_POSITION => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('STEP_UID' => 0, 'PRO_UID' => 1, 'STEP_TYPE_OBJ' => 2, 'STEP_UID_OBJ' => 3, 'STEP_POSITION' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/StepSupervisorMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.StepSupervisorMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = StepSupervisorPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. StepSupervisorPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(StepSupervisorPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(StepSupervisorPeer::STEP_UID);
+
+ $criteria->addSelectColumn(StepSupervisorPeer::PRO_UID);
+
+ $criteria->addSelectColumn(StepSupervisorPeer::STEP_TYPE_OBJ);
+
+ $criteria->addSelectColumn(StepSupervisorPeer::STEP_UID_OBJ);
+
+ $criteria->addSelectColumn(StepSupervisorPeer::STEP_POSITION);
+
+ }
+
+ const COUNT = 'COUNT(STEP_SUPERVISOR.STEP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT STEP_SUPERVISOR.STEP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(StepSupervisorPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(StepSupervisorPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = StepSupervisorPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return StepSupervisor
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = StepSupervisorPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return StepSupervisorPeer::populateObjects(StepSupervisorPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ StepSupervisorPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = StepSupervisorPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return StepSupervisorPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a StepSupervisor or Criteria object.
+ *
+ * @param mixed $values Criteria or StepSupervisor object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from StepSupervisor object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a StepSupervisor or Criteria object.
+ *
+ * @param mixed $values Criteria or StepSupervisor object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(StepSupervisorPeer::STEP_UID);
+ $selectCriteria->add(StepSupervisorPeer::STEP_UID, $criteria->remove(StepSupervisorPeer::STEP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the STEP_SUPERVISOR table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(StepSupervisorPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a StepSupervisor or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or StepSupervisor object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(StepSupervisorPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof StepSupervisor) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(StepSupervisorPeer::STEP_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given StepSupervisor object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param StepSupervisor $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(StepSupervisor $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(StepSupervisorPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(StepSupervisorPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(StepSupervisorPeer::STEP_TYPE_OBJ))
+ $columns[StepSupervisorPeer::STEP_TYPE_OBJ] = $obj->getStepTypeObj();
+
+ }
+
+ return BasePeer::doValidate(StepSupervisorPeer::DATABASE_NAME, StepSupervisorPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return StepSupervisor
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(StepSupervisorPeer::DATABASE_NAME);
+
+ $criteria->add(StepSupervisorPeer::STEP_UID, $pk);
+
+
+ $v = StepSupervisorPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(StepSupervisorPeer::STEP_UID, $pks, Criteria::IN);
+ $objs = StepSupervisorPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseStepSupervisorPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseStepSupervisorPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/StepSupervisorMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.StepSupervisorMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/StepSupervisorMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.StepSupervisorMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseStepTrigger.php b/workflow/engine/classes/model/om/BaseStepTrigger.php
index 1d27e3dbd..52e62f2dd 100755
--- a/workflow/engine/classes/model/om/BaseStepTrigger.php
+++ b/workflow/engine/classes/model/om/BaseStepTrigger.php
@@ -16,776 +16,807 @@ include_once 'classes/model/StepTriggerPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStepTrigger extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var StepTriggerPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the step_uid field.
- * @var string
- */
- protected $step_uid = '';
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
-
-
- /**
- * The value for the tri_uid field.
- * @var string
- */
- protected $tri_uid = '';
-
-
- /**
- * The value for the st_type field.
- * @var string
- */
- protected $st_type = '';
-
-
- /**
- * The value for the st_condition field.
- * @var string
- */
- protected $st_condition = '';
-
-
- /**
- * The value for the st_position field.
- * @var int
- */
- protected $st_position = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [step_uid] column value.
- *
- * @return string
- */
- public function getStepUid()
- {
-
- return $this->step_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [tri_uid] column value.
- *
- * @return string
- */
- public function getTriUid()
- {
-
- return $this->tri_uid;
- }
-
- /**
- * Get the [st_type] column value.
- *
- * @return string
- */
- public function getStType()
- {
-
- return $this->st_type;
- }
-
- /**
- * Get the [st_condition] column value.
- *
- * @return string
- */
- public function getStCondition()
- {
-
- return $this->st_condition;
- }
-
- /**
- * Get the [st_position] column value.
- *
- * @return int
- */
- public function getStPosition()
- {
-
- return $this->st_position;
- }
-
- /**
- * Set the value of [step_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStepUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->step_uid !== $v || $v === '') {
- $this->step_uid = $v;
- $this->modifiedColumns[] = StepTriggerPeer::STEP_UID;
- }
-
- } // setStepUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = StepTriggerPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [tri_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTriUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tri_uid !== $v || $v === '') {
- $this->tri_uid = $v;
- $this->modifiedColumns[] = StepTriggerPeer::TRI_UID;
- }
-
- } // setTriUid()
-
- /**
- * Set the value of [st_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->st_type !== $v || $v === '') {
- $this->st_type = $v;
- $this->modifiedColumns[] = StepTriggerPeer::ST_TYPE;
- }
-
- } // setStType()
-
- /**
- * Set the value of [st_condition] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStCondition($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->st_condition !== $v || $v === '') {
- $this->st_condition = $v;
- $this->modifiedColumns[] = StepTriggerPeer::ST_CONDITION;
- }
-
- } // setStCondition()
-
- /**
- * Set the value of [st_position] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setStPosition($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->st_position !== $v || $v === 0) {
- $this->st_position = $v;
- $this->modifiedColumns[] = StepTriggerPeer::ST_POSITION;
- }
-
- } // setStPosition()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->step_uid = $rs->getString($startcol + 0);
-
- $this->tas_uid = $rs->getString($startcol + 1);
-
- $this->tri_uid = $rs->getString($startcol + 2);
-
- $this->st_type = $rs->getString($startcol + 3);
-
- $this->st_condition = $rs->getString($startcol + 4);
-
- $this->st_position = $rs->getInt($startcol + 5);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 6; // 6 = StepTriggerPeer::NUM_COLUMNS - StepTriggerPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating StepTrigger object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- StepTriggerPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = StepTriggerPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += StepTriggerPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = StepTriggerPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StepTriggerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getStepUid();
- break;
- case 1:
- return $this->getTasUid();
- break;
- case 2:
- return $this->getTriUid();
- break;
- case 3:
- return $this->getStType();
- break;
- case 4:
- return $this->getStCondition();
- break;
- case 5:
- return $this->getStPosition();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StepTriggerPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getStepUid(),
- $keys[1] => $this->getTasUid(),
- $keys[2] => $this->getTriUid(),
- $keys[3] => $this->getStType(),
- $keys[4] => $this->getStCondition(),
- $keys[5] => $this->getStPosition(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = StepTriggerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setStepUid($value);
- break;
- case 1:
- $this->setTasUid($value);
- break;
- case 2:
- $this->setTriUid($value);
- break;
- case 3:
- $this->setStType($value);
- break;
- case 4:
- $this->setStCondition($value);
- break;
- case 5:
- $this->setStPosition($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = StepTriggerPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setStepUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setTasUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTriUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setStType($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setStCondition($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setStPosition($arr[$keys[5]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(StepTriggerPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(StepTriggerPeer::STEP_UID)) $criteria->add(StepTriggerPeer::STEP_UID, $this->step_uid);
- if ($this->isColumnModified(StepTriggerPeer::TAS_UID)) $criteria->add(StepTriggerPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(StepTriggerPeer::TRI_UID)) $criteria->add(StepTriggerPeer::TRI_UID, $this->tri_uid);
- if ($this->isColumnModified(StepTriggerPeer::ST_TYPE)) $criteria->add(StepTriggerPeer::ST_TYPE, $this->st_type);
- if ($this->isColumnModified(StepTriggerPeer::ST_CONDITION)) $criteria->add(StepTriggerPeer::ST_CONDITION, $this->st_condition);
- if ($this->isColumnModified(StepTriggerPeer::ST_POSITION)) $criteria->add(StepTriggerPeer::ST_POSITION, $this->st_position);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(StepTriggerPeer::DATABASE_NAME);
-
- $criteria->add(StepTriggerPeer::STEP_UID, $this->step_uid);
- $criteria->add(StepTriggerPeer::TAS_UID, $this->tas_uid);
- $criteria->add(StepTriggerPeer::TRI_UID, $this->tri_uid);
- $criteria->add(StepTriggerPeer::ST_TYPE, $this->st_type);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getStepUid();
-
- $pks[1] = $this->getTasUid();
-
- $pks[2] = $this->getTriUid();
-
- $pks[3] = $this->getStType();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setStepUid($keys[0]);
-
- $this->setTasUid($keys[1]);
-
- $this->setTriUid($keys[2]);
-
- $this->setStType($keys[3]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of StepTrigger (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setStCondition($this->st_condition);
-
- $copyObj->setStPosition($this->st_position);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setStepUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setTasUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setTriUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setStType(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return StepTrigger Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return StepTriggerPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new StepTriggerPeer();
- }
- return self::$peer;
- }
-
-} // BaseStepTrigger
+abstract class BaseStepTrigger extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var StepTriggerPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the step_uid field.
+ * @var string
+ */
+ protected $step_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the tri_uid field.
+ * @var string
+ */
+ protected $tri_uid = '';
+
+ /**
+ * The value for the st_type field.
+ * @var string
+ */
+ protected $st_type = '';
+
+ /**
+ * The value for the st_condition field.
+ * @var string
+ */
+ protected $st_condition = '';
+
+ /**
+ * The value for the st_position field.
+ * @var int
+ */
+ protected $st_position = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [step_uid] column value.
+ *
+ * @return string
+ */
+ public function getStepUid()
+ {
+
+ return $this->step_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [tri_uid] column value.
+ *
+ * @return string
+ */
+ public function getTriUid()
+ {
+
+ return $this->tri_uid;
+ }
+
+ /**
+ * Get the [st_type] column value.
+ *
+ * @return string
+ */
+ public function getStType()
+ {
+
+ return $this->st_type;
+ }
+
+ /**
+ * Get the [st_condition] column value.
+ *
+ * @return string
+ */
+ public function getStCondition()
+ {
+
+ return $this->st_condition;
+ }
+
+ /**
+ * Get the [st_position] column value.
+ *
+ * @return int
+ */
+ public function getStPosition()
+ {
+
+ return $this->st_position;
+ }
+
+ /**
+ * Set the value of [step_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStepUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->step_uid !== $v || $v === '') {
+ $this->step_uid = $v;
+ $this->modifiedColumns[] = StepTriggerPeer::STEP_UID;
+ }
+
+ } // setStepUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = StepTriggerPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [tri_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTriUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tri_uid !== $v || $v === '') {
+ $this->tri_uid = $v;
+ $this->modifiedColumns[] = StepTriggerPeer::TRI_UID;
+ }
+
+ } // setTriUid()
+
+ /**
+ * Set the value of [st_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->st_type !== $v || $v === '') {
+ $this->st_type = $v;
+ $this->modifiedColumns[] = StepTriggerPeer::ST_TYPE;
+ }
+
+ } // setStType()
+
+ /**
+ * Set the value of [st_condition] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStCondition($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->st_condition !== $v || $v === '') {
+ $this->st_condition = $v;
+ $this->modifiedColumns[] = StepTriggerPeer::ST_CONDITION;
+ }
+
+ } // setStCondition()
+
+ /**
+ * Set the value of [st_position] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setStPosition($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->st_position !== $v || $v === 0) {
+ $this->st_position = $v;
+ $this->modifiedColumns[] = StepTriggerPeer::ST_POSITION;
+ }
+
+ } // setStPosition()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->step_uid = $rs->getString($startcol + 0);
+
+ $this->tas_uid = $rs->getString($startcol + 1);
+
+ $this->tri_uid = $rs->getString($startcol + 2);
+
+ $this->st_type = $rs->getString($startcol + 3);
+
+ $this->st_condition = $rs->getString($startcol + 4);
+
+ $this->st_position = $rs->getInt($startcol + 5);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 6; // 6 = StepTriggerPeer::NUM_COLUMNS - StepTriggerPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating StepTrigger object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ StepTriggerPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = StepTriggerPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += StepTriggerPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = StepTriggerPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StepTriggerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getStepUid();
+ break;
+ case 1:
+ return $this->getTasUid();
+ break;
+ case 2:
+ return $this->getTriUid();
+ break;
+ case 3:
+ return $this->getStType();
+ break;
+ case 4:
+ return $this->getStCondition();
+ break;
+ case 5:
+ return $this->getStPosition();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StepTriggerPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getStepUid(),
+ $keys[1] => $this->getTasUid(),
+ $keys[2] => $this->getTriUid(),
+ $keys[3] => $this->getStType(),
+ $keys[4] => $this->getStCondition(),
+ $keys[5] => $this->getStPosition(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = StepTriggerPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setStepUid($value);
+ break;
+ case 1:
+ $this->setTasUid($value);
+ break;
+ case 2:
+ $this->setTriUid($value);
+ break;
+ case 3:
+ $this->setStType($value);
+ break;
+ case 4:
+ $this->setStCondition($value);
+ break;
+ case 5:
+ $this->setStPosition($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = StepTriggerPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setStepUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setTasUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTriUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setStType($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setStCondition($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setStPosition($arr[$keys[5]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(StepTriggerPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(StepTriggerPeer::STEP_UID)) {
+ $criteria->add(StepTriggerPeer::STEP_UID, $this->step_uid);
+ }
+
+ if ($this->isColumnModified(StepTriggerPeer::TAS_UID)) {
+ $criteria->add(StepTriggerPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(StepTriggerPeer::TRI_UID)) {
+ $criteria->add(StepTriggerPeer::TRI_UID, $this->tri_uid);
+ }
+
+ if ($this->isColumnModified(StepTriggerPeer::ST_TYPE)) {
+ $criteria->add(StepTriggerPeer::ST_TYPE, $this->st_type);
+ }
+
+ if ($this->isColumnModified(StepTriggerPeer::ST_CONDITION)) {
+ $criteria->add(StepTriggerPeer::ST_CONDITION, $this->st_condition);
+ }
+
+ if ($this->isColumnModified(StepTriggerPeer::ST_POSITION)) {
+ $criteria->add(StepTriggerPeer::ST_POSITION, $this->st_position);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(StepTriggerPeer::DATABASE_NAME);
+
+ $criteria->add(StepTriggerPeer::STEP_UID, $this->step_uid);
+ $criteria->add(StepTriggerPeer::TAS_UID, $this->tas_uid);
+ $criteria->add(StepTriggerPeer::TRI_UID, $this->tri_uid);
+ $criteria->add(StepTriggerPeer::ST_TYPE, $this->st_type);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getStepUid();
+
+ $pks[1] = $this->getTasUid();
+
+ $pks[2] = $this->getTriUid();
+
+ $pks[3] = $this->getStType();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setStepUid($keys[0]);
+
+ $this->setTasUid($keys[1]);
+
+ $this->setTriUid($keys[2]);
+
+ $this->setStType($keys[3]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of StepTrigger (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setStCondition($this->st_condition);
+
+ $copyObj->setStPosition($this->st_position);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setStepUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setTasUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setTriUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setStType(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return StepTrigger Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return StepTriggerPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new StepTriggerPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseStepTriggerPeer.php b/workflow/engine/classes/model/om/BaseStepTriggerPeer.php
index ec18d348a..ef15a5c4b 100755
--- a/workflow/engine/classes/model/om/BaseStepTriggerPeer.php
+++ b/workflow/engine/classes/model/om/BaseStepTriggerPeer.php
@@ -12,587 +12,588 @@ include_once 'classes/model/StepTrigger.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseStepTriggerPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'STEP_TRIGGER';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.StepTrigger';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 6;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the STEP_UID field */
- const STEP_UID = 'STEP_TRIGGER.STEP_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'STEP_TRIGGER.TAS_UID';
-
- /** the column name for the TRI_UID field */
- const TRI_UID = 'STEP_TRIGGER.TRI_UID';
-
- /** the column name for the ST_TYPE field */
- const ST_TYPE = 'STEP_TRIGGER.ST_TYPE';
-
- /** the column name for the ST_CONDITION field */
- const ST_CONDITION = 'STEP_TRIGGER.ST_CONDITION';
-
- /** the column name for the ST_POSITION field */
- const ST_POSITION = 'STEP_TRIGGER.ST_POSITION';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('StepUid', 'TasUid', 'TriUid', 'StType', 'StCondition', 'StPosition', ),
- BasePeer::TYPE_COLNAME => array (StepTriggerPeer::STEP_UID, StepTriggerPeer::TAS_UID, StepTriggerPeer::TRI_UID, StepTriggerPeer::ST_TYPE, StepTriggerPeer::ST_CONDITION, StepTriggerPeer::ST_POSITION, ),
- BasePeer::TYPE_FIELDNAME => array ('STEP_UID', 'TAS_UID', 'TRI_UID', 'ST_TYPE', 'ST_CONDITION', 'ST_POSITION', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('StepUid' => 0, 'TasUid' => 1, 'TriUid' => 2, 'StType' => 3, 'StCondition' => 4, 'StPosition' => 5, ),
- BasePeer::TYPE_COLNAME => array (StepTriggerPeer::STEP_UID => 0, StepTriggerPeer::TAS_UID => 1, StepTriggerPeer::TRI_UID => 2, StepTriggerPeer::ST_TYPE => 3, StepTriggerPeer::ST_CONDITION => 4, StepTriggerPeer::ST_POSITION => 5, ),
- BasePeer::TYPE_FIELDNAME => array ('STEP_UID' => 0, 'TAS_UID' => 1, 'TRI_UID' => 2, 'ST_TYPE' => 3, 'ST_CONDITION' => 4, 'ST_POSITION' => 5, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/StepTriggerMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.StepTriggerMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = StepTriggerPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. StepTriggerPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(StepTriggerPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(StepTriggerPeer::STEP_UID);
-
- $criteria->addSelectColumn(StepTriggerPeer::TAS_UID);
-
- $criteria->addSelectColumn(StepTriggerPeer::TRI_UID);
-
- $criteria->addSelectColumn(StepTriggerPeer::ST_TYPE);
-
- $criteria->addSelectColumn(StepTriggerPeer::ST_CONDITION);
-
- $criteria->addSelectColumn(StepTriggerPeer::ST_POSITION);
-
- }
-
- const COUNT = 'COUNT(STEP_TRIGGER.STEP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT STEP_TRIGGER.STEP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(StepTriggerPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(StepTriggerPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = StepTriggerPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return StepTrigger
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = StepTriggerPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return StepTriggerPeer::populateObjects(StepTriggerPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- StepTriggerPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = StepTriggerPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return StepTriggerPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a StepTrigger or Criteria object.
- *
- * @param mixed $values Criteria or StepTrigger object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from StepTrigger object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a StepTrigger or Criteria object.
- *
- * @param mixed $values Criteria or StepTrigger object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(StepTriggerPeer::STEP_UID);
- $selectCriteria->add(StepTriggerPeer::STEP_UID, $criteria->remove(StepTriggerPeer::STEP_UID), $comparison);
-
- $comparison = $criteria->getComparison(StepTriggerPeer::TAS_UID);
- $selectCriteria->add(StepTriggerPeer::TAS_UID, $criteria->remove(StepTriggerPeer::TAS_UID), $comparison);
-
- $comparison = $criteria->getComparison(StepTriggerPeer::TRI_UID);
- $selectCriteria->add(StepTriggerPeer::TRI_UID, $criteria->remove(StepTriggerPeer::TRI_UID), $comparison);
-
- $comparison = $criteria->getComparison(StepTriggerPeer::ST_TYPE);
- $selectCriteria->add(StepTriggerPeer::ST_TYPE, $criteria->remove(StepTriggerPeer::ST_TYPE), $comparison);
-
- } else { // $values is StepTrigger object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the STEP_TRIGGER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(StepTriggerPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a StepTrigger or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or StepTrigger object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof StepTrigger) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- $vals[3][] = $value[3];
- }
-
- $criteria->add(StepTriggerPeer::STEP_UID, $vals[0], Criteria::IN);
- $criteria->add(StepTriggerPeer::TAS_UID, $vals[1], Criteria::IN);
- $criteria->add(StepTriggerPeer::TRI_UID, $vals[2], Criteria::IN);
- $criteria->add(StepTriggerPeer::ST_TYPE, $vals[3], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given StepTrigger object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param StepTrigger $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(StepTrigger $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(StepTriggerPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(StepTriggerPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(StepTriggerPeer::ST_TYPE))
- $columns[StepTriggerPeer::ST_TYPE] = $obj->getStType();
-
- }
-
- return BasePeer::doValidate(StepTriggerPeer::DATABASE_NAME, StepTriggerPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $step_uid
- @param string $tas_uid
- @param string $tri_uid
- @param string $st_type
-
- * @param Connection $con
- * @return StepTrigger
- */
- public static function retrieveByPK( $step_uid, $tas_uid, $tri_uid, $st_type, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(StepTriggerPeer::STEP_UID, $step_uid);
- $criteria->add(StepTriggerPeer::TAS_UID, $tas_uid);
- $criteria->add(StepTriggerPeer::TRI_UID, $tri_uid);
- $criteria->add(StepTriggerPeer::ST_TYPE, $st_type);
- $v = StepTriggerPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseStepTriggerPeer
+abstract class BaseStepTriggerPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'STEP_TRIGGER';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.StepTrigger';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 6;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the STEP_UID field */
+ const STEP_UID = 'STEP_TRIGGER.STEP_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'STEP_TRIGGER.TAS_UID';
+
+ /** the column name for the TRI_UID field */
+ const TRI_UID = 'STEP_TRIGGER.TRI_UID';
+
+ /** the column name for the ST_TYPE field */
+ const ST_TYPE = 'STEP_TRIGGER.ST_TYPE';
+
+ /** the column name for the ST_CONDITION field */
+ const ST_CONDITION = 'STEP_TRIGGER.ST_CONDITION';
+
+ /** the column name for the ST_POSITION field */
+ const ST_POSITION = 'STEP_TRIGGER.ST_POSITION';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('StepUid', 'TasUid', 'TriUid', 'StType', 'StCondition', 'StPosition', ),
+ BasePeer::TYPE_COLNAME => array (StepTriggerPeer::STEP_UID, StepTriggerPeer::TAS_UID, StepTriggerPeer::TRI_UID, StepTriggerPeer::ST_TYPE, StepTriggerPeer::ST_CONDITION, StepTriggerPeer::ST_POSITION, ),
+ BasePeer::TYPE_FIELDNAME => array ('STEP_UID', 'TAS_UID', 'TRI_UID', 'ST_TYPE', 'ST_CONDITION', 'ST_POSITION', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('StepUid' => 0, 'TasUid' => 1, 'TriUid' => 2, 'StType' => 3, 'StCondition' => 4, 'StPosition' => 5, ),
+ BasePeer::TYPE_COLNAME => array (StepTriggerPeer::STEP_UID => 0, StepTriggerPeer::TAS_UID => 1, StepTriggerPeer::TRI_UID => 2, StepTriggerPeer::ST_TYPE => 3, StepTriggerPeer::ST_CONDITION => 4, StepTriggerPeer::ST_POSITION => 5, ),
+ BasePeer::TYPE_FIELDNAME => array ('STEP_UID' => 0, 'TAS_UID' => 1, 'TRI_UID' => 2, 'ST_TYPE' => 3, 'ST_CONDITION' => 4, 'ST_POSITION' => 5, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/StepTriggerMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.StepTriggerMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = StepTriggerPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. StepTriggerPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(StepTriggerPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(StepTriggerPeer::STEP_UID);
+
+ $criteria->addSelectColumn(StepTriggerPeer::TAS_UID);
+
+ $criteria->addSelectColumn(StepTriggerPeer::TRI_UID);
+
+ $criteria->addSelectColumn(StepTriggerPeer::ST_TYPE);
+
+ $criteria->addSelectColumn(StepTriggerPeer::ST_CONDITION);
+
+ $criteria->addSelectColumn(StepTriggerPeer::ST_POSITION);
+
+ }
+
+ const COUNT = 'COUNT(STEP_TRIGGER.STEP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT STEP_TRIGGER.STEP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(StepTriggerPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(StepTriggerPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = StepTriggerPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return StepTrigger
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = StepTriggerPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return StepTriggerPeer::populateObjects(StepTriggerPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ StepTriggerPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = StepTriggerPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return StepTriggerPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a StepTrigger or Criteria object.
+ *
+ * @param mixed $values Criteria or StepTrigger object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from StepTrigger object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a StepTrigger or Criteria object.
+ *
+ * @param mixed $values Criteria or StepTrigger object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(StepTriggerPeer::STEP_UID);
+ $selectCriteria->add(StepTriggerPeer::STEP_UID, $criteria->remove(StepTriggerPeer::STEP_UID), $comparison);
+
+ $comparison = $criteria->getComparison(StepTriggerPeer::TAS_UID);
+ $selectCriteria->add(StepTriggerPeer::TAS_UID, $criteria->remove(StepTriggerPeer::TAS_UID), $comparison);
+
+ $comparison = $criteria->getComparison(StepTriggerPeer::TRI_UID);
+ $selectCriteria->add(StepTriggerPeer::TRI_UID, $criteria->remove(StepTriggerPeer::TRI_UID), $comparison);
+
+ $comparison = $criteria->getComparison(StepTriggerPeer::ST_TYPE);
+ $selectCriteria->add(StepTriggerPeer::ST_TYPE, $criteria->remove(StepTriggerPeer::ST_TYPE), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the STEP_TRIGGER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(StepTriggerPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a StepTrigger or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or StepTrigger object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof StepTrigger) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ $vals[3][] = $value[3];
+ }
+
+ $criteria->add(StepTriggerPeer::STEP_UID, $vals[0], Criteria::IN);
+ $criteria->add(StepTriggerPeer::TAS_UID, $vals[1], Criteria::IN);
+ $criteria->add(StepTriggerPeer::TRI_UID, $vals[2], Criteria::IN);
+ $criteria->add(StepTriggerPeer::ST_TYPE, $vals[3], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given StepTrigger object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param StepTrigger $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(StepTrigger $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(StepTriggerPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(StepTriggerPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(StepTriggerPeer::ST_TYPE))
+ $columns[StepTriggerPeer::ST_TYPE] = $obj->getStType();
+
+ }
+
+ return BasePeer::doValidate(StepTriggerPeer::DATABASE_NAME, StepTriggerPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $step_uid
+ * @param string $tas_uid
+ * @param string $tri_uid
+ * @param string $st_type
+ * @param Connection $con
+ * @return StepTrigger
+ */
+ public static function retrieveByPK($step_uid, $tas_uid, $tri_uid, $st_type, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(StepTriggerPeer::STEP_UID, $step_uid);
+ $criteria->add(StepTriggerPeer::TAS_UID, $tas_uid);
+ $criteria->add(StepTriggerPeer::TRI_UID, $tri_uid);
+ $criteria->add(StepTriggerPeer::ST_TYPE, $st_type);
+ $v = StepTriggerPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseStepTriggerPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseStepTriggerPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/StepTriggerMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.StepTriggerMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/StepTriggerMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.StepTriggerMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseSubApplication.php b/workflow/engine/classes/model/om/BaseSubApplication.php
index 8d625bb1e..0aba2785a 100755
--- a/workflow/engine/classes/model/om/BaseSubApplication.php
+++ b/workflow/engine/classes/model/om/BaseSubApplication.php
@@ -16,979 +16,1029 @@ include_once 'classes/model/SubApplicationPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSubApplication extends BaseObject implements Persistent {
+abstract class BaseSubApplication extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var SubApplicationPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the app_uid field.
+ * @var string
+ */
+ protected $app_uid = '';
+
+ /**
+ * The value for the app_parent field.
+ * @var string
+ */
+ protected $app_parent = '';
+
+ /**
+ * The value for the del_index_parent field.
+ * @var int
+ */
+ protected $del_index_parent = 0;
+
+ /**
+ * The value for the del_thread_parent field.
+ * @var int
+ */
+ protected $del_thread_parent = 0;
+
+ /**
+ * The value for the sa_status field.
+ * @var string
+ */
+ protected $sa_status = '';
+
+ /**
+ * The value for the sa_values_out field.
+ * @var string
+ */
+ protected $sa_values_out;
+
+ /**
+ * The value for the sa_values_in field.
+ * @var string
+ */
+ protected $sa_values_in;
+
+ /**
+ * The value for the sa_init_date field.
+ * @var int
+ */
+ protected $sa_init_date;
+
+ /**
+ * The value for the sa_finish_date field.
+ * @var int
+ */
+ protected $sa_finish_date;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [app_uid] column value.
+ *
+ * @return string
+ */
+ public function getAppUid()
+ {
+
+ return $this->app_uid;
+ }
+
+ /**
+ * Get the [app_parent] column value.
+ *
+ * @return string
+ */
+ public function getAppParent()
+ {
+
+ return $this->app_parent;
+ }
+
+ /**
+ * Get the [del_index_parent] column value.
+ *
+ * @return int
+ */
+ public function getDelIndexParent()
+ {
+
+ return $this->del_index_parent;
+ }
+
+ /**
+ * Get the [del_thread_parent] column value.
+ *
+ * @return int
+ */
+ public function getDelThreadParent()
+ {
+
+ return $this->del_thread_parent;
+ }
+
+ /**
+ * Get the [sa_status] column value.
+ *
+ * @return string
+ */
+ public function getSaStatus()
+ {
+
+ return $this->sa_status;
+ }
+
+ /**
+ * Get the [sa_values_out] column value.
+ *
+ * @return string
+ */
+ public function getSaValuesOut()
+ {
+
+ return $this->sa_values_out;
+ }
+
+ /**
+ * Get the [sa_values_in] column value.
+ *
+ * @return string
+ */
+ public function getSaValuesIn()
+ {
+
+ return $this->sa_values_in;
+ }
+
+ /**
+ * Get the [optionally formatted] [sa_init_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getSaInitDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->sa_init_date === null || $this->sa_init_date === '') {
+ return null;
+ } elseif (!is_int($this->sa_init_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->sa_init_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [sa_init_date] as date/time value: " .
+ var_export($this->sa_init_date, true));
+ }
+ } else {
+ $ts = $this->sa_init_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [sa_finish_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getSaFinishDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->sa_finish_date === null || $this->sa_finish_date === '') {
+ return null;
+ } elseif (!is_int($this->sa_finish_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->sa_finish_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [sa_finish_date] as date/time value: " .
+ var_export($this->sa_finish_date, true));
+ }
+ } else {
+ $ts = $this->sa_finish_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Set the value of [app_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_uid !== $v || $v === '') {
+ $this->app_uid = $v;
+ $this->modifiedColumns[] = SubApplicationPeer::APP_UID;
+ }
+
+ } // setAppUid()
+
+ /**
+ * Set the value of [app_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setAppParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->app_parent !== $v || $v === '') {
+ $this->app_parent = $v;
+ $this->modifiedColumns[] = SubApplicationPeer::APP_PARENT;
+ }
+
+ } // setAppParent()
+
+ /**
+ * Set the value of [del_index_parent] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelIndexParent($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->del_index_parent !== $v || $v === 0) {
+ $this->del_index_parent = $v;
+ $this->modifiedColumns[] = SubApplicationPeer::DEL_INDEX_PARENT;
+ }
+
+ } // setDelIndexParent()
+
+ /**
+ * Set the value of [del_thread_parent] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setDelThreadParent($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->del_thread_parent !== $v || $v === 0) {
+ $this->del_thread_parent = $v;
+ $this->modifiedColumns[] = SubApplicationPeer::DEL_THREAD_PARENT;
+ }
+
+ } // setDelThreadParent()
+
+ /**
+ * Set the value of [sa_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSaStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sa_status !== $v || $v === '') {
+ $this->sa_status = $v;
+ $this->modifiedColumns[] = SubApplicationPeer::SA_STATUS;
+ }
+
+ } // setSaStatus()
+
+ /**
+ * Set the value of [sa_values_out] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSaValuesOut($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sa_values_out !== $v) {
+ $this->sa_values_out = $v;
+ $this->modifiedColumns[] = SubApplicationPeer::SA_VALUES_OUT;
+ }
+
+ } // setSaValuesOut()
+
+ /**
+ * Set the value of [sa_values_in] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSaValuesIn($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sa_values_in !== $v) {
+ $this->sa_values_in = $v;
+ $this->modifiedColumns[] = SubApplicationPeer::SA_VALUES_IN;
+ }
+
+ } // setSaValuesIn()
+
+ /**
+ * Set the value of [sa_init_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSaInitDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [sa_init_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->sa_init_date !== $ts) {
+ $this->sa_init_date = $ts;
+ $this->modifiedColumns[] = SubApplicationPeer::SA_INIT_DATE;
+ }
+
+ } // setSaInitDate()
+
+ /**
+ * Set the value of [sa_finish_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSaFinishDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [sa_finish_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->sa_finish_date !== $ts) {
+ $this->sa_finish_date = $ts;
+ $this->modifiedColumns[] = SubApplicationPeer::SA_FINISH_DATE;
+ }
+
+ } // setSaFinishDate()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->app_uid = $rs->getString($startcol + 0);
+
+ $this->app_parent = $rs->getString($startcol + 1);
+
+ $this->del_index_parent = $rs->getInt($startcol + 2);
+
+ $this->del_thread_parent = $rs->getInt($startcol + 3);
+
+ $this->sa_status = $rs->getString($startcol + 4);
+
+ $this->sa_values_out = $rs->getString($startcol + 5);
+
+ $this->sa_values_in = $rs->getString($startcol + 6);
+
+ $this->sa_init_date = $rs->getTimestamp($startcol + 7, null);
+
+ $this->sa_finish_date = $rs->getTimestamp($startcol + 8, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 9; // 9 = SubApplicationPeer::NUM_COLUMNS - SubApplicationPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating SubApplication object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ SubApplicationPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = SubApplicationPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += SubApplicationPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = SubApplicationPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SubApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getAppUid();
+ break;
+ case 1:
+ return $this->getAppParent();
+ break;
+ case 2:
+ return $this->getDelIndexParent();
+ break;
+ case 3:
+ return $this->getDelThreadParent();
+ break;
+ case 4:
+ return $this->getSaStatus();
+ break;
+ case 5:
+ return $this->getSaValuesOut();
+ break;
+ case 6:
+ return $this->getSaValuesIn();
+ break;
+ case 7:
+ return $this->getSaInitDate();
+ break;
+ case 8:
+ return $this->getSaFinishDate();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SubApplicationPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getAppUid(),
+ $keys[1] => $this->getAppParent(),
+ $keys[2] => $this->getDelIndexParent(),
+ $keys[3] => $this->getDelThreadParent(),
+ $keys[4] => $this->getSaStatus(),
+ $keys[5] => $this->getSaValuesOut(),
+ $keys[6] => $this->getSaValuesIn(),
+ $keys[7] => $this->getSaInitDate(),
+ $keys[8] => $this->getSaFinishDate(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SubApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setAppUid($value);
+ break;
+ case 1:
+ $this->setAppParent($value);
+ break;
+ case 2:
+ $this->setDelIndexParent($value);
+ break;
+ case 3:
+ $this->setDelThreadParent($value);
+ break;
+ case 4:
+ $this->setSaStatus($value);
+ break;
+ case 5:
+ $this->setSaValuesOut($value);
+ break;
+ case 6:
+ $this->setSaValuesIn($value);
+ break;
+ case 7:
+ $this->setSaInitDate($value);
+ break;
+ case 8:
+ $this->setSaFinishDate($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SubApplicationPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setAppUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setAppParent($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setDelIndexParent($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setDelThreadParent($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setSaStatus($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setSaValuesOut($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setSaValuesIn($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setSaInitDate($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setSaFinishDate($arr[$keys[8]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SubApplicationPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(SubApplicationPeer::APP_UID)) {
+ $criteria->add(SubApplicationPeer::APP_UID, $this->app_uid);
+ }
+
+ if ($this->isColumnModified(SubApplicationPeer::APP_PARENT)) {
+ $criteria->add(SubApplicationPeer::APP_PARENT, $this->app_parent);
+ }
+
+ if ($this->isColumnModified(SubApplicationPeer::DEL_INDEX_PARENT)) {
+ $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $this->del_index_parent);
+ }
+
+ if ($this->isColumnModified(SubApplicationPeer::DEL_THREAD_PARENT)) {
+ $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $this->del_thread_parent);
+ }
+
+ if ($this->isColumnModified(SubApplicationPeer::SA_STATUS)) {
+ $criteria->add(SubApplicationPeer::SA_STATUS, $this->sa_status);
+ }
+
+ if ($this->isColumnModified(SubApplicationPeer::SA_VALUES_OUT)) {
+ $criteria->add(SubApplicationPeer::SA_VALUES_OUT, $this->sa_values_out);
+ }
+
+ if ($this->isColumnModified(SubApplicationPeer::SA_VALUES_IN)) {
+ $criteria->add(SubApplicationPeer::SA_VALUES_IN, $this->sa_values_in);
+ }
+
+ if ($this->isColumnModified(SubApplicationPeer::SA_INIT_DATE)) {
+ $criteria->add(SubApplicationPeer::SA_INIT_DATE, $this->sa_init_date);
+ }
+ if ($this->isColumnModified(SubApplicationPeer::SA_FINISH_DATE)) {
+ $criteria->add(SubApplicationPeer::SA_FINISH_DATE, $this->sa_finish_date);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var SubApplicationPeer
- */
- protected static $peer;
+ return $criteria;
+ }
- /**
- * The value for the app_uid field.
- * @var string
- */
- protected $app_uid = '';
-
-
- /**
- * The value for the app_parent field.
- * @var string
- */
- protected $app_parent = '';
-
-
- /**
- * The value for the del_index_parent field.
- * @var int
- */
- protected $del_index_parent = 0;
-
-
- /**
- * The value for the del_thread_parent field.
- * @var int
- */
- protected $del_thread_parent = 0;
-
-
- /**
- * The value for the sa_status field.
- * @var string
- */
- protected $sa_status = '';
-
-
- /**
- * The value for the sa_values_out field.
- * @var string
- */
- protected $sa_values_out;
-
-
- /**
- * The value for the sa_values_in field.
- * @var string
- */
- protected $sa_values_in;
-
-
- /**
- * The value for the sa_init_date field.
- * @var int
- */
- protected $sa_init_date;
-
-
- /**
- * The value for the sa_finish_date field.
- * @var int
- */
- protected $sa_finish_date;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [app_uid] column value.
- *
- * @return string
- */
- public function getAppUid()
- {
-
- return $this->app_uid;
- }
-
- /**
- * Get the [app_parent] column value.
- *
- * @return string
- */
- public function getAppParent()
- {
-
- return $this->app_parent;
- }
-
- /**
- * Get the [del_index_parent] column value.
- *
- * @return int
- */
- public function getDelIndexParent()
- {
-
- return $this->del_index_parent;
- }
-
- /**
- * Get the [del_thread_parent] column value.
- *
- * @return int
- */
- public function getDelThreadParent()
- {
-
- return $this->del_thread_parent;
- }
-
- /**
- * Get the [sa_status] column value.
- *
- * @return string
- */
- public function getSaStatus()
- {
-
- return $this->sa_status;
- }
-
- /**
- * Get the [sa_values_out] column value.
- *
- * @return string
- */
- public function getSaValuesOut()
- {
-
- return $this->sa_values_out;
- }
-
- /**
- * Get the [sa_values_in] column value.
- *
- * @return string
- */
- public function getSaValuesIn()
- {
-
- return $this->sa_values_in;
- }
-
- /**
- * Get the [optionally formatted] [sa_init_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getSaInitDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->sa_init_date === null || $this->sa_init_date === '') {
- return null;
- } elseif (!is_int($this->sa_init_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->sa_init_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [sa_init_date] as date/time value: " . var_export($this->sa_init_date, true));
- }
- } else {
- $ts = $this->sa_init_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [sa_finish_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getSaFinishDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->sa_finish_date === null || $this->sa_finish_date === '') {
- return null;
- } elseif (!is_int($this->sa_finish_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->sa_finish_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [sa_finish_date] as date/time value: " . var_export($this->sa_finish_date, true));
- }
- } else {
- $ts = $this->sa_finish_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [app_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_uid !== $v || $v === '') {
- $this->app_uid = $v;
- $this->modifiedColumns[] = SubApplicationPeer::APP_UID;
- }
-
- } // setAppUid()
-
- /**
- * Set the value of [app_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setAppParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->app_parent !== $v || $v === '') {
- $this->app_parent = $v;
- $this->modifiedColumns[] = SubApplicationPeer::APP_PARENT;
- }
-
- } // setAppParent()
-
- /**
- * Set the value of [del_index_parent] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelIndexParent($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->del_index_parent !== $v || $v === 0) {
- $this->del_index_parent = $v;
- $this->modifiedColumns[] = SubApplicationPeer::DEL_INDEX_PARENT;
- }
-
- } // setDelIndexParent()
-
- /**
- * Set the value of [del_thread_parent] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setDelThreadParent($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->del_thread_parent !== $v || $v === 0) {
- $this->del_thread_parent = $v;
- $this->modifiedColumns[] = SubApplicationPeer::DEL_THREAD_PARENT;
- }
-
- } // setDelThreadParent()
-
- /**
- * Set the value of [sa_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSaStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sa_status !== $v || $v === '') {
- $this->sa_status = $v;
- $this->modifiedColumns[] = SubApplicationPeer::SA_STATUS;
- }
-
- } // setSaStatus()
-
- /**
- * Set the value of [sa_values_out] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSaValuesOut($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sa_values_out !== $v) {
- $this->sa_values_out = $v;
- $this->modifiedColumns[] = SubApplicationPeer::SA_VALUES_OUT;
- }
-
- } // setSaValuesOut()
-
- /**
- * Set the value of [sa_values_in] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSaValuesIn($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sa_values_in !== $v) {
- $this->sa_values_in = $v;
- $this->modifiedColumns[] = SubApplicationPeer::SA_VALUES_IN;
- }
-
- } // setSaValuesIn()
-
- /**
- * Set the value of [sa_init_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSaInitDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [sa_init_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->sa_init_date !== $ts) {
- $this->sa_init_date = $ts;
- $this->modifiedColumns[] = SubApplicationPeer::SA_INIT_DATE;
- }
-
- } // setSaInitDate()
-
- /**
- * Set the value of [sa_finish_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSaFinishDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [sa_finish_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->sa_finish_date !== $ts) {
- $this->sa_finish_date = $ts;
- $this->modifiedColumns[] = SubApplicationPeer::SA_FINISH_DATE;
- }
-
- } // setSaFinishDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->app_uid = $rs->getString($startcol + 0);
-
- $this->app_parent = $rs->getString($startcol + 1);
-
- $this->del_index_parent = $rs->getInt($startcol + 2);
-
- $this->del_thread_parent = $rs->getInt($startcol + 3);
-
- $this->sa_status = $rs->getString($startcol + 4);
-
- $this->sa_values_out = $rs->getString($startcol + 5);
-
- $this->sa_values_in = $rs->getString($startcol + 6);
-
- $this->sa_init_date = $rs->getTimestamp($startcol + 7, null);
-
- $this->sa_finish_date = $rs->getTimestamp($startcol + 8, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 9; // 9 = SubApplicationPeer::NUM_COLUMNS - SubApplicationPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating SubApplication object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- SubApplicationPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = SubApplicationPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += SubApplicationPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = SubApplicationPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SubApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getAppUid();
- break;
- case 1:
- return $this->getAppParent();
- break;
- case 2:
- return $this->getDelIndexParent();
- break;
- case 3:
- return $this->getDelThreadParent();
- break;
- case 4:
- return $this->getSaStatus();
- break;
- case 5:
- return $this->getSaValuesOut();
- break;
- case 6:
- return $this->getSaValuesIn();
- break;
- case 7:
- return $this->getSaInitDate();
- break;
- case 8:
- return $this->getSaFinishDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SubApplicationPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getAppUid(),
- $keys[1] => $this->getAppParent(),
- $keys[2] => $this->getDelIndexParent(),
- $keys[3] => $this->getDelThreadParent(),
- $keys[4] => $this->getSaStatus(),
- $keys[5] => $this->getSaValuesOut(),
- $keys[6] => $this->getSaValuesIn(),
- $keys[7] => $this->getSaInitDate(),
- $keys[8] => $this->getSaFinishDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SubApplicationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setAppUid($value);
- break;
- case 1:
- $this->setAppParent($value);
- break;
- case 2:
- $this->setDelIndexParent($value);
- break;
- case 3:
- $this->setDelThreadParent($value);
- break;
- case 4:
- $this->setSaStatus($value);
- break;
- case 5:
- $this->setSaValuesOut($value);
- break;
- case 6:
- $this->setSaValuesIn($value);
- break;
- case 7:
- $this->setSaInitDate($value);
- break;
- case 8:
- $this->setSaFinishDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SubApplicationPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setAppUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setAppParent($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setDelIndexParent($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setDelThreadParent($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setSaStatus($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setSaValuesOut($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setSaValuesIn($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setSaInitDate($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setSaFinishDate($arr[$keys[8]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(SubApplicationPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(SubApplicationPeer::APP_UID)) $criteria->add(SubApplicationPeer::APP_UID, $this->app_uid);
- if ($this->isColumnModified(SubApplicationPeer::APP_PARENT)) $criteria->add(SubApplicationPeer::APP_PARENT, $this->app_parent);
- if ($this->isColumnModified(SubApplicationPeer::DEL_INDEX_PARENT)) $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $this->del_index_parent);
- if ($this->isColumnModified(SubApplicationPeer::DEL_THREAD_PARENT)) $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $this->del_thread_parent);
- if ($this->isColumnModified(SubApplicationPeer::SA_STATUS)) $criteria->add(SubApplicationPeer::SA_STATUS, $this->sa_status);
- if ($this->isColumnModified(SubApplicationPeer::SA_VALUES_OUT)) $criteria->add(SubApplicationPeer::SA_VALUES_OUT, $this->sa_values_out);
- if ($this->isColumnModified(SubApplicationPeer::SA_VALUES_IN)) $criteria->add(SubApplicationPeer::SA_VALUES_IN, $this->sa_values_in);
- if ($this->isColumnModified(SubApplicationPeer::SA_INIT_DATE)) $criteria->add(SubApplicationPeer::SA_INIT_DATE, $this->sa_init_date);
- if ($this->isColumnModified(SubApplicationPeer::SA_FINISH_DATE)) $criteria->add(SubApplicationPeer::SA_FINISH_DATE, $this->sa_finish_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(SubApplicationPeer::DATABASE_NAME);
-
- $criteria->add(SubApplicationPeer::APP_UID, $this->app_uid);
- $criteria->add(SubApplicationPeer::APP_PARENT, $this->app_parent);
- $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $this->del_index_parent);
- $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $this->del_thread_parent);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getAppUid();
-
- $pks[1] = $this->getAppParent();
-
- $pks[2] = $this->getDelIndexParent();
-
- $pks[3] = $this->getDelThreadParent();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setAppUid($keys[0]);
-
- $this->setAppParent($keys[1]);
-
- $this->setDelIndexParent($keys[2]);
-
- $this->setDelThreadParent($keys[3]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of SubApplication (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setSaStatus($this->sa_status);
-
- $copyObj->setSaValuesOut($this->sa_values_out);
-
- $copyObj->setSaValuesIn($this->sa_values_in);
-
- $copyObj->setSaInitDate($this->sa_init_date);
-
- $copyObj->setSaFinishDate($this->sa_finish_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setAppUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setAppParent(''); // this is a pkey column, so set to default value
-
- $copyObj->setDelIndexParent('0'); // this is a pkey column, so set to default value
-
- $copyObj->setDelThreadParent('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return SubApplication Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return SubApplicationPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new SubApplicationPeer();
- }
- return self::$peer;
- }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SubApplicationPeer::DATABASE_NAME);
+
+ $criteria->add(SubApplicationPeer::APP_UID, $this->app_uid);
+ $criteria->add(SubApplicationPeer::APP_PARENT, $this->app_parent);
+ $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $this->del_index_parent);
+ $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $this->del_thread_parent);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getAppUid();
+
+ $pks[1] = $this->getAppParent();
+
+ $pks[2] = $this->getDelIndexParent();
+
+ $pks[3] = $this->getDelThreadParent();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setAppUid($keys[0]);
+
+ $this->setAppParent($keys[1]);
+
+ $this->setDelIndexParent($keys[2]);
+
+ $this->setDelThreadParent($keys[3]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of SubApplication (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setSaStatus($this->sa_status);
+
+ $copyObj->setSaValuesOut($this->sa_values_out);
+
+ $copyObj->setSaValuesIn($this->sa_values_in);
+
+ $copyObj->setSaInitDate($this->sa_init_date);
+
+ $copyObj->setSaFinishDate($this->sa_finish_date);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setAppUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setAppParent(''); // this is a pkey column, so set to default value
+
+ $copyObj->setDelIndexParent('0'); // this is a pkey column, so set to default value
+
+ $copyObj->setDelThreadParent('0'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return SubApplication Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return SubApplicationPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new SubApplicationPeer();
+ }
+ return self::$peer;
+ }
+}
-} // BaseSubApplication
diff --git a/workflow/engine/classes/model/om/BaseSubApplicationPeer.php b/workflow/engine/classes/model/om/BaseSubApplicationPeer.php
index 2b2e95e35..febd4d234 100755
--- a/workflow/engine/classes/model/om/BaseSubApplicationPeer.php
+++ b/workflow/engine/classes/model/om/BaseSubApplicationPeer.php
@@ -12,602 +12,603 @@ include_once 'classes/model/SubApplication.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSubApplicationPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'SUB_APPLICATION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.SubApplication';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 9;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the APP_UID field */
- const APP_UID = 'SUB_APPLICATION.APP_UID';
-
- /** the column name for the APP_PARENT field */
- const APP_PARENT = 'SUB_APPLICATION.APP_PARENT';
-
- /** the column name for the DEL_INDEX_PARENT field */
- const DEL_INDEX_PARENT = 'SUB_APPLICATION.DEL_INDEX_PARENT';
-
- /** the column name for the DEL_THREAD_PARENT field */
- const DEL_THREAD_PARENT = 'SUB_APPLICATION.DEL_THREAD_PARENT';
-
- /** the column name for the SA_STATUS field */
- const SA_STATUS = 'SUB_APPLICATION.SA_STATUS';
-
- /** the column name for the SA_VALUES_OUT field */
- const SA_VALUES_OUT = 'SUB_APPLICATION.SA_VALUES_OUT';
-
- /** the column name for the SA_VALUES_IN field */
- const SA_VALUES_IN = 'SUB_APPLICATION.SA_VALUES_IN';
-
- /** the column name for the SA_INIT_DATE field */
- const SA_INIT_DATE = 'SUB_APPLICATION.SA_INIT_DATE';
-
- /** the column name for the SA_FINISH_DATE field */
- const SA_FINISH_DATE = 'SUB_APPLICATION.SA_FINISH_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppParent', 'DelIndexParent', 'DelThreadParent', 'SaStatus', 'SaValuesOut', 'SaValuesIn', 'SaInitDate', 'SaFinishDate', ),
- BasePeer::TYPE_COLNAME => array (SubApplicationPeer::APP_UID, SubApplicationPeer::APP_PARENT, SubApplicationPeer::DEL_INDEX_PARENT, SubApplicationPeer::DEL_THREAD_PARENT, SubApplicationPeer::SA_STATUS, SubApplicationPeer::SA_VALUES_OUT, SubApplicationPeer::SA_VALUES_IN, SubApplicationPeer::SA_INIT_DATE, SubApplicationPeer::SA_FINISH_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_PARENT', 'DEL_INDEX_PARENT', 'DEL_THREAD_PARENT', 'SA_STATUS', 'SA_VALUES_OUT', 'SA_VALUES_IN', 'SA_INIT_DATE', 'SA_FINISH_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppParent' => 1, 'DelIndexParent' => 2, 'DelThreadParent' => 3, 'SaStatus' => 4, 'SaValuesOut' => 5, 'SaValuesIn' => 6, 'SaInitDate' => 7, 'SaFinishDate' => 8, ),
- BasePeer::TYPE_COLNAME => array (SubApplicationPeer::APP_UID => 0, SubApplicationPeer::APP_PARENT => 1, SubApplicationPeer::DEL_INDEX_PARENT => 2, SubApplicationPeer::DEL_THREAD_PARENT => 3, SubApplicationPeer::SA_STATUS => 4, SubApplicationPeer::SA_VALUES_OUT => 5, SubApplicationPeer::SA_VALUES_IN => 6, SubApplicationPeer::SA_INIT_DATE => 7, SubApplicationPeer::SA_FINISH_DATE => 8, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_PARENT' => 1, 'DEL_INDEX_PARENT' => 2, 'DEL_THREAD_PARENT' => 3, 'SA_STATUS' => 4, 'SA_VALUES_OUT' => 5, 'SA_VALUES_IN' => 6, 'SA_INIT_DATE' => 7, 'SA_FINISH_DATE' => 8, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/SubApplicationMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.SubApplicationMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = SubApplicationPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. SubApplicationPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(SubApplicationPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(SubApplicationPeer::APP_UID);
-
- $criteria->addSelectColumn(SubApplicationPeer::APP_PARENT);
-
- $criteria->addSelectColumn(SubApplicationPeer::DEL_INDEX_PARENT);
-
- $criteria->addSelectColumn(SubApplicationPeer::DEL_THREAD_PARENT);
-
- $criteria->addSelectColumn(SubApplicationPeer::SA_STATUS);
-
- $criteria->addSelectColumn(SubApplicationPeer::SA_VALUES_OUT);
-
- $criteria->addSelectColumn(SubApplicationPeer::SA_VALUES_IN);
-
- $criteria->addSelectColumn(SubApplicationPeer::SA_INIT_DATE);
-
- $criteria->addSelectColumn(SubApplicationPeer::SA_FINISH_DATE);
-
- }
-
- const COUNT = 'COUNT(SUB_APPLICATION.APP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT SUB_APPLICATION.APP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(SubApplicationPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(SubApplicationPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = SubApplicationPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return SubApplication
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = SubApplicationPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return SubApplicationPeer::populateObjects(SubApplicationPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- SubApplicationPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = SubApplicationPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return SubApplicationPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a SubApplication or Criteria object.
- *
- * @param mixed $values Criteria or SubApplication object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from SubApplication object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a SubApplication or Criteria object.
- *
- * @param mixed $values Criteria or SubApplication object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(SubApplicationPeer::APP_UID);
- $selectCriteria->add(SubApplicationPeer::APP_UID, $criteria->remove(SubApplicationPeer::APP_UID), $comparison);
-
- $comparison = $criteria->getComparison(SubApplicationPeer::APP_PARENT);
- $selectCriteria->add(SubApplicationPeer::APP_PARENT, $criteria->remove(SubApplicationPeer::APP_PARENT), $comparison);
-
- $comparison = $criteria->getComparison(SubApplicationPeer::DEL_INDEX_PARENT);
- $selectCriteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $criteria->remove(SubApplicationPeer::DEL_INDEX_PARENT), $comparison);
-
- $comparison = $criteria->getComparison(SubApplicationPeer::DEL_THREAD_PARENT);
- $selectCriteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $criteria->remove(SubApplicationPeer::DEL_THREAD_PARENT), $comparison);
-
- } else { // $values is SubApplication object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the SUB_APPLICATION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(SubApplicationPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a SubApplication or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or SubApplication object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof SubApplication) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- $vals[3][] = $value[3];
- }
-
- $criteria->add(SubApplicationPeer::APP_UID, $vals[0], Criteria::IN);
- $criteria->add(SubApplicationPeer::APP_PARENT, $vals[1], Criteria::IN);
- $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $vals[2], Criteria::IN);
- $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $vals[3], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given SubApplication object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param SubApplication $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(SubApplication $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(SubApplicationPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(SubApplicationPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(SubApplicationPeer::SA_STATUS))
- $columns[SubApplicationPeer::SA_STATUS] = $obj->getSaStatus();
-
- }
-
- return BasePeer::doValidate(SubApplicationPeer::DATABASE_NAME, SubApplicationPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $app_uid
- @param string $app_parent
- @param int $del_index_parent
- @param int $del_thread_parent
-
- * @param Connection $con
- * @return SubApplication
- */
- public static function retrieveByPK( $app_uid, $app_parent, $del_index_parent, $del_thread_parent, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(SubApplicationPeer::APP_UID, $app_uid);
- $criteria->add(SubApplicationPeer::APP_PARENT, $app_parent);
- $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $del_index_parent);
- $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $del_thread_parent);
- $v = SubApplicationPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseSubApplicationPeer
+abstract class BaseSubApplicationPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'SUB_APPLICATION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.SubApplication';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 9;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the APP_UID field */
+ const APP_UID = 'SUB_APPLICATION.APP_UID';
+
+ /** the column name for the APP_PARENT field */
+ const APP_PARENT = 'SUB_APPLICATION.APP_PARENT';
+
+ /** the column name for the DEL_INDEX_PARENT field */
+ const DEL_INDEX_PARENT = 'SUB_APPLICATION.DEL_INDEX_PARENT';
+
+ /** the column name for the DEL_THREAD_PARENT field */
+ const DEL_THREAD_PARENT = 'SUB_APPLICATION.DEL_THREAD_PARENT';
+
+ /** the column name for the SA_STATUS field */
+ const SA_STATUS = 'SUB_APPLICATION.SA_STATUS';
+
+ /** the column name for the SA_VALUES_OUT field */
+ const SA_VALUES_OUT = 'SUB_APPLICATION.SA_VALUES_OUT';
+
+ /** the column name for the SA_VALUES_IN field */
+ const SA_VALUES_IN = 'SUB_APPLICATION.SA_VALUES_IN';
+
+ /** the column name for the SA_INIT_DATE field */
+ const SA_INIT_DATE = 'SUB_APPLICATION.SA_INIT_DATE';
+
+ /** the column name for the SA_FINISH_DATE field */
+ const SA_FINISH_DATE = 'SUB_APPLICATION.SA_FINISH_DATE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid', 'AppParent', 'DelIndexParent', 'DelThreadParent', 'SaStatus', 'SaValuesOut', 'SaValuesIn', 'SaInitDate', 'SaFinishDate', ),
+ BasePeer::TYPE_COLNAME => array (SubApplicationPeer::APP_UID, SubApplicationPeer::APP_PARENT, SubApplicationPeer::DEL_INDEX_PARENT, SubApplicationPeer::DEL_THREAD_PARENT, SubApplicationPeer::SA_STATUS, SubApplicationPeer::SA_VALUES_OUT, SubApplicationPeer::SA_VALUES_IN, SubApplicationPeer::SA_INIT_DATE, SubApplicationPeer::SA_FINISH_DATE, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'APP_PARENT', 'DEL_INDEX_PARENT', 'DEL_THREAD_PARENT', 'SA_STATUS', 'SA_VALUES_OUT', 'SA_VALUES_IN', 'SA_INIT_DATE', 'SA_FINISH_DATE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'AppParent' => 1, 'DelIndexParent' => 2, 'DelThreadParent' => 3, 'SaStatus' => 4, 'SaValuesOut' => 5, 'SaValuesIn' => 6, 'SaInitDate' => 7, 'SaFinishDate' => 8, ),
+ BasePeer::TYPE_COLNAME => array (SubApplicationPeer::APP_UID => 0, SubApplicationPeer::APP_PARENT => 1, SubApplicationPeer::DEL_INDEX_PARENT => 2, SubApplicationPeer::DEL_THREAD_PARENT => 3, SubApplicationPeer::SA_STATUS => 4, SubApplicationPeer::SA_VALUES_OUT => 5, SubApplicationPeer::SA_VALUES_IN => 6, SubApplicationPeer::SA_INIT_DATE => 7, SubApplicationPeer::SA_FINISH_DATE => 8, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'APP_PARENT' => 1, 'DEL_INDEX_PARENT' => 2, 'DEL_THREAD_PARENT' => 3, 'SA_STATUS' => 4, 'SA_VALUES_OUT' => 5, 'SA_VALUES_IN' => 6, 'SA_INIT_DATE' => 7, 'SA_FINISH_DATE' => 8, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/SubApplicationMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.SubApplicationMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = SubApplicationPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. SubApplicationPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(SubApplicationPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(SubApplicationPeer::APP_UID);
+
+ $criteria->addSelectColumn(SubApplicationPeer::APP_PARENT);
+
+ $criteria->addSelectColumn(SubApplicationPeer::DEL_INDEX_PARENT);
+
+ $criteria->addSelectColumn(SubApplicationPeer::DEL_THREAD_PARENT);
+
+ $criteria->addSelectColumn(SubApplicationPeer::SA_STATUS);
+
+ $criteria->addSelectColumn(SubApplicationPeer::SA_VALUES_OUT);
+
+ $criteria->addSelectColumn(SubApplicationPeer::SA_VALUES_IN);
+
+ $criteria->addSelectColumn(SubApplicationPeer::SA_INIT_DATE);
+
+ $criteria->addSelectColumn(SubApplicationPeer::SA_FINISH_DATE);
+
+ }
+
+ const COUNT = 'COUNT(SUB_APPLICATION.APP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT SUB_APPLICATION.APP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(SubApplicationPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(SubApplicationPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = SubApplicationPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return SubApplication
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = SubApplicationPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return SubApplicationPeer::populateObjects(SubApplicationPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ SubApplicationPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = SubApplicationPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return SubApplicationPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a SubApplication or Criteria object.
+ *
+ * @param mixed $values Criteria or SubApplication object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from SubApplication object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a SubApplication or Criteria object.
+ *
+ * @param mixed $values Criteria or SubApplication object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(SubApplicationPeer::APP_UID);
+ $selectCriteria->add(SubApplicationPeer::APP_UID, $criteria->remove(SubApplicationPeer::APP_UID), $comparison);
+
+ $comparison = $criteria->getComparison(SubApplicationPeer::APP_PARENT);
+ $selectCriteria->add(SubApplicationPeer::APP_PARENT, $criteria->remove(SubApplicationPeer::APP_PARENT), $comparison);
+
+ $comparison = $criteria->getComparison(SubApplicationPeer::DEL_INDEX_PARENT);
+ $selectCriteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $criteria->remove(SubApplicationPeer::DEL_INDEX_PARENT), $comparison);
+
+ $comparison = $criteria->getComparison(SubApplicationPeer::DEL_THREAD_PARENT);
+ $selectCriteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $criteria->remove(SubApplicationPeer::DEL_THREAD_PARENT), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the SUB_APPLICATION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(SubApplicationPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a SubApplication or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SubApplication object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof SubApplication) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ $vals[3][] = $value[3];
+ }
+
+ $criteria->add(SubApplicationPeer::APP_UID, $vals[0], Criteria::IN);
+ $criteria->add(SubApplicationPeer::APP_PARENT, $vals[1], Criteria::IN);
+ $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $vals[2], Criteria::IN);
+ $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $vals[3], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given SubApplication object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param SubApplication $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(SubApplication $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(SubApplicationPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(SubApplicationPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(SubApplicationPeer::SA_STATUS))
+ $columns[SubApplicationPeer::SA_STATUS] = $obj->getSaStatus();
+
+ }
+
+ return BasePeer::doValidate(SubApplicationPeer::DATABASE_NAME, SubApplicationPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $app_uid
+ * @param string $app_parent
+ * @param int $del_index_parent
+ * @param int $del_thread_parent
+ * @param Connection $con
+ * @return SubApplication
+ */
+ public static function retrieveByPK($app_uid, $app_parent, $del_index_parent, $del_thread_parent, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(SubApplicationPeer::APP_UID, $app_uid);
+ $criteria->add(SubApplicationPeer::APP_PARENT, $app_parent);
+ $criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $del_index_parent);
+ $criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $del_thread_parent);
+ $v = SubApplicationPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseSubApplicationPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseSubApplicationPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/SubApplicationMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.SubApplicationMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/SubApplicationMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.SubApplicationMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseSubProcess.php b/workflow/engine/classes/model/om/BaseSubProcess.php
index 4c7d75fa0..0ce8e4ea3 100755
--- a/workflow/engine/classes/model/om/BaseSubProcess.php
+++ b/workflow/engine/classes/model/om/BaseSubProcess.php
@@ -16,1072 +16,1133 @@ include_once 'classes/model/SubProcessPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSubProcess extends BaseObject implements Persistent {
+abstract class BaseSubProcess extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var SubProcessPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the sp_uid field.
+ * @var string
+ */
+ protected $sp_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the pro_parent field.
+ * @var string
+ */
+ protected $pro_parent = '';
+
+ /**
+ * The value for the tas_parent field.
+ * @var string
+ */
+ protected $tas_parent = '';
+
+ /**
+ * The value for the sp_type field.
+ * @var string
+ */
+ protected $sp_type = '';
+
+ /**
+ * The value for the sp_synchronous field.
+ * @var int
+ */
+ protected $sp_synchronous = 0;
+
+ /**
+ * The value for the sp_synchronous_type field.
+ * @var string
+ */
+ protected $sp_synchronous_type = '';
+
+ /**
+ * The value for the sp_synchronous_wait field.
+ * @var int
+ */
+ protected $sp_synchronous_wait = 0;
+
+ /**
+ * The value for the sp_variables_out field.
+ * @var string
+ */
+ protected $sp_variables_out;
+
+ /**
+ * The value for the sp_variables_in field.
+ * @var string
+ */
+ protected $sp_variables_in;
+
+ /**
+ * The value for the sp_grid_in field.
+ * @var string
+ */
+ protected $sp_grid_in = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [sp_uid] column value.
+ *
+ * @return string
+ */
+ public function getSpUid()
+ {
+
+ return $this->sp_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [pro_parent] column value.
+ *
+ * @return string
+ */
+ public function getProParent()
+ {
+
+ return $this->pro_parent;
+ }
+
+ /**
+ * Get the [tas_parent] column value.
+ *
+ * @return string
+ */
+ public function getTasParent()
+ {
+
+ return $this->tas_parent;
+ }
+
+ /**
+ * Get the [sp_type] column value.
+ *
+ * @return string
+ */
+ public function getSpType()
+ {
+
+ return $this->sp_type;
+ }
+
+ /**
+ * Get the [sp_synchronous] column value.
+ *
+ * @return int
+ */
+ public function getSpSynchronous()
+ {
+
+ return $this->sp_synchronous;
+ }
+
+ /**
+ * Get the [sp_synchronous_type] column value.
+ *
+ * @return string
+ */
+ public function getSpSynchronousType()
+ {
+
+ return $this->sp_synchronous_type;
+ }
+
+ /**
+ * Get the [sp_synchronous_wait] column value.
+ *
+ * @return int
+ */
+ public function getSpSynchronousWait()
+ {
+
+ return $this->sp_synchronous_wait;
+ }
+
+ /**
+ * Get the [sp_variables_out] column value.
+ *
+ * @return string
+ */
+ public function getSpVariablesOut()
+ {
+
+ return $this->sp_variables_out;
+ }
+
+ /**
+ * Get the [sp_variables_in] column value.
+ *
+ * @return string
+ */
+ public function getSpVariablesIn()
+ {
+
+ return $this->sp_variables_in;
+ }
+
+ /**
+ * Get the [sp_grid_in] column value.
+ *
+ * @return string
+ */
+ public function getSpGridIn()
+ {
+
+ return $this->sp_grid_in;
+ }
+
+ /**
+ * Set the value of [sp_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSpUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sp_uid !== $v || $v === '') {
+ $this->sp_uid = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_UID;
+ }
+
+ } // setSpUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = SubProcessPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = SubProcessPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [pro_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_parent !== $v || $v === '') {
+ $this->pro_parent = $v;
+ $this->modifiedColumns[] = SubProcessPeer::PRO_PARENT;
+ }
+
+ } // setProParent()
+
+ /**
+ * Set the value of [tas_parent] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasParent($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_parent !== $v || $v === '') {
+ $this->tas_parent = $v;
+ $this->modifiedColumns[] = SubProcessPeer::TAS_PARENT;
+ }
+
+ } // setTasParent()
+
+ /**
+ * Set the value of [sp_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSpType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sp_type !== $v || $v === '') {
+ $this->sp_type = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_TYPE;
+ }
+
+ } // setSpType()
+
+ /**
+ * Set the value of [sp_synchronous] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSpSynchronous($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->sp_synchronous !== $v || $v === 0) {
+ $this->sp_synchronous = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_SYNCHRONOUS;
+ }
+
+ } // setSpSynchronous()
+
+ /**
+ * Set the value of [sp_synchronous_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSpSynchronousType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sp_synchronous_type !== $v || $v === '') {
+ $this->sp_synchronous_type = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_SYNCHRONOUS_TYPE;
+ }
+
+ } // setSpSynchronousType()
+
+ /**
+ * Set the value of [sp_synchronous_wait] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSpSynchronousWait($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->sp_synchronous_wait !== $v || $v === 0) {
+ $this->sp_synchronous_wait = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_SYNCHRONOUS_WAIT;
+ }
+
+ } // setSpSynchronousWait()
+
+ /**
+ * Set the value of [sp_variables_out] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSpVariablesOut($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sp_variables_out !== $v) {
+ $this->sp_variables_out = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_VARIABLES_OUT;
+ }
+
+ } // setSpVariablesOut()
+
+ /**
+ * Set the value of [sp_variables_in] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSpVariablesIn($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sp_variables_in !== $v) {
+ $this->sp_variables_in = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_VARIABLES_IN;
+ }
+
+ } // setSpVariablesIn()
+
+ /**
+ * Set the value of [sp_grid_in] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSpGridIn($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sp_grid_in !== $v || $v === '') {
+ $this->sp_grid_in = $v;
+ $this->modifiedColumns[] = SubProcessPeer::SP_GRID_IN;
+ }
+
+ } // setSpGridIn()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->sp_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->tas_uid = $rs->getString($startcol + 2);
+
+ $this->pro_parent = $rs->getString($startcol + 3);
+
+ $this->tas_parent = $rs->getString($startcol + 4);
+
+ $this->sp_type = $rs->getString($startcol + 5);
+
+ $this->sp_synchronous = $rs->getInt($startcol + 6);
+
+ $this->sp_synchronous_type = $rs->getString($startcol + 7);
+
+ $this->sp_synchronous_wait = $rs->getInt($startcol + 8);
+
+ $this->sp_variables_out = $rs->getString($startcol + 9);
+
+ $this->sp_variables_in = $rs->getString($startcol + 10);
+
+ $this->sp_grid_in = $rs->getString($startcol + 11);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 12; // 12 = SubProcessPeer::NUM_COLUMNS - SubProcessPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating SubProcess object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ SubProcessPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = SubProcessPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += SubProcessPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = SubProcessPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SubProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getSpUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getTasUid();
+ break;
+ case 3:
+ return $this->getProParent();
+ break;
+ case 4:
+ return $this->getTasParent();
+ break;
+ case 5:
+ return $this->getSpType();
+ break;
+ case 6:
+ return $this->getSpSynchronous();
+ break;
+ case 7:
+ return $this->getSpSynchronousType();
+ break;
+ case 8:
+ return $this->getSpSynchronousWait();
+ break;
+ case 9:
+ return $this->getSpVariablesOut();
+ break;
+ case 10:
+ return $this->getSpVariablesIn();
+ break;
+ case 11:
+ return $this->getSpGridIn();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SubProcessPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getSpUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getTasUid(),
+ $keys[3] => $this->getProParent(),
+ $keys[4] => $this->getTasParent(),
+ $keys[5] => $this->getSpType(),
+ $keys[6] => $this->getSpSynchronous(),
+ $keys[7] => $this->getSpSynchronousType(),
+ $keys[8] => $this->getSpSynchronousWait(),
+ $keys[9] => $this->getSpVariablesOut(),
+ $keys[10] => $this->getSpVariablesIn(),
+ $keys[11] => $this->getSpGridIn(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SubProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setSpUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setTasUid($value);
+ break;
+ case 3:
+ $this->setProParent($value);
+ break;
+ case 4:
+ $this->setTasParent($value);
+ break;
+ case 5:
+ $this->setSpType($value);
+ break;
+ case 6:
+ $this->setSpSynchronous($value);
+ break;
+ case 7:
+ $this->setSpSynchronousType($value);
+ break;
+ case 8:
+ $this->setSpSynchronousWait($value);
+ break;
+ case 9:
+ $this->setSpVariablesOut($value);
+ break;
+ case 10:
+ $this->setSpVariablesIn($value);
+ break;
+ case 11:
+ $this->setSpGridIn($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SubProcessPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setSpUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTasUid($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setProParent($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setTasParent($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setSpType($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setSpSynchronous($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setSpSynchronousType($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setSpSynchronousWait($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setSpVariablesOut($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setSpVariablesIn($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setSpGridIn($arr[$keys[11]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SubProcessPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(SubProcessPeer::SP_UID)) {
+ $criteria->add(SubProcessPeer::SP_UID, $this->sp_uid);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::PRO_UID)) {
+ $criteria->add(SubProcessPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::TAS_UID)) {
+ $criteria->add(SubProcessPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::PRO_PARENT)) {
+ $criteria->add(SubProcessPeer::PRO_PARENT, $this->pro_parent);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::TAS_PARENT)) {
+ $criteria->add(SubProcessPeer::TAS_PARENT, $this->tas_parent);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::SP_TYPE)) {
+ $criteria->add(SubProcessPeer::SP_TYPE, $this->sp_type);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS)) {
+ $criteria->add(SubProcessPeer::SP_SYNCHRONOUS, $this->sp_synchronous);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS_TYPE)) {
+ $criteria->add(SubProcessPeer::SP_SYNCHRONOUS_TYPE, $this->sp_synchronous_type);
+ }
+ if ($this->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS_WAIT)) {
+ $criteria->add(SubProcessPeer::SP_SYNCHRONOUS_WAIT, $this->sp_synchronous_wait);
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var SubProcessPeer
- */
- protected static $peer;
+ if ($this->isColumnModified(SubProcessPeer::SP_VARIABLES_OUT)) {
+ $criteria->add(SubProcessPeer::SP_VARIABLES_OUT, $this->sp_variables_out);
+ }
+ if ($this->isColumnModified(SubProcessPeer::SP_VARIABLES_IN)) {
+ $criteria->add(SubProcessPeer::SP_VARIABLES_IN, $this->sp_variables_in);
+ }
+
+ if ($this->isColumnModified(SubProcessPeer::SP_GRID_IN)) {
+ $criteria->add(SubProcessPeer::SP_GRID_IN, $this->sp_grid_in);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SubProcessPeer::DATABASE_NAME);
+
+ $criteria->add(SubProcessPeer::SP_UID, $this->sp_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getSpUid();
+ }
+
+ /**
+ * Generic method to set the primary key (sp_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setSpUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of SubProcess (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTasUid($this->tas_uid);
+
+ $copyObj->setProParent($this->pro_parent);
+
+ $copyObj->setTasParent($this->tas_parent);
+
+ $copyObj->setSpType($this->sp_type);
+
+ $copyObj->setSpSynchronous($this->sp_synchronous);
+
+ $copyObj->setSpSynchronousType($this->sp_synchronous_type);
+
+ $copyObj->setSpSynchronousWait($this->sp_synchronous_wait);
+
+ $copyObj->setSpVariablesOut($this->sp_variables_out);
+
+ $copyObj->setSpVariablesIn($this->sp_variables_in);
+
+ $copyObj->setSpGridIn($this->sp_grid_in);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setSpUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return SubProcess Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return SubProcessPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new SubProcessPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The value for the sp_uid field.
- * @var string
- */
- protected $sp_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
-
-
- /**
- * The value for the pro_parent field.
- * @var string
- */
- protected $pro_parent = '';
-
-
- /**
- * The value for the tas_parent field.
- * @var string
- */
- protected $tas_parent = '';
-
-
- /**
- * The value for the sp_type field.
- * @var string
- */
- protected $sp_type = '';
-
-
- /**
- * The value for the sp_synchronous field.
- * @var int
- */
- protected $sp_synchronous = 0;
-
-
- /**
- * The value for the sp_synchronous_type field.
- * @var string
- */
- protected $sp_synchronous_type = '';
-
-
- /**
- * The value for the sp_synchronous_wait field.
- * @var int
- */
- protected $sp_synchronous_wait = 0;
-
-
- /**
- * The value for the sp_variables_out field.
- * @var string
- */
- protected $sp_variables_out;
-
-
- /**
- * The value for the sp_variables_in field.
- * @var string
- */
- protected $sp_variables_in;
-
-
- /**
- * The value for the sp_grid_in field.
- * @var string
- */
- protected $sp_grid_in = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [sp_uid] column value.
- *
- * @return string
- */
- public function getSpUid()
- {
-
- return $this->sp_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [pro_parent] column value.
- *
- * @return string
- */
- public function getProParent()
- {
-
- return $this->pro_parent;
- }
-
- /**
- * Get the [tas_parent] column value.
- *
- * @return string
- */
- public function getTasParent()
- {
-
- return $this->tas_parent;
- }
-
- /**
- * Get the [sp_type] column value.
- *
- * @return string
- */
- public function getSpType()
- {
-
- return $this->sp_type;
- }
-
- /**
- * Get the [sp_synchronous] column value.
- *
- * @return int
- */
- public function getSpSynchronous()
- {
-
- return $this->sp_synchronous;
- }
-
- /**
- * Get the [sp_synchronous_type] column value.
- *
- * @return string
- */
- public function getSpSynchronousType()
- {
-
- return $this->sp_synchronous_type;
- }
-
- /**
- * Get the [sp_synchronous_wait] column value.
- *
- * @return int
- */
- public function getSpSynchronousWait()
- {
-
- return $this->sp_synchronous_wait;
- }
-
- /**
- * Get the [sp_variables_out] column value.
- *
- * @return string
- */
- public function getSpVariablesOut()
- {
-
- return $this->sp_variables_out;
- }
-
- /**
- * Get the [sp_variables_in] column value.
- *
- * @return string
- */
- public function getSpVariablesIn()
- {
-
- return $this->sp_variables_in;
- }
-
- /**
- * Get the [sp_grid_in] column value.
- *
- * @return string
- */
- public function getSpGridIn()
- {
-
- return $this->sp_grid_in;
- }
-
- /**
- * Set the value of [sp_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSpUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sp_uid !== $v || $v === '') {
- $this->sp_uid = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_UID;
- }
-
- } // setSpUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = SubProcessPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = SubProcessPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [pro_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_parent !== $v || $v === '') {
- $this->pro_parent = $v;
- $this->modifiedColumns[] = SubProcessPeer::PRO_PARENT;
- }
-
- } // setProParent()
-
- /**
- * Set the value of [tas_parent] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasParent($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_parent !== $v || $v === '') {
- $this->tas_parent = $v;
- $this->modifiedColumns[] = SubProcessPeer::TAS_PARENT;
- }
-
- } // setTasParent()
-
- /**
- * Set the value of [sp_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSpType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sp_type !== $v || $v === '') {
- $this->sp_type = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_TYPE;
- }
-
- } // setSpType()
-
- /**
- * Set the value of [sp_synchronous] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSpSynchronous($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->sp_synchronous !== $v || $v === 0) {
- $this->sp_synchronous = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_SYNCHRONOUS;
- }
-
- } // setSpSynchronous()
-
- /**
- * Set the value of [sp_synchronous_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSpSynchronousType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sp_synchronous_type !== $v || $v === '') {
- $this->sp_synchronous_type = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_SYNCHRONOUS_TYPE;
- }
-
- } // setSpSynchronousType()
-
- /**
- * Set the value of [sp_synchronous_wait] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSpSynchronousWait($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->sp_synchronous_wait !== $v || $v === 0) {
- $this->sp_synchronous_wait = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_SYNCHRONOUS_WAIT;
- }
-
- } // setSpSynchronousWait()
-
- /**
- * Set the value of [sp_variables_out] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSpVariablesOut($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sp_variables_out !== $v) {
- $this->sp_variables_out = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_VARIABLES_OUT;
- }
-
- } // setSpVariablesOut()
-
- /**
- * Set the value of [sp_variables_in] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSpVariablesIn($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sp_variables_in !== $v) {
- $this->sp_variables_in = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_VARIABLES_IN;
- }
-
- } // setSpVariablesIn()
-
- /**
- * Set the value of [sp_grid_in] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSpGridIn($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->sp_grid_in !== $v || $v === '') {
- $this->sp_grid_in = $v;
- $this->modifiedColumns[] = SubProcessPeer::SP_GRID_IN;
- }
-
- } // setSpGridIn()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->sp_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->tas_uid = $rs->getString($startcol + 2);
-
- $this->pro_parent = $rs->getString($startcol + 3);
-
- $this->tas_parent = $rs->getString($startcol + 4);
-
- $this->sp_type = $rs->getString($startcol + 5);
-
- $this->sp_synchronous = $rs->getInt($startcol + 6);
-
- $this->sp_synchronous_type = $rs->getString($startcol + 7);
-
- $this->sp_synchronous_wait = $rs->getInt($startcol + 8);
-
- $this->sp_variables_out = $rs->getString($startcol + 9);
-
- $this->sp_variables_in = $rs->getString($startcol + 10);
-
- $this->sp_grid_in = $rs->getString($startcol + 11);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 12; // 12 = SubProcessPeer::NUM_COLUMNS - SubProcessPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating SubProcess object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- SubProcessPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = SubProcessPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += SubProcessPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = SubProcessPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SubProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getSpUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getTasUid();
- break;
- case 3:
- return $this->getProParent();
- break;
- case 4:
- return $this->getTasParent();
- break;
- case 5:
- return $this->getSpType();
- break;
- case 6:
- return $this->getSpSynchronous();
- break;
- case 7:
- return $this->getSpSynchronousType();
- break;
- case 8:
- return $this->getSpSynchronousWait();
- break;
- case 9:
- return $this->getSpVariablesOut();
- break;
- case 10:
- return $this->getSpVariablesIn();
- break;
- case 11:
- return $this->getSpGridIn();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SubProcessPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getSpUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getTasUid(),
- $keys[3] => $this->getProParent(),
- $keys[4] => $this->getTasParent(),
- $keys[5] => $this->getSpType(),
- $keys[6] => $this->getSpSynchronous(),
- $keys[7] => $this->getSpSynchronousType(),
- $keys[8] => $this->getSpSynchronousWait(),
- $keys[9] => $this->getSpVariablesOut(),
- $keys[10] => $this->getSpVariablesIn(),
- $keys[11] => $this->getSpGridIn(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SubProcessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setSpUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setTasUid($value);
- break;
- case 3:
- $this->setProParent($value);
- break;
- case 4:
- $this->setTasParent($value);
- break;
- case 5:
- $this->setSpType($value);
- break;
- case 6:
- $this->setSpSynchronous($value);
- break;
- case 7:
- $this->setSpSynchronousType($value);
- break;
- case 8:
- $this->setSpSynchronousWait($value);
- break;
- case 9:
- $this->setSpVariablesOut($value);
- break;
- case 10:
- $this->setSpVariablesIn($value);
- break;
- case 11:
- $this->setSpGridIn($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SubProcessPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setSpUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTasUid($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setProParent($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setTasParent($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setSpType($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setSpSynchronous($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setSpSynchronousType($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setSpSynchronousWait($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setSpVariablesOut($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setSpVariablesIn($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setSpGridIn($arr[$keys[11]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(SubProcessPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(SubProcessPeer::SP_UID)) $criteria->add(SubProcessPeer::SP_UID, $this->sp_uid);
- if ($this->isColumnModified(SubProcessPeer::PRO_UID)) $criteria->add(SubProcessPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(SubProcessPeer::TAS_UID)) $criteria->add(SubProcessPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(SubProcessPeer::PRO_PARENT)) $criteria->add(SubProcessPeer::PRO_PARENT, $this->pro_parent);
- if ($this->isColumnModified(SubProcessPeer::TAS_PARENT)) $criteria->add(SubProcessPeer::TAS_PARENT, $this->tas_parent);
- if ($this->isColumnModified(SubProcessPeer::SP_TYPE)) $criteria->add(SubProcessPeer::SP_TYPE, $this->sp_type);
- if ($this->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS)) $criteria->add(SubProcessPeer::SP_SYNCHRONOUS, $this->sp_synchronous);
- if ($this->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS_TYPE)) $criteria->add(SubProcessPeer::SP_SYNCHRONOUS_TYPE, $this->sp_synchronous_type);
- if ($this->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS_WAIT)) $criteria->add(SubProcessPeer::SP_SYNCHRONOUS_WAIT, $this->sp_synchronous_wait);
- if ($this->isColumnModified(SubProcessPeer::SP_VARIABLES_OUT)) $criteria->add(SubProcessPeer::SP_VARIABLES_OUT, $this->sp_variables_out);
- if ($this->isColumnModified(SubProcessPeer::SP_VARIABLES_IN)) $criteria->add(SubProcessPeer::SP_VARIABLES_IN, $this->sp_variables_in);
- if ($this->isColumnModified(SubProcessPeer::SP_GRID_IN)) $criteria->add(SubProcessPeer::SP_GRID_IN, $this->sp_grid_in);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(SubProcessPeer::DATABASE_NAME);
-
- $criteria->add(SubProcessPeer::SP_UID, $this->sp_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getSpUid();
- }
-
- /**
- * Generic method to set the primary key (sp_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setSpUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of SubProcess (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTasUid($this->tas_uid);
-
- $copyObj->setProParent($this->pro_parent);
-
- $copyObj->setTasParent($this->tas_parent);
-
- $copyObj->setSpType($this->sp_type);
-
- $copyObj->setSpSynchronous($this->sp_synchronous);
-
- $copyObj->setSpSynchronousType($this->sp_synchronous_type);
-
- $copyObj->setSpSynchronousWait($this->sp_synchronous_wait);
-
- $copyObj->setSpVariablesOut($this->sp_variables_out);
-
- $copyObj->setSpVariablesIn($this->sp_variables_in);
-
- $copyObj->setSpGridIn($this->sp_grid_in);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setSpUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return SubProcess Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return SubProcessPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new SubProcessPeer();
- }
- return self::$peer;
- }
-
-} // BaseSubProcess
diff --git a/workflow/engine/classes/model/om/BaseSubProcessPeer.php b/workflow/engine/classes/model/om/BaseSubProcessPeer.php
index 239393d62..0c4ef5988 100755
--- a/workflow/engine/classes/model/om/BaseSubProcessPeer.php
+++ b/workflow/engine/classes/model/om/BaseSubProcessPeer.php
@@ -12,618 +12,620 @@ include_once 'classes/model/SubProcess.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSubProcessPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'SUB_PROCESS';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.SubProcess';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 12;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the SP_UID field */
- const SP_UID = 'SUB_PROCESS.SP_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'SUB_PROCESS.PRO_UID';
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'SUB_PROCESS.TAS_UID';
-
- /** the column name for the PRO_PARENT field */
- const PRO_PARENT = 'SUB_PROCESS.PRO_PARENT';
-
- /** the column name for the TAS_PARENT field */
- const TAS_PARENT = 'SUB_PROCESS.TAS_PARENT';
-
- /** the column name for the SP_TYPE field */
- const SP_TYPE = 'SUB_PROCESS.SP_TYPE';
-
- /** the column name for the SP_SYNCHRONOUS field */
- const SP_SYNCHRONOUS = 'SUB_PROCESS.SP_SYNCHRONOUS';
-
- /** the column name for the SP_SYNCHRONOUS_TYPE field */
- const SP_SYNCHRONOUS_TYPE = 'SUB_PROCESS.SP_SYNCHRONOUS_TYPE';
-
- /** the column name for the SP_SYNCHRONOUS_WAIT field */
- const SP_SYNCHRONOUS_WAIT = 'SUB_PROCESS.SP_SYNCHRONOUS_WAIT';
-
- /** the column name for the SP_VARIABLES_OUT field */
- const SP_VARIABLES_OUT = 'SUB_PROCESS.SP_VARIABLES_OUT';
-
- /** the column name for the SP_VARIABLES_IN field */
- const SP_VARIABLES_IN = 'SUB_PROCESS.SP_VARIABLES_IN';
-
- /** the column name for the SP_GRID_IN field */
- const SP_GRID_IN = 'SUB_PROCESS.SP_GRID_IN';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('SpUid', 'ProUid', 'TasUid', 'ProParent', 'TasParent', 'SpType', 'SpSynchronous', 'SpSynchronousType', 'SpSynchronousWait', 'SpVariablesOut', 'SpVariablesIn', 'SpGridIn', ),
- BasePeer::TYPE_COLNAME => array (SubProcessPeer::SP_UID, SubProcessPeer::PRO_UID, SubProcessPeer::TAS_UID, SubProcessPeer::PRO_PARENT, SubProcessPeer::TAS_PARENT, SubProcessPeer::SP_TYPE, SubProcessPeer::SP_SYNCHRONOUS, SubProcessPeer::SP_SYNCHRONOUS_TYPE, SubProcessPeer::SP_SYNCHRONOUS_WAIT, SubProcessPeer::SP_VARIABLES_OUT, SubProcessPeer::SP_VARIABLES_IN, SubProcessPeer::SP_GRID_IN, ),
- BasePeer::TYPE_FIELDNAME => array ('SP_UID', 'PRO_UID', 'TAS_UID', 'PRO_PARENT', 'TAS_PARENT', 'SP_TYPE', 'SP_SYNCHRONOUS', 'SP_SYNCHRONOUS_TYPE', 'SP_SYNCHRONOUS_WAIT', 'SP_VARIABLES_OUT', 'SP_VARIABLES_IN', 'SP_GRID_IN', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('SpUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'ProParent' => 3, 'TasParent' => 4, 'SpType' => 5, 'SpSynchronous' => 6, 'SpSynchronousType' => 7, 'SpSynchronousWait' => 8, 'SpVariablesOut' => 9, 'SpVariablesIn' => 10, 'SpGridIn' => 11, ),
- BasePeer::TYPE_COLNAME => array (SubProcessPeer::SP_UID => 0, SubProcessPeer::PRO_UID => 1, SubProcessPeer::TAS_UID => 2, SubProcessPeer::PRO_PARENT => 3, SubProcessPeer::TAS_PARENT => 4, SubProcessPeer::SP_TYPE => 5, SubProcessPeer::SP_SYNCHRONOUS => 6, SubProcessPeer::SP_SYNCHRONOUS_TYPE => 7, SubProcessPeer::SP_SYNCHRONOUS_WAIT => 8, SubProcessPeer::SP_VARIABLES_OUT => 9, SubProcessPeer::SP_VARIABLES_IN => 10, SubProcessPeer::SP_GRID_IN => 11, ),
- BasePeer::TYPE_FIELDNAME => array ('SP_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'PRO_PARENT' => 3, 'TAS_PARENT' => 4, 'SP_TYPE' => 5, 'SP_SYNCHRONOUS' => 6, 'SP_SYNCHRONOUS_TYPE' => 7, 'SP_SYNCHRONOUS_WAIT' => 8, 'SP_VARIABLES_OUT' => 9, 'SP_VARIABLES_IN' => 10, 'SP_GRID_IN' => 11, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/SubProcessMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.SubProcessMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = SubProcessPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. SubProcessPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(SubProcessPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(SubProcessPeer::SP_UID);
-
- $criteria->addSelectColumn(SubProcessPeer::PRO_UID);
-
- $criteria->addSelectColumn(SubProcessPeer::TAS_UID);
-
- $criteria->addSelectColumn(SubProcessPeer::PRO_PARENT);
-
- $criteria->addSelectColumn(SubProcessPeer::TAS_PARENT);
-
- $criteria->addSelectColumn(SubProcessPeer::SP_TYPE);
-
- $criteria->addSelectColumn(SubProcessPeer::SP_SYNCHRONOUS);
-
- $criteria->addSelectColumn(SubProcessPeer::SP_SYNCHRONOUS_TYPE);
-
- $criteria->addSelectColumn(SubProcessPeer::SP_SYNCHRONOUS_WAIT);
-
- $criteria->addSelectColumn(SubProcessPeer::SP_VARIABLES_OUT);
-
- $criteria->addSelectColumn(SubProcessPeer::SP_VARIABLES_IN);
-
- $criteria->addSelectColumn(SubProcessPeer::SP_GRID_IN);
-
- }
-
- const COUNT = 'COUNT(SUB_PROCESS.SP_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT SUB_PROCESS.SP_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(SubProcessPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(SubProcessPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = SubProcessPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return SubProcess
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = SubProcessPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return SubProcessPeer::populateObjects(SubProcessPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- SubProcessPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = SubProcessPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return SubProcessPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a SubProcess or Criteria object.
- *
- * @param mixed $values Criteria or SubProcess object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from SubProcess object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a SubProcess or Criteria object.
- *
- * @param mixed $values Criteria or SubProcess object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(SubProcessPeer::SP_UID);
- $selectCriteria->add(SubProcessPeer::SP_UID, $criteria->remove(SubProcessPeer::SP_UID), $comparison);
-
- } else { // $values is SubProcess object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the SUB_PROCESS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(SubProcessPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a SubProcess or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or SubProcess object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof SubProcess) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(SubProcessPeer::SP_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given SubProcess object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param SubProcess $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(SubProcess $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(SubProcessPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(SubProcessPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(SubProcessPeer::SP_TYPE))
- $columns[SubProcessPeer::SP_TYPE] = $obj->getSpType();
-
- if ($obj->isNew() || $obj->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS))
- $columns[SubProcessPeer::SP_SYNCHRONOUS] = $obj->getSpSynchronous();
-
- if ($obj->isNew() || $obj->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS_TYPE))
- $columns[SubProcessPeer::SP_SYNCHRONOUS_TYPE] = $obj->getSpSynchronousType();
-
- }
-
- return BasePeer::doValidate(SubProcessPeer::DATABASE_NAME, SubProcessPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return SubProcess
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(SubProcessPeer::DATABASE_NAME);
-
- $criteria->add(SubProcessPeer::SP_UID, $pk);
-
-
- $v = SubProcessPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(SubProcessPeer::SP_UID, $pks, Criteria::IN);
- $objs = SubProcessPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseSubProcessPeer
+abstract class BaseSubProcessPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'SUB_PROCESS';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.SubProcess';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 12;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the SP_UID field */
+ const SP_UID = 'SUB_PROCESS.SP_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'SUB_PROCESS.PRO_UID';
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'SUB_PROCESS.TAS_UID';
+
+ /** the column name for the PRO_PARENT field */
+ const PRO_PARENT = 'SUB_PROCESS.PRO_PARENT';
+
+ /** the column name for the TAS_PARENT field */
+ const TAS_PARENT = 'SUB_PROCESS.TAS_PARENT';
+
+ /** the column name for the SP_TYPE field */
+ const SP_TYPE = 'SUB_PROCESS.SP_TYPE';
+
+ /** the column name for the SP_SYNCHRONOUS field */
+ const SP_SYNCHRONOUS = 'SUB_PROCESS.SP_SYNCHRONOUS';
+
+ /** the column name for the SP_SYNCHRONOUS_TYPE field */
+ const SP_SYNCHRONOUS_TYPE = 'SUB_PROCESS.SP_SYNCHRONOUS_TYPE';
+
+ /** the column name for the SP_SYNCHRONOUS_WAIT field */
+ const SP_SYNCHRONOUS_WAIT = 'SUB_PROCESS.SP_SYNCHRONOUS_WAIT';
+
+ /** the column name for the SP_VARIABLES_OUT field */
+ const SP_VARIABLES_OUT = 'SUB_PROCESS.SP_VARIABLES_OUT';
+
+ /** the column name for the SP_VARIABLES_IN field */
+ const SP_VARIABLES_IN = 'SUB_PROCESS.SP_VARIABLES_IN';
+
+ /** the column name for the SP_GRID_IN field */
+ const SP_GRID_IN = 'SUB_PROCESS.SP_GRID_IN';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('SpUid', 'ProUid', 'TasUid', 'ProParent', 'TasParent', 'SpType', 'SpSynchronous', 'SpSynchronousType', 'SpSynchronousWait', 'SpVariablesOut', 'SpVariablesIn', 'SpGridIn', ),
+ BasePeer::TYPE_COLNAME => array (SubProcessPeer::SP_UID, SubProcessPeer::PRO_UID, SubProcessPeer::TAS_UID, SubProcessPeer::PRO_PARENT, SubProcessPeer::TAS_PARENT, SubProcessPeer::SP_TYPE, SubProcessPeer::SP_SYNCHRONOUS, SubProcessPeer::SP_SYNCHRONOUS_TYPE, SubProcessPeer::SP_SYNCHRONOUS_WAIT, SubProcessPeer::SP_VARIABLES_OUT, SubProcessPeer::SP_VARIABLES_IN, SubProcessPeer::SP_GRID_IN, ),
+ BasePeer::TYPE_FIELDNAME => array ('SP_UID', 'PRO_UID', 'TAS_UID', 'PRO_PARENT', 'TAS_PARENT', 'SP_TYPE', 'SP_SYNCHRONOUS', 'SP_SYNCHRONOUS_TYPE', 'SP_SYNCHRONOUS_WAIT', 'SP_VARIABLES_OUT', 'SP_VARIABLES_IN', 'SP_GRID_IN', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('SpUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'ProParent' => 3, 'TasParent' => 4, 'SpType' => 5, 'SpSynchronous' => 6, 'SpSynchronousType' => 7, 'SpSynchronousWait' => 8, 'SpVariablesOut' => 9, 'SpVariablesIn' => 10, 'SpGridIn' => 11, ),
+ BasePeer::TYPE_COLNAME => array (SubProcessPeer::SP_UID => 0, SubProcessPeer::PRO_UID => 1, SubProcessPeer::TAS_UID => 2, SubProcessPeer::PRO_PARENT => 3, SubProcessPeer::TAS_PARENT => 4, SubProcessPeer::SP_TYPE => 5, SubProcessPeer::SP_SYNCHRONOUS => 6, SubProcessPeer::SP_SYNCHRONOUS_TYPE => 7, SubProcessPeer::SP_SYNCHRONOUS_WAIT => 8, SubProcessPeer::SP_VARIABLES_OUT => 9, SubProcessPeer::SP_VARIABLES_IN => 10, SubProcessPeer::SP_GRID_IN => 11, ),
+ BasePeer::TYPE_FIELDNAME => array ('SP_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'PRO_PARENT' => 3, 'TAS_PARENT' => 4, 'SP_TYPE' => 5, 'SP_SYNCHRONOUS' => 6, 'SP_SYNCHRONOUS_TYPE' => 7, 'SP_SYNCHRONOUS_WAIT' => 8, 'SP_VARIABLES_OUT' => 9, 'SP_VARIABLES_IN' => 10, 'SP_GRID_IN' => 11, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/SubProcessMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.SubProcessMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = SubProcessPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. SubProcessPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(SubProcessPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_UID);
+
+ $criteria->addSelectColumn(SubProcessPeer::PRO_UID);
+
+ $criteria->addSelectColumn(SubProcessPeer::TAS_UID);
+
+ $criteria->addSelectColumn(SubProcessPeer::PRO_PARENT);
+
+ $criteria->addSelectColumn(SubProcessPeer::TAS_PARENT);
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_TYPE);
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_SYNCHRONOUS);
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_SYNCHRONOUS_TYPE);
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_SYNCHRONOUS_WAIT);
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_VARIABLES_OUT);
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_VARIABLES_IN);
+
+ $criteria->addSelectColumn(SubProcessPeer::SP_GRID_IN);
+
+ }
+
+ const COUNT = 'COUNT(SUB_PROCESS.SP_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT SUB_PROCESS.SP_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(SubProcessPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(SubProcessPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = SubProcessPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return SubProcess
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = SubProcessPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return SubProcessPeer::populateObjects(SubProcessPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ SubProcessPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = SubProcessPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return SubProcessPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a SubProcess or Criteria object.
+ *
+ * @param mixed $values Criteria or SubProcess object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from SubProcess object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a SubProcess or Criteria object.
+ *
+ * @param mixed $values Criteria or SubProcess object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(SubProcessPeer::SP_UID);
+ $selectCriteria->add(SubProcessPeer::SP_UID, $criteria->remove(SubProcessPeer::SP_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the SUB_PROCESS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(SubProcessPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a SubProcess or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SubProcess object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof SubProcess) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(SubProcessPeer::SP_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given SubProcess object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param SubProcess $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(SubProcess $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(SubProcessPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(SubProcessPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(SubProcessPeer::SP_TYPE))
+ $columns[SubProcessPeer::SP_TYPE] = $obj->getSpType();
+
+ if ($obj->isNew() || $obj->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS))
+ $columns[SubProcessPeer::SP_SYNCHRONOUS] = $obj->getSpSynchronous();
+
+ if ($obj->isNew() || $obj->isColumnModified(SubProcessPeer::SP_SYNCHRONOUS_TYPE))
+ $columns[SubProcessPeer::SP_SYNCHRONOUS_TYPE] = $obj->getSpSynchronousType();
+
+ }
+
+ return BasePeer::doValidate(SubProcessPeer::DATABASE_NAME, SubProcessPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return SubProcess
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(SubProcessPeer::DATABASE_NAME);
+
+ $criteria->add(SubProcessPeer::SP_UID, $pk);
+
+
+ $v = SubProcessPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(SubProcessPeer::SP_UID, $pks, Criteria::IN);
+ $objs = SubProcessPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseSubProcessPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseSubProcessPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/SubProcessMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.SubProcessMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/SubProcessMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.SubProcessMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseSwimlanesElements.php b/workflow/engine/classes/model/om/BaseSwimlanesElements.php
index e5bf0efff..dcc70b6d2 100755
--- a/workflow/engine/classes/model/om/BaseSwimlanesElements.php
+++ b/workflow/engine/classes/model/om/BaseSwimlanesElements.php
@@ -16,860 +16,901 @@ include_once 'classes/model/SwimlanesElementsPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSwimlanesElements extends BaseObject implements Persistent {
-
+abstract class BaseSwimlanesElements extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var SwimlanesElementsPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the swi_uid field.
+ * @var string
+ */
+ protected $swi_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the swi_type field.
+ * @var string
+ */
+ protected $swi_type = 'LINE';
+
+ /**
+ * The value for the swi_x field.
+ * @var int
+ */
+ protected $swi_x = 0;
+
+ /**
+ * The value for the swi_y field.
+ * @var int
+ */
+ protected $swi_y = 0;
+
+ /**
+ * The value for the swi_width field.
+ * @var int
+ */
+ protected $swi_width = 0;
+
+ /**
+ * The value for the swi_height field.
+ * @var int
+ */
+ protected $swi_height = 0;
+
+ /**
+ * The value for the swi_next_uid field.
+ * @var string
+ */
+ protected $swi_next_uid = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [swi_uid] column value.
+ *
+ * @return string
+ */
+ public function getSwiUid()
+ {
+
+ return $this->swi_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [swi_type] column value.
+ *
+ * @return string
+ */
+ public function getSwiType()
+ {
+
+ return $this->swi_type;
+ }
+
+ /**
+ * Get the [swi_x] column value.
+ *
+ * @return int
+ */
+ public function getSwiX()
+ {
+
+ return $this->swi_x;
+ }
+
+ /**
+ * Get the [swi_y] column value.
+ *
+ * @return int
+ */
+ public function getSwiY()
+ {
+
+ return $this->swi_y;
+ }
+
+ /**
+ * Get the [swi_width] column value.
+ *
+ * @return int
+ */
+ public function getSwiWidth()
+ {
+
+ return $this->swi_width;
+ }
+
+ /**
+ * Get the [swi_height] column value.
+ *
+ * @return int
+ */
+ public function getSwiHeight()
+ {
+
+ return $this->swi_height;
+ }
+
+ /**
+ * Get the [swi_next_uid] column value.
+ *
+ * @return string
+ */
+ public function getSwiNextUid()
+ {
+
+ return $this->swi_next_uid;
+ }
+
+ /**
+ * Set the value of [swi_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSwiUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->swi_uid !== $v || $v === '') {
+ $this->swi_uid = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_UID;
+ }
+
+ } // setSwiUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [swi_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSwiType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->swi_type !== $v || $v === 'LINE') {
+ $this->swi_type = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_TYPE;
+ }
+
+ } // setSwiType()
+
+ /**
+ * Set the value of [swi_x] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSwiX($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->swi_x !== $v || $v === 0) {
+ $this->swi_x = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_X;
+ }
+
+ } // setSwiX()
+
+ /**
+ * Set the value of [swi_y] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSwiY($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->swi_y !== $v || $v === 0) {
+ $this->swi_y = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_Y;
+ }
+
+ } // setSwiY()
+
+ /**
+ * Set the value of [swi_width] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSwiWidth($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->swi_width !== $v || $v === 0) {
+ $this->swi_width = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_WIDTH;
+ }
+
+ } // setSwiWidth()
+
+ /**
+ * Set the value of [swi_height] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setSwiHeight($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->swi_height !== $v || $v === 0) {
+ $this->swi_height = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_HEIGHT;
+ }
+
+ } // setSwiHeight()
+
+ /**
+ * Set the value of [swi_next_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setSwiNextUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->swi_next_uid !== $v || $v === '') {
+ $this->swi_next_uid = $v;
+ $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_NEXT_UID;
+ }
+
+ } // setSwiNextUid()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->swi_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->swi_type = $rs->getString($startcol + 2);
+
+ $this->swi_x = $rs->getInt($startcol + 3);
+
+ $this->swi_y = $rs->getInt($startcol + 4);
+
+ $this->swi_width = $rs->getInt($startcol + 5);
+
+ $this->swi_height = $rs->getInt($startcol + 6);
+
+ $this->swi_next_uid = $rs->getString($startcol + 7);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 8; // 8 = SwimlanesElementsPeer::NUM_COLUMNS - SwimlanesElementsPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating SwimlanesElements object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ SwimlanesElementsPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = SwimlanesElementsPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += SwimlanesElementsPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = SwimlanesElementsPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SwimlanesElementsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getSwiUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getSwiType();
+ break;
+ case 3:
+ return $this->getSwiX();
+ break;
+ case 4:
+ return $this->getSwiY();
+ break;
+ case 5:
+ return $this->getSwiWidth();
+ break;
+ case 6:
+ return $this->getSwiHeight();
+ break;
+ case 7:
+ return $this->getSwiNextUid();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SwimlanesElementsPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getSwiUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getSwiType(),
+ $keys[3] => $this->getSwiX(),
+ $keys[4] => $this->getSwiY(),
+ $keys[5] => $this->getSwiWidth(),
+ $keys[6] => $this->getSwiHeight(),
+ $keys[7] => $this->getSwiNextUid(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = SwimlanesElementsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setSwiUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setSwiType($value);
+ break;
+ case 3:
+ $this->setSwiX($value);
+ break;
+ case 4:
+ $this->setSwiY($value);
+ break;
+ case 5:
+ $this->setSwiWidth($value);
+ break;
+ case 6:
+ $this->setSwiHeight($value);
+ break;
+ case 7:
+ $this->setSwiNextUid($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = SwimlanesElementsPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setSwiUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setSwiType($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setSwiX($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setSwiY($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setSwiWidth($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setSwiHeight($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setSwiNextUid($arr[$keys[7]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(SwimlanesElementsPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::SWI_UID)) {
+ $criteria->add(SwimlanesElementsPeer::SWI_UID, $this->swi_uid);
+ }
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::PRO_UID)) {
+ $criteria->add(SwimlanesElementsPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::SWI_TYPE)) {
+ $criteria->add(SwimlanesElementsPeer::SWI_TYPE, $this->swi_type);
+ }
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::SWI_X)) {
+ $criteria->add(SwimlanesElementsPeer::SWI_X, $this->swi_x);
+ }
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::SWI_Y)) {
+ $criteria->add(SwimlanesElementsPeer::SWI_Y, $this->swi_y);
+ }
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::SWI_WIDTH)) {
+ $criteria->add(SwimlanesElementsPeer::SWI_WIDTH, $this->swi_width);
+ }
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::SWI_HEIGHT)) {
+ $criteria->add(SwimlanesElementsPeer::SWI_HEIGHT, $this->swi_height);
+ }
+
+ if ($this->isColumnModified(SwimlanesElementsPeer::SWI_NEXT_UID)) {
+ $criteria->add(SwimlanesElementsPeer::SWI_NEXT_UID, $this->swi_next_uid);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(SwimlanesElementsPeer::DATABASE_NAME);
+
+ $criteria->add(SwimlanesElementsPeer::SWI_UID, $this->swi_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getSwiUid();
+ }
+
+ /**
+ * Generic method to set the primary key (swi_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setSwiUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of SwimlanesElements (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setSwiType($this->swi_type);
+
+ $copyObj->setSwiX($this->swi_x);
+
+ $copyObj->setSwiY($this->swi_y);
+
+ $copyObj->setSwiWidth($this->swi_width);
+
+ $copyObj->setSwiHeight($this->swi_height);
+
+ $copyObj->setSwiNextUid($this->swi_next_uid);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setSwiUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return SwimlanesElements Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return SwimlanesElementsPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new SwimlanesElementsPeer();
+ }
+ return self::$peer;
+ }
+}
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var SwimlanesElementsPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the swi_uid field.
- * @var string
- */
- protected $swi_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the swi_type field.
- * @var string
- */
- protected $swi_type = 'LINE';
-
-
- /**
- * The value for the swi_x field.
- * @var int
- */
- protected $swi_x = 0;
-
-
- /**
- * The value for the swi_y field.
- * @var int
- */
- protected $swi_y = 0;
-
-
- /**
- * The value for the swi_width field.
- * @var int
- */
- protected $swi_width = 0;
-
-
- /**
- * The value for the swi_height field.
- * @var int
- */
- protected $swi_height = 0;
-
-
- /**
- * The value for the swi_next_uid field.
- * @var string
- */
- protected $swi_next_uid = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [swi_uid] column value.
- *
- * @return string
- */
- public function getSwiUid()
- {
-
- return $this->swi_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [swi_type] column value.
- *
- * @return string
- */
- public function getSwiType()
- {
-
- return $this->swi_type;
- }
-
- /**
- * Get the [swi_x] column value.
- *
- * @return int
- */
- public function getSwiX()
- {
-
- return $this->swi_x;
- }
-
- /**
- * Get the [swi_y] column value.
- *
- * @return int
- */
- public function getSwiY()
- {
-
- return $this->swi_y;
- }
-
- /**
- * Get the [swi_width] column value.
- *
- * @return int
- */
- public function getSwiWidth()
- {
-
- return $this->swi_width;
- }
-
- /**
- * Get the [swi_height] column value.
- *
- * @return int
- */
- public function getSwiHeight()
- {
-
- return $this->swi_height;
- }
-
- /**
- * Get the [swi_next_uid] column value.
- *
- * @return string
- */
- public function getSwiNextUid()
- {
-
- return $this->swi_next_uid;
- }
-
- /**
- * Set the value of [swi_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSwiUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->swi_uid !== $v || $v === '') {
- $this->swi_uid = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_UID;
- }
-
- } // setSwiUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [swi_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSwiType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->swi_type !== $v || $v === 'LINE') {
- $this->swi_type = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_TYPE;
- }
-
- } // setSwiType()
-
- /**
- * Set the value of [swi_x] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSwiX($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->swi_x !== $v || $v === 0) {
- $this->swi_x = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_X;
- }
-
- } // setSwiX()
-
- /**
- * Set the value of [swi_y] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSwiY($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->swi_y !== $v || $v === 0) {
- $this->swi_y = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_Y;
- }
-
- } // setSwiY()
-
- /**
- * Set the value of [swi_width] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSwiWidth($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->swi_width !== $v || $v === 0) {
- $this->swi_width = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_WIDTH;
- }
-
- } // setSwiWidth()
-
- /**
- * Set the value of [swi_height] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setSwiHeight($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->swi_height !== $v || $v === 0) {
- $this->swi_height = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_HEIGHT;
- }
-
- } // setSwiHeight()
-
- /**
- * Set the value of [swi_next_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setSwiNextUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->swi_next_uid !== $v || $v === '') {
- $this->swi_next_uid = $v;
- $this->modifiedColumns[] = SwimlanesElementsPeer::SWI_NEXT_UID;
- }
-
- } // setSwiNextUid()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->swi_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->swi_type = $rs->getString($startcol + 2);
-
- $this->swi_x = $rs->getInt($startcol + 3);
-
- $this->swi_y = $rs->getInt($startcol + 4);
-
- $this->swi_width = $rs->getInt($startcol + 5);
-
- $this->swi_height = $rs->getInt($startcol + 6);
-
- $this->swi_next_uid = $rs->getString($startcol + 7);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 8; // 8 = SwimlanesElementsPeer::NUM_COLUMNS - SwimlanesElementsPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating SwimlanesElements object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- SwimlanesElementsPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = SwimlanesElementsPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += SwimlanesElementsPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = SwimlanesElementsPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SwimlanesElementsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getSwiUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getSwiType();
- break;
- case 3:
- return $this->getSwiX();
- break;
- case 4:
- return $this->getSwiY();
- break;
- case 5:
- return $this->getSwiWidth();
- break;
- case 6:
- return $this->getSwiHeight();
- break;
- case 7:
- return $this->getSwiNextUid();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SwimlanesElementsPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getSwiUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getSwiType(),
- $keys[3] => $this->getSwiX(),
- $keys[4] => $this->getSwiY(),
- $keys[5] => $this->getSwiWidth(),
- $keys[6] => $this->getSwiHeight(),
- $keys[7] => $this->getSwiNextUid(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = SwimlanesElementsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setSwiUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setSwiType($value);
- break;
- case 3:
- $this->setSwiX($value);
- break;
- case 4:
- $this->setSwiY($value);
- break;
- case 5:
- $this->setSwiWidth($value);
- break;
- case 6:
- $this->setSwiHeight($value);
- break;
- case 7:
- $this->setSwiNextUid($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = SwimlanesElementsPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setSwiUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setSwiType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setSwiX($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setSwiY($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setSwiWidth($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setSwiHeight($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setSwiNextUid($arr[$keys[7]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(SwimlanesElementsPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(SwimlanesElementsPeer::SWI_UID)) $criteria->add(SwimlanesElementsPeer::SWI_UID, $this->swi_uid);
- if ($this->isColumnModified(SwimlanesElementsPeer::PRO_UID)) $criteria->add(SwimlanesElementsPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(SwimlanesElementsPeer::SWI_TYPE)) $criteria->add(SwimlanesElementsPeer::SWI_TYPE, $this->swi_type);
- if ($this->isColumnModified(SwimlanesElementsPeer::SWI_X)) $criteria->add(SwimlanesElementsPeer::SWI_X, $this->swi_x);
- if ($this->isColumnModified(SwimlanesElementsPeer::SWI_Y)) $criteria->add(SwimlanesElementsPeer::SWI_Y, $this->swi_y);
- if ($this->isColumnModified(SwimlanesElementsPeer::SWI_WIDTH)) $criteria->add(SwimlanesElementsPeer::SWI_WIDTH, $this->swi_width);
- if ($this->isColumnModified(SwimlanesElementsPeer::SWI_HEIGHT)) $criteria->add(SwimlanesElementsPeer::SWI_HEIGHT, $this->swi_height);
- if ($this->isColumnModified(SwimlanesElementsPeer::SWI_NEXT_UID)) $criteria->add(SwimlanesElementsPeer::SWI_NEXT_UID, $this->swi_next_uid);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(SwimlanesElementsPeer::DATABASE_NAME);
-
- $criteria->add(SwimlanesElementsPeer::SWI_UID, $this->swi_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getSwiUid();
- }
-
- /**
- * Generic method to set the primary key (swi_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setSwiUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of SwimlanesElements (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setSwiType($this->swi_type);
-
- $copyObj->setSwiX($this->swi_x);
-
- $copyObj->setSwiY($this->swi_y);
-
- $copyObj->setSwiWidth($this->swi_width);
-
- $copyObj->setSwiHeight($this->swi_height);
-
- $copyObj->setSwiNextUid($this->swi_next_uid);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setSwiUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return SwimlanesElements Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return SwimlanesElementsPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new SwimlanesElementsPeer();
- }
- return self::$peer;
- }
-
-} // BaseSwimlanesElements
diff --git a/workflow/engine/classes/model/om/BaseSwimlanesElementsPeer.php b/workflow/engine/classes/model/om/BaseSwimlanesElementsPeer.php
index d849c0821..446571237 100755
--- a/workflow/engine/classes/model/om/BaseSwimlanesElementsPeer.php
+++ b/workflow/engine/classes/model/om/BaseSwimlanesElementsPeer.php
@@ -12,598 +12,600 @@ include_once 'classes/model/SwimlanesElements.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseSwimlanesElementsPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'SWIMLANES_ELEMENTS';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.SwimlanesElements';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 8;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the SWI_UID field */
- const SWI_UID = 'SWIMLANES_ELEMENTS.SWI_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'SWIMLANES_ELEMENTS.PRO_UID';
-
- /** the column name for the SWI_TYPE field */
- const SWI_TYPE = 'SWIMLANES_ELEMENTS.SWI_TYPE';
-
- /** the column name for the SWI_X field */
- const SWI_X = 'SWIMLANES_ELEMENTS.SWI_X';
-
- /** the column name for the SWI_Y field */
- const SWI_Y = 'SWIMLANES_ELEMENTS.SWI_Y';
-
- /** the column name for the SWI_WIDTH field */
- const SWI_WIDTH = 'SWIMLANES_ELEMENTS.SWI_WIDTH';
-
- /** the column name for the SWI_HEIGHT field */
- const SWI_HEIGHT = 'SWIMLANES_ELEMENTS.SWI_HEIGHT';
-
- /** the column name for the SWI_NEXT_UID field */
- const SWI_NEXT_UID = 'SWIMLANES_ELEMENTS.SWI_NEXT_UID';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('SwiUid', 'ProUid', 'SwiType', 'SwiX', 'SwiY', 'SwiWidth', 'SwiHeight', 'SwiNextUid', ),
- BasePeer::TYPE_COLNAME => array (SwimlanesElementsPeer::SWI_UID, SwimlanesElementsPeer::PRO_UID, SwimlanesElementsPeer::SWI_TYPE, SwimlanesElementsPeer::SWI_X, SwimlanesElementsPeer::SWI_Y, SwimlanesElementsPeer::SWI_WIDTH, SwimlanesElementsPeer::SWI_HEIGHT, SwimlanesElementsPeer::SWI_NEXT_UID, ),
- BasePeer::TYPE_FIELDNAME => array ('SWI_UID', 'PRO_UID', 'SWI_TYPE', 'SWI_X', 'SWI_Y', 'SWI_WIDTH', 'SWI_HEIGHT', 'SWI_NEXT_UID', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('SwiUid' => 0, 'ProUid' => 1, 'SwiType' => 2, 'SwiX' => 3, 'SwiY' => 4, 'SwiWidth' => 5, 'SwiHeight' => 6, 'SwiNextUid' => 7, ),
- BasePeer::TYPE_COLNAME => array (SwimlanesElementsPeer::SWI_UID => 0, SwimlanesElementsPeer::PRO_UID => 1, SwimlanesElementsPeer::SWI_TYPE => 2, SwimlanesElementsPeer::SWI_X => 3, SwimlanesElementsPeer::SWI_Y => 4, SwimlanesElementsPeer::SWI_WIDTH => 5, SwimlanesElementsPeer::SWI_HEIGHT => 6, SwimlanesElementsPeer::SWI_NEXT_UID => 7, ),
- BasePeer::TYPE_FIELDNAME => array ('SWI_UID' => 0, 'PRO_UID' => 1, 'SWI_TYPE' => 2, 'SWI_X' => 3, 'SWI_Y' => 4, 'SWI_WIDTH' => 5, 'SWI_HEIGHT' => 6, 'SWI_NEXT_UID' => 7, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/SwimlanesElementsMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.SwimlanesElementsMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = SwimlanesElementsPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. SwimlanesElementsPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(SwimlanesElementsPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_UID);
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::PRO_UID);
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_TYPE);
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_X);
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_Y);
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_WIDTH);
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_HEIGHT);
-
- $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_NEXT_UID);
-
- }
-
- const COUNT = 'COUNT(SWIMLANES_ELEMENTS.SWI_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT SWIMLANES_ELEMENTS.SWI_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(SwimlanesElementsPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(SwimlanesElementsPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = SwimlanesElementsPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return SwimlanesElements
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = SwimlanesElementsPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return SwimlanesElementsPeer::populateObjects(SwimlanesElementsPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- SwimlanesElementsPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = SwimlanesElementsPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return SwimlanesElementsPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a SwimlanesElements or Criteria object.
- *
- * @param mixed $values Criteria or SwimlanesElements object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from SwimlanesElements object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a SwimlanesElements or Criteria object.
- *
- * @param mixed $values Criteria or SwimlanesElements object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(SwimlanesElementsPeer::SWI_UID);
- $selectCriteria->add(SwimlanesElementsPeer::SWI_UID, $criteria->remove(SwimlanesElementsPeer::SWI_UID), $comparison);
-
- } else { // $values is SwimlanesElements object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the SWIMLANES_ELEMENTS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(SwimlanesElementsPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a SwimlanesElements or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or SwimlanesElements object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof SwimlanesElements) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(SwimlanesElementsPeer::SWI_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given SwimlanesElements object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param SwimlanesElements $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(SwimlanesElements $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(SwimlanesElementsPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(SwimlanesElementsPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(SwimlanesElementsPeer::SWI_UID))
- $columns[SwimlanesElementsPeer::SWI_UID] = $obj->getSwiUid();
-
- if ($obj->isNew() || $obj->isColumnModified(SwimlanesElementsPeer::PRO_UID))
- $columns[SwimlanesElementsPeer::PRO_UID] = $obj->getProUid();
-
- if ($obj->isNew() || $obj->isColumnModified(SwimlanesElementsPeer::SWI_TYPE))
- $columns[SwimlanesElementsPeer::SWI_TYPE] = $obj->getSwiType();
-
- }
-
- return BasePeer::doValidate(SwimlanesElementsPeer::DATABASE_NAME, SwimlanesElementsPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return SwimlanesElements
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(SwimlanesElementsPeer::DATABASE_NAME);
-
- $criteria->add(SwimlanesElementsPeer::SWI_UID, $pk);
-
-
- $v = SwimlanesElementsPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(SwimlanesElementsPeer::SWI_UID, $pks, Criteria::IN);
- $objs = SwimlanesElementsPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseSwimlanesElementsPeer
+abstract class BaseSwimlanesElementsPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'SWIMLANES_ELEMENTS';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.SwimlanesElements';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 8;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the SWI_UID field */
+ const SWI_UID = 'SWIMLANES_ELEMENTS.SWI_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'SWIMLANES_ELEMENTS.PRO_UID';
+
+ /** the column name for the SWI_TYPE field */
+ const SWI_TYPE = 'SWIMLANES_ELEMENTS.SWI_TYPE';
+
+ /** the column name for the SWI_X field */
+ const SWI_X = 'SWIMLANES_ELEMENTS.SWI_X';
+
+ /** the column name for the SWI_Y field */
+ const SWI_Y = 'SWIMLANES_ELEMENTS.SWI_Y';
+
+ /** the column name for the SWI_WIDTH field */
+ const SWI_WIDTH = 'SWIMLANES_ELEMENTS.SWI_WIDTH';
+
+ /** the column name for the SWI_HEIGHT field */
+ const SWI_HEIGHT = 'SWIMLANES_ELEMENTS.SWI_HEIGHT';
+
+ /** the column name for the SWI_NEXT_UID field */
+ const SWI_NEXT_UID = 'SWIMLANES_ELEMENTS.SWI_NEXT_UID';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('SwiUid', 'ProUid', 'SwiType', 'SwiX', 'SwiY', 'SwiWidth', 'SwiHeight', 'SwiNextUid', ),
+ BasePeer::TYPE_COLNAME => array (SwimlanesElementsPeer::SWI_UID, SwimlanesElementsPeer::PRO_UID, SwimlanesElementsPeer::SWI_TYPE, SwimlanesElementsPeer::SWI_X, SwimlanesElementsPeer::SWI_Y, SwimlanesElementsPeer::SWI_WIDTH, SwimlanesElementsPeer::SWI_HEIGHT, SwimlanesElementsPeer::SWI_NEXT_UID, ),
+ BasePeer::TYPE_FIELDNAME => array ('SWI_UID', 'PRO_UID', 'SWI_TYPE', 'SWI_X', 'SWI_Y', 'SWI_WIDTH', 'SWI_HEIGHT', 'SWI_NEXT_UID', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('SwiUid' => 0, 'ProUid' => 1, 'SwiType' => 2, 'SwiX' => 3, 'SwiY' => 4, 'SwiWidth' => 5, 'SwiHeight' => 6, 'SwiNextUid' => 7, ),
+ BasePeer::TYPE_COLNAME => array (SwimlanesElementsPeer::SWI_UID => 0, SwimlanesElementsPeer::PRO_UID => 1, SwimlanesElementsPeer::SWI_TYPE => 2, SwimlanesElementsPeer::SWI_X => 3, SwimlanesElementsPeer::SWI_Y => 4, SwimlanesElementsPeer::SWI_WIDTH => 5, SwimlanesElementsPeer::SWI_HEIGHT => 6, SwimlanesElementsPeer::SWI_NEXT_UID => 7, ),
+ BasePeer::TYPE_FIELDNAME => array ('SWI_UID' => 0, 'PRO_UID' => 1, 'SWI_TYPE' => 2, 'SWI_X' => 3, 'SWI_Y' => 4, 'SWI_WIDTH' => 5, 'SWI_HEIGHT' => 6, 'SWI_NEXT_UID' => 7, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/SwimlanesElementsMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.SwimlanesElementsMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = SwimlanesElementsPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. SwimlanesElementsPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(SwimlanesElementsPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_UID);
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::PRO_UID);
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_TYPE);
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_X);
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_Y);
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_WIDTH);
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_HEIGHT);
+
+ $criteria->addSelectColumn(SwimlanesElementsPeer::SWI_NEXT_UID);
+
+ }
+
+ const COUNT = 'COUNT(SWIMLANES_ELEMENTS.SWI_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT SWIMLANES_ELEMENTS.SWI_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(SwimlanesElementsPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(SwimlanesElementsPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = SwimlanesElementsPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return SwimlanesElements
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = SwimlanesElementsPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return SwimlanesElementsPeer::populateObjects(SwimlanesElementsPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ SwimlanesElementsPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = SwimlanesElementsPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return SwimlanesElementsPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a SwimlanesElements or Criteria object.
+ *
+ * @param mixed $values Criteria or SwimlanesElements object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from SwimlanesElements object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a SwimlanesElements or Criteria object.
+ *
+ * @param mixed $values Criteria or SwimlanesElements object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(SwimlanesElementsPeer::SWI_UID);
+ $selectCriteria->add(SwimlanesElementsPeer::SWI_UID, $criteria->remove(SwimlanesElementsPeer::SWI_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the SWIMLANES_ELEMENTS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(SwimlanesElementsPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a SwimlanesElements or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or SwimlanesElements object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof SwimlanesElements) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(SwimlanesElementsPeer::SWI_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given SwimlanesElements object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param SwimlanesElements $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(SwimlanesElements $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(SwimlanesElementsPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(SwimlanesElementsPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(SwimlanesElementsPeer::SWI_UID))
+ $columns[SwimlanesElementsPeer::SWI_UID] = $obj->getSwiUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(SwimlanesElementsPeer::PRO_UID))
+ $columns[SwimlanesElementsPeer::PRO_UID] = $obj->getProUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(SwimlanesElementsPeer::SWI_TYPE))
+ $columns[SwimlanesElementsPeer::SWI_TYPE] = $obj->getSwiType();
+
+ }
+
+ return BasePeer::doValidate(SwimlanesElementsPeer::DATABASE_NAME, SwimlanesElementsPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return SwimlanesElements
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(SwimlanesElementsPeer::DATABASE_NAME);
+
+ $criteria->add(SwimlanesElementsPeer::SWI_UID, $pk);
+
+
+ $v = SwimlanesElementsPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(SwimlanesElementsPeer::SWI_UID, $pks, Criteria::IN);
+ $objs = SwimlanesElementsPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseSwimlanesElementsPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseSwimlanesElementsPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/SwimlanesElementsMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.SwimlanesElementsMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/SwimlanesElementsMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.SwimlanesElementsMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseTask.php b/workflow/engine/classes/model/om/BaseTask.php
index b7e523f27..bc17ffea4 100755
--- a/workflow/engine/classes/model/om/BaseTask.php
+++ b/workflow/engine/classes/model/om/BaseTask.php
@@ -16,2597 +16,2803 @@ include_once 'classes/model/TaskPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTask extends BaseObject implements Persistent {
+abstract class BaseTask extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var TaskPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the tas_type field.
+ * @var string
+ */
+ protected $tas_type = 'NORMAL';
+
+ /**
+ * The value for the tas_duration field.
+ * @var double
+ */
+ protected $tas_duration = 0;
+
+ /**
+ * The value for the tas_delay_type field.
+ * @var string
+ */
+ protected $tas_delay_type = '';
+
+ /**
+ * The value for the tas_temporizer field.
+ * @var double
+ */
+ protected $tas_temporizer = 0;
+
+ /**
+ * The value for the tas_type_day field.
+ * @var string
+ */
+ protected $tas_type_day = '1';
+
+ /**
+ * The value for the tas_timeunit field.
+ * @var string
+ */
+ protected $tas_timeunit = 'DAYS';
+
+ /**
+ * The value for the tas_alert field.
+ * @var string
+ */
+ protected $tas_alert = 'FALSE';
+
+ /**
+ * The value for the tas_priority_variable field.
+ * @var string
+ */
+ protected $tas_priority_variable = '';
+
+ /**
+ * The value for the tas_assign_type field.
+ * @var string
+ */
+ protected $tas_assign_type = 'BALANCED';
+
+ /**
+ * The value for the tas_assign_variable field.
+ * @var string
+ */
+ protected $tas_assign_variable = '@@SYS_NEXT_USER_TO_BE_ASSIGNED';
+
+ /**
+ * The value for the tas_mi_instance_variable field.
+ * @var string
+ */
+ protected $tas_mi_instance_variable = '@@SYS_VAR_TOTAL_INSTANCE';
+
+ /**
+ * The value for the tas_mi_complete_variable field.
+ * @var string
+ */
+ protected $tas_mi_complete_variable = '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE';
+
+ /**
+ * The value for the tas_assign_location field.
+ * @var string
+ */
+ protected $tas_assign_location = 'FALSE';
+
+ /**
+ * The value for the tas_assign_location_adhoc field.
+ * @var string
+ */
+ protected $tas_assign_location_adhoc = 'FALSE';
+
+ /**
+ * The value for the tas_transfer_fly field.
+ * @var string
+ */
+ protected $tas_transfer_fly = 'FALSE';
+
+ /**
+ * The value for the tas_last_assigned field.
+ * @var string
+ */
+ protected $tas_last_assigned = '0';
+
+ /**
+ * The value for the tas_user field.
+ * @var string
+ */
+ protected $tas_user = '0';
+
+ /**
+ * The value for the tas_can_upload field.
+ * @var string
+ */
+ protected $tas_can_upload = 'FALSE';
+
+ /**
+ * The value for the tas_view_upload field.
+ * @var string
+ */
+ protected $tas_view_upload = 'FALSE';
+
+ /**
+ * The value for the tas_view_additional_documentation field.
+ * @var string
+ */
+ protected $tas_view_additional_documentation = 'FALSE';
+
+ /**
+ * The value for the tas_can_cancel field.
+ * @var string
+ */
+ protected $tas_can_cancel = 'FALSE';
+
+ /**
+ * The value for the tas_owner_app field.
+ * @var string
+ */
+ protected $tas_owner_app = '';
+
+ /**
+ * The value for the stg_uid field.
+ * @var string
+ */
+ protected $stg_uid = '';
+
+ /**
+ * The value for the tas_can_pause field.
+ * @var string
+ */
+ protected $tas_can_pause = 'FALSE';
+
+ /**
+ * The value for the tas_can_send_message field.
+ * @var string
+ */
+ protected $tas_can_send_message = 'TRUE';
+
+ /**
+ * The value for the tas_can_delete_docs field.
+ * @var string
+ */
+ protected $tas_can_delete_docs = 'FALSE';
+
+ /**
+ * The value for the tas_self_service field.
+ * @var string
+ */
+ protected $tas_self_service = 'FALSE';
+
+ /**
+ * The value for the tas_start field.
+ * @var string
+ */
+ protected $tas_start = 'FALSE';
+
+ /**
+ * The value for the tas_to_last_user field.
+ * @var string
+ */
+ protected $tas_to_last_user = 'FALSE';
+
+ /**
+ * The value for the tas_send_last_email field.
+ * @var string
+ */
+ protected $tas_send_last_email = 'TRUE';
+
+ /**
+ * The value for the tas_derivation field.
+ * @var string
+ */
+ protected $tas_derivation = 'NORMAL';
+
+ /**
+ * The value for the tas_posx field.
+ * @var int
+ */
+ protected $tas_posx = 0;
+
+ /**
+ * The value for the tas_posy field.
+ * @var int
+ */
+ protected $tas_posy = 0;
+
+ /**
+ * The value for the tas_width field.
+ * @var int
+ */
+ protected $tas_width = 110;
+
+ /**
+ * The value for the tas_height field.
+ * @var int
+ */
+ protected $tas_height = 60;
+
+ /**
+ * The value for the tas_color field.
+ * @var string
+ */
+ protected $tas_color = '';
+
+ /**
+ * The value for the tas_evn_uid field.
+ * @var string
+ */
+ protected $tas_evn_uid = '';
+
+ /**
+ * The value for the tas_boundary field.
+ * @var string
+ */
+ protected $tas_boundary = '';
+
+ /**
+ * The value for the tas_derivation_screen_tpl field.
+ * @var string
+ */
+ protected $tas_derivation_screen_tpl = '';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [tas_type] column value.
+ *
+ * @return string
+ */
+ public function getTasType()
+ {
+
+ return $this->tas_type;
+ }
+
+ /**
+ * Get the [tas_duration] column value.
+ *
+ * @return double
+ */
+ public function getTasDuration()
+ {
+
+ return $this->tas_duration;
+ }
+
+ /**
+ * Get the [tas_delay_type] column value.
+ *
+ * @return string
+ */
+ public function getTasDelayType()
+ {
+
+ return $this->tas_delay_type;
+ }
+
+ /**
+ * Get the [tas_temporizer] column value.
+ *
+ * @return double
+ */
+ public function getTasTemporizer()
+ {
+
+ return $this->tas_temporizer;
+ }
+
+ /**
+ * Get the [tas_type_day] column value.
+ *
+ * @return string
+ */
+ public function getTasTypeDay()
+ {
+
+ return $this->tas_type_day;
+ }
+
+ /**
+ * Get the [tas_timeunit] column value.
+ *
+ * @return string
+ */
+ public function getTasTimeunit()
+ {
+
+ return $this->tas_timeunit;
+ }
+
+ /**
+ * Get the [tas_alert] column value.
+ *
+ * @return string
+ */
+ public function getTasAlert()
+ {
+
+ return $this->tas_alert;
+ }
+
+ /**
+ * Get the [tas_priority_variable] column value.
+ *
+ * @return string
+ */
+ public function getTasPriorityVariable()
+ {
+
+ return $this->tas_priority_variable;
+ }
+
+ /**
+ * Get the [tas_assign_type] column value.
+ *
+ * @return string
+ */
+ public function getTasAssignType()
+ {
+
+ return $this->tas_assign_type;
+ }
+
+ /**
+ * Get the [tas_assign_variable] column value.
+ *
+ * @return string
+ */
+ public function getTasAssignVariable()
+ {
+
+ return $this->tas_assign_variable;
+ }
+
+ /**
+ * Get the [tas_mi_instance_variable] column value.
+ *
+ * @return string
+ */
+ public function getTasMiInstanceVariable()
+ {
+
+ return $this->tas_mi_instance_variable;
+ }
+
+ /**
+ * Get the [tas_mi_complete_variable] column value.
+ *
+ * @return string
+ */
+ public function getTasMiCompleteVariable()
+ {
+
+ return $this->tas_mi_complete_variable;
+ }
+
+ /**
+ * Get the [tas_assign_location] column value.
+ *
+ * @return string
+ */
+ public function getTasAssignLocation()
+ {
+
+ return $this->tas_assign_location;
+ }
+
+ /**
+ * Get the [tas_assign_location_adhoc] column value.
+ *
+ * @return string
+ */
+ public function getTasAssignLocationAdhoc()
+ {
+
+ return $this->tas_assign_location_adhoc;
+ }
+
+ /**
+ * Get the [tas_transfer_fly] column value.
+ *
+ * @return string
+ */
+ public function getTasTransferFly()
+ {
+
+ return $this->tas_transfer_fly;
+ }
+
+ /**
+ * Get the [tas_last_assigned] column value.
+ *
+ * @return string
+ */
+ public function getTasLastAssigned()
+ {
+
+ return $this->tas_last_assigned;
+ }
+
+ /**
+ * Get the [tas_user] column value.
+ *
+ * @return string
+ */
+ public function getTasUser()
+ {
+
+ return $this->tas_user;
+ }
+
+ /**
+ * Get the [tas_can_upload] column value.
+ *
+ * @return string
+ */
+ public function getTasCanUpload()
+ {
+
+ return $this->tas_can_upload;
+ }
+
+ /**
+ * Get the [tas_view_upload] column value.
+ *
+ * @return string
+ */
+ public function getTasViewUpload()
+ {
+
+ return $this->tas_view_upload;
+ }
+
+ /**
+ * Get the [tas_view_additional_documentation] column value.
+ *
+ * @return string
+ */
+ public function getTasViewAdditionalDocumentation()
+ {
+
+ return $this->tas_view_additional_documentation;
+ }
+
+ /**
+ * Get the [tas_can_cancel] column value.
+ *
+ * @return string
+ */
+ public function getTasCanCancel()
+ {
+
+ return $this->tas_can_cancel;
+ }
+
+ /**
+ * Get the [tas_owner_app] column value.
+ *
+ * @return string
+ */
+ public function getTasOwnerApp()
+ {
+
+ return $this->tas_owner_app;
+ }
+
+ /**
+ * Get the [stg_uid] column value.
+ *
+ * @return string
+ */
+ public function getStgUid()
+ {
+
+ return $this->stg_uid;
+ }
+
+ /**
+ * Get the [tas_can_pause] column value.
+ *
+ * @return string
+ */
+ public function getTasCanPause()
+ {
+
+ return $this->tas_can_pause;
+ }
+
+ /**
+ * Get the [tas_can_send_message] column value.
+ *
+ * @return string
+ */
+ public function getTasCanSendMessage()
+ {
+
+ return $this->tas_can_send_message;
+ }
+
+ /**
+ * Get the [tas_can_delete_docs] column value.
+ *
+ * @return string
+ */
+ public function getTasCanDeleteDocs()
+ {
+
+ return $this->tas_can_delete_docs;
+ }
+
+ /**
+ * Get the [tas_self_service] column value.
+ *
+ * @return string
+ */
+ public function getTasSelfService()
+ {
+
+ return $this->tas_self_service;
+ }
+
+ /**
+ * Get the [tas_start] column value.
+ *
+ * @return string
+ */
+ public function getTasStart()
+ {
+
+ return $this->tas_start;
+ }
+
+ /**
+ * Get the [tas_to_last_user] column value.
+ *
+ * @return string
+ */
+ public function getTasToLastUser()
+ {
+
+ return $this->tas_to_last_user;
+ }
+
+ /**
+ * Get the [tas_send_last_email] column value.
+ *
+ * @return string
+ */
+ public function getTasSendLastEmail()
+ {
+
+ return $this->tas_send_last_email;
+ }
+
+ /**
+ * Get the [tas_derivation] column value.
+ *
+ * @return string
+ */
+ public function getTasDerivation()
+ {
+
+ return $this->tas_derivation;
+ }
+
+ /**
+ * Get the [tas_posx] column value.
+ *
+ * @return int
+ */
+ public function getTasPosx()
+ {
+
+ return $this->tas_posx;
+ }
+
+ /**
+ * Get the [tas_posy] column value.
+ *
+ * @return int
+ */
+ public function getTasPosy()
+ {
+
+ return $this->tas_posy;
+ }
+
+ /**
+ * Get the [tas_width] column value.
+ *
+ * @return int
+ */
+ public function getTasWidth()
+ {
+
+ return $this->tas_width;
+ }
+
+ /**
+ * Get the [tas_height] column value.
+ *
+ * @return int
+ */
+ public function getTasHeight()
+ {
+
+ return $this->tas_height;
+ }
+
+ /**
+ * Get the [tas_color] column value.
+ *
+ * @return string
+ */
+ public function getTasColor()
+ {
+
+ return $this->tas_color;
+ }
+
+ /**
+ * Get the [tas_evn_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasEvnUid()
+ {
+
+ return $this->tas_evn_uid;
+ }
+
+ /**
+ * Get the [tas_boundary] column value.
+ *
+ * @return string
+ */
+ public function getTasBoundary()
+ {
+
+ return $this->tas_boundary;
+ }
+
+ /**
+ * Get the [tas_derivation_screen_tpl] column value.
+ *
+ * @return string
+ */
+ public function getTasDerivationScreenTpl()
+ {
+
+ return $this->tas_derivation_screen_tpl;
+ }
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = TaskPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [tas_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_type !== $v || $v === 'NORMAL') {
+ $this->tas_type = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_TYPE;
+ }
+
+ } // setTasType()
+
+ /**
+ * Set the value of [tas_duration] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setTasDuration($v)
+ {
+
+ if ($this->tas_duration !== $v || $v === 0) {
+ $this->tas_duration = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_DURATION;
+ }
+
+ } // setTasDuration()
+
+ /**
+ * Set the value of [tas_delay_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasDelayType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_delay_type !== $v || $v === '') {
+ $this->tas_delay_type = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_DELAY_TYPE;
+ }
+
+ } // setTasDelayType()
+
+ /**
+ * Set the value of [tas_temporizer] column.
+ *
+ * @param double $v new value
+ * @return void
+ */
+ public function setTasTemporizer($v)
+ {
+
+ if ($this->tas_temporizer !== $v || $v === 0) {
+ $this->tas_temporizer = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_TEMPORIZER;
+ }
+
+ } // setTasTemporizer()
+
+ /**
+ * Set the value of [tas_type_day] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasTypeDay($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_type_day !== $v || $v === '1') {
+ $this->tas_type_day = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_TYPE_DAY;
+ }
+
+ } // setTasTypeDay()
+
+ /**
+ * Set the value of [tas_timeunit] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasTimeunit($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_timeunit !== $v || $v === 'DAYS') {
+ $this->tas_timeunit = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_TIMEUNIT;
+ }
+
+ } // setTasTimeunit()
+
+ /**
+ * Set the value of [tas_alert] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasAlert($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_alert !== $v || $v === 'FALSE') {
+ $this->tas_alert = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_ALERT;
+ }
+
+ } // setTasAlert()
+
+ /**
+ * Set the value of [tas_priority_variable] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasPriorityVariable($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_priority_variable !== $v || $v === '') {
+ $this->tas_priority_variable = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_PRIORITY_VARIABLE;
+ }
+
+ } // setTasPriorityVariable()
+
+ /**
+ * Set the value of [tas_assign_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasAssignType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_assign_type !== $v || $v === 'BALANCED') {
+ $this->tas_assign_type = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_TYPE;
+ }
+
+ } // setTasAssignType()
+
+ /**
+ * Set the value of [tas_assign_variable] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasAssignVariable($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_assign_variable !== $v || $v === '@@SYS_NEXT_USER_TO_BE_ASSIGNED') {
+ $this->tas_assign_variable = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_VARIABLE;
+ }
+
+ } // setTasAssignVariable()
+
+ /**
+ * Set the value of [tas_mi_instance_variable] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasMiInstanceVariable($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_mi_instance_variable !== $v || $v === '@@SYS_VAR_TOTAL_INSTANCE') {
+ $this->tas_mi_instance_variable = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_MI_INSTANCE_VARIABLE;
+ }
+
+ } // setTasMiInstanceVariable()
+
+ /**
+ * Set the value of [tas_mi_complete_variable] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasMiCompleteVariable($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_mi_complete_variable !== $v || $v === '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE') {
+ $this->tas_mi_complete_variable = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_MI_COMPLETE_VARIABLE;
+ }
+
+ } // setTasMiCompleteVariable()
+
+ /**
+ * Set the value of [tas_assign_location] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasAssignLocation($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_assign_location !== $v || $v === 'FALSE') {
+ $this->tas_assign_location = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_LOCATION;
+ }
+
+ } // setTasAssignLocation()
+
+ /**
+ * Set the value of [tas_assign_location_adhoc] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasAssignLocationAdhoc($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_assign_location_adhoc !== $v || $v === 'FALSE') {
+ $this->tas_assign_location_adhoc = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_LOCATION_ADHOC;
+ }
+
+ } // setTasAssignLocationAdhoc()
+
+ /**
+ * Set the value of [tas_transfer_fly] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasTransferFly($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_transfer_fly !== $v || $v === 'FALSE') {
+ $this->tas_transfer_fly = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_TRANSFER_FLY;
+ }
+
+ } // setTasTransferFly()
+
+ /**
+ * Set the value of [tas_last_assigned] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasLastAssigned($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_last_assigned !== $v || $v === '0') {
+ $this->tas_last_assigned = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_LAST_ASSIGNED;
+ }
+
+ } // setTasLastAssigned()
+
+ /**
+ * Set the value of [tas_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_user !== $v || $v === '0') {
+ $this->tas_user = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_USER;
+ }
+
+ } // setTasUser()
+
+ /**
+ * Set the value of [tas_can_upload] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasCanUpload($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_can_upload !== $v || $v === 'FALSE') {
+ $this->tas_can_upload = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_CAN_UPLOAD;
+ }
+
+ } // setTasCanUpload()
+
+ /**
+ * Set the value of [tas_view_upload] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasViewUpload($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_view_upload !== $v || $v === 'FALSE') {
+ $this->tas_view_upload = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_VIEW_UPLOAD;
+ }
+
+ } // setTasViewUpload()
+
+ /**
+ * Set the value of [tas_view_additional_documentation] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasViewAdditionalDocumentation($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_view_additional_documentation !== $v || $v === 'FALSE') {
+ $this->tas_view_additional_documentation = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION;
+ }
+
+ } // setTasViewAdditionalDocumentation()
+
+ /**
+ * Set the value of [tas_can_cancel] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasCanCancel($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_can_cancel !== $v || $v === 'FALSE') {
+ $this->tas_can_cancel = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_CAN_CANCEL;
+ }
+
+ } // setTasCanCancel()
+
+ /**
+ * Set the value of [tas_owner_app] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasOwnerApp($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_owner_app !== $v || $v === '') {
+ $this->tas_owner_app = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_OWNER_APP;
+ }
+
+ } // setTasOwnerApp()
+
+ /**
+ * Set the value of [stg_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setStgUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->stg_uid !== $v || $v === '') {
+ $this->stg_uid = $v;
+ $this->modifiedColumns[] = TaskPeer::STG_UID;
+ }
+
+ } // setStgUid()
+
+ /**
+ * Set the value of [tas_can_pause] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasCanPause($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_can_pause !== $v || $v === 'FALSE') {
+ $this->tas_can_pause = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_CAN_PAUSE;
+ }
+
+ } // setTasCanPause()
+
+ /**
+ * Set the value of [tas_can_send_message] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasCanSendMessage($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_can_send_message !== $v || $v === 'TRUE') {
+ $this->tas_can_send_message = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_CAN_SEND_MESSAGE;
+ }
+
+ } // setTasCanSendMessage()
+
+ /**
+ * Set the value of [tas_can_delete_docs] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasCanDeleteDocs($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_can_delete_docs !== $v || $v === 'FALSE') {
+ $this->tas_can_delete_docs = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_CAN_DELETE_DOCS;
+ }
+
+ } // setTasCanDeleteDocs()
+
+ /**
+ * Set the value of [tas_self_service] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasSelfService($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_self_service !== $v || $v === 'FALSE') {
+ $this->tas_self_service = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_SELF_SERVICE;
+ }
+
+ } // setTasSelfService()
+
+ /**
+ * Set the value of [tas_start] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasStart($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_start !== $v || $v === 'FALSE') {
+ $this->tas_start = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_START;
+ }
+
+ } // setTasStart()
+
+ /**
+ * Set the value of [tas_to_last_user] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasToLastUser($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_to_last_user !== $v || $v === 'FALSE') {
+ $this->tas_to_last_user = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_TO_LAST_USER;
+ }
+
+ } // setTasToLastUser()
+
+ /**
+ * Set the value of [tas_send_last_email] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasSendLastEmail($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_send_last_email !== $v || $v === 'TRUE') {
+ $this->tas_send_last_email = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_SEND_LAST_EMAIL;
+ }
+
+ } // setTasSendLastEmail()
+
+ /**
+ * Set the value of [tas_derivation] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasDerivation($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_derivation !== $v || $v === 'NORMAL') {
+ $this->tas_derivation = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_DERIVATION;
+ }
+
+ } // setTasDerivation()
+
+ /**
+ * Set the value of [tas_posx] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setTasPosx($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->tas_posx !== $v || $v === 0) {
+ $this->tas_posx = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_POSX;
+ }
+
+ } // setTasPosx()
+
+ /**
+ * Set the value of [tas_posy] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setTasPosy($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->tas_posy !== $v || $v === 0) {
+ $this->tas_posy = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_POSY;
+ }
+
+ } // setTasPosy()
+
+ /**
+ * Set the value of [tas_width] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setTasWidth($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->tas_width !== $v || $v === 110) {
+ $this->tas_width = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_WIDTH;
+ }
+
+ } // setTasWidth()
+
+ /**
+ * Set the value of [tas_height] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setTasHeight($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->tas_height !== $v || $v === 60) {
+ $this->tas_height = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_HEIGHT;
+ }
+
+ } // setTasHeight()
+
+ /**
+ * Set the value of [tas_color] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasColor($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_color !== $v || $v === '') {
+ $this->tas_color = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_COLOR;
+ }
+
+ } // setTasColor()
+
+ /**
+ * Set the value of [tas_evn_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasEvnUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_evn_uid !== $v || $v === '') {
+ $this->tas_evn_uid = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_EVN_UID;
+ }
+
+ } // setTasEvnUid()
+
+ /**
+ * Set the value of [tas_boundary] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasBoundary($v)
+ {
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var TaskPeer
- */
- protected static $peer;
+ if ($this->tas_boundary !== $v || $v === '') {
+ $this->tas_boundary = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_BOUNDARY;
+ }
+ } // setTasBoundary()
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
+ /**
+ * Set the value of [tas_derivation_screen_tpl] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasDerivationScreenTpl($v)
+ {
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
+ if ($this->tas_derivation_screen_tpl !== $v || $v === '') {
+ $this->tas_derivation_screen_tpl = $v;
+ $this->modifiedColumns[] = TaskPeer::TAS_DERIVATION_SCREEN_TPL;
+ }
+ } // setTasDerivationScreenTpl()
- /**
- * The value for the tas_type field.
- * @var string
- */
- protected $tas_type = 'NORMAL';
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+ $this->pro_uid = $rs->getString($startcol + 0);
- /**
- * The value for the tas_duration field.
- * @var double
- */
- protected $tas_duration = 0;
+ $this->tas_uid = $rs->getString($startcol + 1);
+ $this->tas_type = $rs->getString($startcol + 2);
- /**
- * The value for the tas_delay_type field.
- * @var string
- */
- protected $tas_delay_type = '';
+ $this->tas_duration = $rs->getFloat($startcol + 3);
+ $this->tas_delay_type = $rs->getString($startcol + 4);
- /**
- * The value for the tas_temporizer field.
- * @var double
- */
- protected $tas_temporizer = 0;
+ $this->tas_temporizer = $rs->getFloat($startcol + 5);
+ $this->tas_type_day = $rs->getString($startcol + 6);
- /**
- * The value for the tas_type_day field.
- * @var string
- */
- protected $tas_type_day = '1';
+ $this->tas_timeunit = $rs->getString($startcol + 7);
+ $this->tas_alert = $rs->getString($startcol + 8);
- /**
- * The value for the tas_timeunit field.
- * @var string
- */
- protected $tas_timeunit = 'DAYS';
+ $this->tas_priority_variable = $rs->getString($startcol + 9);
+ $this->tas_assign_type = $rs->getString($startcol + 10);
- /**
- * The value for the tas_alert field.
- * @var string
- */
- protected $tas_alert = 'FALSE';
+ $this->tas_assign_variable = $rs->getString($startcol + 11);
+ $this->tas_mi_instance_variable = $rs->getString($startcol + 12);
- /**
- * The value for the tas_priority_variable field.
- * @var string
- */
- protected $tas_priority_variable = '';
+ $this->tas_mi_complete_variable = $rs->getString($startcol + 13);
+ $this->tas_assign_location = $rs->getString($startcol + 14);
- /**
- * The value for the tas_assign_type field.
- * @var string
- */
- protected $tas_assign_type = 'BALANCED';
+ $this->tas_assign_location_adhoc = $rs->getString($startcol + 15);
+ $this->tas_transfer_fly = $rs->getString($startcol + 16);
- /**
- * The value for the tas_assign_variable field.
- * @var string
- */
- protected $tas_assign_variable = '@@SYS_NEXT_USER_TO_BE_ASSIGNED';
+ $this->tas_last_assigned = $rs->getString($startcol + 17);
+ $this->tas_user = $rs->getString($startcol + 18);
- /**
- * The value for the tas_mi_instance_variable field.
- * @var string
- */
- protected $tas_mi_instance_variable = '@@SYS_VAR_TOTAL_INSTANCE';
+ $this->tas_can_upload = $rs->getString($startcol + 19);
+ $this->tas_view_upload = $rs->getString($startcol + 20);
- /**
- * The value for the tas_mi_complete_variable field.
- * @var string
- */
- protected $tas_mi_complete_variable = '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE';
+ $this->tas_view_additional_documentation = $rs->getString($startcol + 21);
+ $this->tas_can_cancel = $rs->getString($startcol + 22);
- /**
- * The value for the tas_assign_location field.
- * @var string
- */
- protected $tas_assign_location = 'FALSE';
+ $this->tas_owner_app = $rs->getString($startcol + 23);
+ $this->stg_uid = $rs->getString($startcol + 24);
- /**
- * The value for the tas_assign_location_adhoc field.
- * @var string
- */
- protected $tas_assign_location_adhoc = 'FALSE';
+ $this->tas_can_pause = $rs->getString($startcol + 25);
+ $this->tas_can_send_message = $rs->getString($startcol + 26);
- /**
- * The value for the tas_transfer_fly field.
- * @var string
- */
- protected $tas_transfer_fly = 'FALSE';
+ $this->tas_can_delete_docs = $rs->getString($startcol + 27);
+ $this->tas_self_service = $rs->getString($startcol + 28);
- /**
- * The value for the tas_last_assigned field.
- * @var string
- */
- protected $tas_last_assigned = '0';
+ $this->tas_start = $rs->getString($startcol + 29);
+ $this->tas_to_last_user = $rs->getString($startcol + 30);
- /**
- * The value for the tas_user field.
- * @var string
- */
- protected $tas_user = '0';
+ $this->tas_send_last_email = $rs->getString($startcol + 31);
+ $this->tas_derivation = $rs->getString($startcol + 32);
- /**
- * The value for the tas_can_upload field.
- * @var string
- */
- protected $tas_can_upload = 'FALSE';
+ $this->tas_posx = $rs->getInt($startcol + 33);
+ $this->tas_posy = $rs->getInt($startcol + 34);
- /**
- * The value for the tas_view_upload field.
- * @var string
- */
- protected $tas_view_upload = 'FALSE';
+ $this->tas_width = $rs->getInt($startcol + 35);
+ $this->tas_height = $rs->getInt($startcol + 36);
- /**
- * The value for the tas_view_additional_documentation field.
- * @var string
- */
- protected $tas_view_additional_documentation = 'FALSE';
+ $this->tas_color = $rs->getString($startcol + 37);
+ $this->tas_evn_uid = $rs->getString($startcol + 38);
- /**
- * The value for the tas_can_cancel field.
- * @var string
- */
- protected $tas_can_cancel = 'FALSE';
+ $this->tas_boundary = $rs->getString($startcol + 39);
+ $this->tas_derivation_screen_tpl = $rs->getString($startcol + 40);
- /**
- * The value for the tas_owner_app field.
- * @var string
- */
- protected $tas_owner_app = '';
+ $this->resetModified();
+ $this->setNew(false);
- /**
- * The value for the stg_uid field.
- * @var string
- */
- protected $stg_uid = '';
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 41; // 41 = TaskPeer::NUM_COLUMNS - TaskPeer::NUM_LAZY_LOAD_COLUMNS).
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Task object", $e);
+ }
+ }
- /**
- * The value for the tas_can_pause field.
- * @var string
- */
- protected $tas_can_pause = 'FALSE';
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+ if ($con === null) {
+ $con = Propel::getConnection(TaskPeer::DATABASE_NAME);
+ }
- /**
- * The value for the tas_can_send_message field.
- * @var string
- */
- protected $tas_can_send_message = 'TRUE';
+ try {
+ $con->begin();
+ TaskPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(TaskPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = TaskPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += TaskPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = TaskPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TaskPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getProUid();
+ break;
+ case 1:
+ return $this->getTasUid();
+ break;
+ case 2:
+ return $this->getTasType();
+ break;
+ case 3:
+ return $this->getTasDuration();
+ break;
+ case 4:
+ return $this->getTasDelayType();
+ break;
+ case 5:
+ return $this->getTasTemporizer();
+ break;
+ case 6:
+ return $this->getTasTypeDay();
+ break;
+ case 7:
+ return $this->getTasTimeunit();
+ break;
+ case 8:
+ return $this->getTasAlert();
+ break;
+ case 9:
+ return $this->getTasPriorityVariable();
+ break;
+ case 10:
+ return $this->getTasAssignType();
+ break;
+ case 11:
+ return $this->getTasAssignVariable();
+ break;
+ case 12:
+ return $this->getTasMiInstanceVariable();
+ break;
+ case 13:
+ return $this->getTasMiCompleteVariable();
+ break;
+ case 14:
+ return $this->getTasAssignLocation();
+ break;
+ case 15:
+ return $this->getTasAssignLocationAdhoc();
+ break;
+ case 16:
+ return $this->getTasTransferFly();
+ break;
+ case 17:
+ return $this->getTasLastAssigned();
+ break;
+ case 18:
+ return $this->getTasUser();
+ break;
+ case 19:
+ return $this->getTasCanUpload();
+ break;
+ case 20:
+ return $this->getTasViewUpload();
+ break;
+ case 21:
+ return $this->getTasViewAdditionalDocumentation();
+ break;
+ case 22:
+ return $this->getTasCanCancel();
+ break;
+ case 23:
+ return $this->getTasOwnerApp();
+ break;
+ case 24:
+ return $this->getStgUid();
+ break;
+ case 25:
+ return $this->getTasCanPause();
+ break;
+ case 26:
+ return $this->getTasCanSendMessage();
+ break;
+ case 27:
+ return $this->getTasCanDeleteDocs();
+ break;
+ case 28:
+ return $this->getTasSelfService();
+ break;
+ case 29:
+ return $this->getTasStart();
+ break;
+ case 30:
+ return $this->getTasToLastUser();
+ break;
+ case 31:
+ return $this->getTasSendLastEmail();
+ break;
+ case 32:
+ return $this->getTasDerivation();
+ break;
+ case 33:
+ return $this->getTasPosx();
+ break;
+ case 34:
+ return $this->getTasPosy();
+ break;
+ case 35:
+ return $this->getTasWidth();
+ break;
+ case 36:
+ return $this->getTasHeight();
+ break;
+ case 37:
+ return $this->getTasColor();
+ break;
+ case 38:
+ return $this->getTasEvnUid();
+ break;
+ case 39:
+ return $this->getTasBoundary();
+ break;
+ case 40:
+ return $this->getTasDerivationScreenTpl();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TaskPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getProUid(),
+ $keys[1] => $this->getTasUid(),
+ $keys[2] => $this->getTasType(),
+ $keys[3] => $this->getTasDuration(),
+ $keys[4] => $this->getTasDelayType(),
+ $keys[5] => $this->getTasTemporizer(),
+ $keys[6] => $this->getTasTypeDay(),
+ $keys[7] => $this->getTasTimeunit(),
+ $keys[8] => $this->getTasAlert(),
+ $keys[9] => $this->getTasPriorityVariable(),
+ $keys[10] => $this->getTasAssignType(),
+ $keys[11] => $this->getTasAssignVariable(),
+ $keys[12] => $this->getTasMiInstanceVariable(),
+ $keys[13] => $this->getTasMiCompleteVariable(),
+ $keys[14] => $this->getTasAssignLocation(),
+ $keys[15] => $this->getTasAssignLocationAdhoc(),
+ $keys[16] => $this->getTasTransferFly(),
+ $keys[17] => $this->getTasLastAssigned(),
+ $keys[18] => $this->getTasUser(),
+ $keys[19] => $this->getTasCanUpload(),
+ $keys[20] => $this->getTasViewUpload(),
+ $keys[21] => $this->getTasViewAdditionalDocumentation(),
+ $keys[22] => $this->getTasCanCancel(),
+ $keys[23] => $this->getTasOwnerApp(),
+ $keys[24] => $this->getStgUid(),
+ $keys[25] => $this->getTasCanPause(),
+ $keys[26] => $this->getTasCanSendMessage(),
+ $keys[27] => $this->getTasCanDeleteDocs(),
+ $keys[28] => $this->getTasSelfService(),
+ $keys[29] => $this->getTasStart(),
+ $keys[30] => $this->getTasToLastUser(),
+ $keys[31] => $this->getTasSendLastEmail(),
+ $keys[32] => $this->getTasDerivation(),
+ $keys[33] => $this->getTasPosx(),
+ $keys[34] => $this->getTasPosy(),
+ $keys[35] => $this->getTasWidth(),
+ $keys[36] => $this->getTasHeight(),
+ $keys[37] => $this->getTasColor(),
+ $keys[38] => $this->getTasEvnUid(),
+ $keys[39] => $this->getTasBoundary(),
+ $keys[40] => $this->getTasDerivationScreenTpl(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TaskPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setProUid($value);
+ break;
+ case 1:
+ $this->setTasUid($value);
+ break;
+ case 2:
+ $this->setTasType($value);
+ break;
+ case 3:
+ $this->setTasDuration($value);
+ break;
+ case 4:
+ $this->setTasDelayType($value);
+ break;
+ case 5:
+ $this->setTasTemporizer($value);
+ break;
+ case 6:
+ $this->setTasTypeDay($value);
+ break;
+ case 7:
+ $this->setTasTimeunit($value);
+ break;
+ case 8:
+ $this->setTasAlert($value);
+ break;
+ case 9:
+ $this->setTasPriorityVariable($value);
+ break;
+ case 10:
+ $this->setTasAssignType($value);
+ break;
+ case 11:
+ $this->setTasAssignVariable($value);
+ break;
+ case 12:
+ $this->setTasMiInstanceVariable($value);
+ break;
+ case 13:
+ $this->setTasMiCompleteVariable($value);
+ break;
+ case 14:
+ $this->setTasAssignLocation($value);
+ break;
+ case 15:
+ $this->setTasAssignLocationAdhoc($value);
+ break;
+ case 16:
+ $this->setTasTransferFly($value);
+ break;
+ case 17:
+ $this->setTasLastAssigned($value);
+ break;
+ case 18:
+ $this->setTasUser($value);
+ break;
+ case 19:
+ $this->setTasCanUpload($value);
+ break;
+ case 20:
+ $this->setTasViewUpload($value);
+ break;
+ case 21:
+ $this->setTasViewAdditionalDocumentation($value);
+ break;
+ case 22:
+ $this->setTasCanCancel($value);
+ break;
+ case 23:
+ $this->setTasOwnerApp($value);
+ break;
+ case 24:
+ $this->setStgUid($value);
+ break;
+ case 25:
+ $this->setTasCanPause($value);
+ break;
+ case 26:
+ $this->setTasCanSendMessage($value);
+ break;
+ case 27:
+ $this->setTasCanDeleteDocs($value);
+ break;
+ case 28:
+ $this->setTasSelfService($value);
+ break;
+ case 29:
+ $this->setTasStart($value);
+ break;
+ case 30:
+ $this->setTasToLastUser($value);
+ break;
+ case 31:
+ $this->setTasSendLastEmail($value);
+ break;
+ case 32:
+ $this->setTasDerivation($value);
+ break;
+ case 33:
+ $this->setTasPosx($value);
+ break;
+ case 34:
+ $this->setTasPosy($value);
+ break;
+ case 35:
+ $this->setTasWidth($value);
+ break;
+ case 36:
+ $this->setTasHeight($value);
+ break;
+ case 37:
+ $this->setTasColor($value);
+ break;
+ case 38:
+ $this->setTasEvnUid($value);
+ break;
+ case 39:
+ $this->setTasBoundary($value);
+ break;
+ case 40:
+ $this->setTasDerivationScreenTpl($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TaskPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setProUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setTasUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTasType($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setTasDuration($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setTasDelayType($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setTasTemporizer($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setTasTypeDay($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setTasTimeunit($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setTasAlert($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setTasPriorityVariable($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setTasAssignType($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setTasAssignVariable($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setTasMiInstanceVariable($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setTasMiCompleteVariable($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setTasAssignLocation($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setTasAssignLocationAdhoc($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setTasTransferFly($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setTasLastAssigned($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setTasUser($arr[$keys[18]]);
+ }
+
+ if (array_key_exists($keys[19], $arr)) {
+ $this->setTasCanUpload($arr[$keys[19]]);
+ }
+
+ if (array_key_exists($keys[20], $arr)) {
+ $this->setTasViewUpload($arr[$keys[20]]);
+ }
+
+ if (array_key_exists($keys[21], $arr)) {
+ $this->setTasViewAdditionalDocumentation($arr[$keys[21]]);
+ }
+
+ if (array_key_exists($keys[22], $arr)) {
+ $this->setTasCanCancel($arr[$keys[22]]);
+ }
+
+ if (array_key_exists($keys[23], $arr)) {
+ $this->setTasOwnerApp($arr[$keys[23]]);
+ }
+
+ if (array_key_exists($keys[24], $arr)) {
+ $this->setStgUid($arr[$keys[24]]);
+ }
+ if (array_key_exists($keys[25], $arr)) {
+ $this->setTasCanPause($arr[$keys[25]]);
+ }
- /**
- * The value for the tas_can_delete_docs field.
- * @var string
- */
- protected $tas_can_delete_docs = 'FALSE';
+ if (array_key_exists($keys[26], $arr)) {
+ $this->setTasCanSendMessage($arr[$keys[26]]);
+ }
+ if (array_key_exists($keys[27], $arr)) {
+ $this->setTasCanDeleteDocs($arr[$keys[27]]);
+ }
- /**
- * The value for the tas_self_service field.
- * @var string
- */
- protected $tas_self_service = 'FALSE';
+ if (array_key_exists($keys[28], $arr)) {
+ $this->setTasSelfService($arr[$keys[28]]);
+ }
+ if (array_key_exists($keys[29], $arr)) {
+ $this->setTasStart($arr[$keys[29]]);
+ }
- /**
- * The value for the tas_start field.
- * @var string
- */
- protected $tas_start = 'FALSE';
+ if (array_key_exists($keys[30], $arr)) {
+ $this->setTasToLastUser($arr[$keys[30]]);
+ }
+ if (array_key_exists($keys[31], $arr)) {
+ $this->setTasSendLastEmail($arr[$keys[31]]);
+ }
- /**
- * The value for the tas_to_last_user field.
- * @var string
- */
- protected $tas_to_last_user = 'FALSE';
+ if (array_key_exists($keys[32], $arr)) {
+ $this->setTasDerivation($arr[$keys[32]]);
+ }
+ if (array_key_exists($keys[33], $arr)) {
+ $this->setTasPosx($arr[$keys[33]]);
+ }
- /**
- * The value for the tas_send_last_email field.
- * @var string
- */
- protected $tas_send_last_email = 'TRUE';
+ if (array_key_exists($keys[34], $arr)) {
+ $this->setTasPosy($arr[$keys[34]]);
+ }
+ if (array_key_exists($keys[35], $arr)) {
+ $this->setTasWidth($arr[$keys[35]]);
+ }
- /**
- * The value for the tas_derivation field.
- * @var string
- */
- protected $tas_derivation = 'NORMAL';
+ if (array_key_exists($keys[36], $arr)) {
+ $this->setTasHeight($arr[$keys[36]]);
+ }
+ if (array_key_exists($keys[37], $arr)) {
+ $this->setTasColor($arr[$keys[37]]);
+ }
- /**
- * The value for the tas_posx field.
- * @var int
- */
- protected $tas_posx = 0;
+ if (array_key_exists($keys[38], $arr)) {
+ $this->setTasEvnUid($arr[$keys[38]]);
+ }
+ if (array_key_exists($keys[39], $arr)) {
+ $this->setTasBoundary($arr[$keys[39]]);
+ }
- /**
- * The value for the tas_posy field.
- * @var int
- */
- protected $tas_posy = 0;
+ if (array_key_exists($keys[40], $arr)) {
+ $this->setTasDerivationScreenTpl($arr[$keys[40]]);
+ }
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(TaskPeer::DATABASE_NAME);
- /**
- * The value for the tas_width field.
- * @var int
- */
- protected $tas_width = 110;
-
+ if ($this->isColumnModified(TaskPeer::PRO_UID)) {
+ $criteria->add(TaskPeer::PRO_UID, $this->pro_uid);
+ }
- /**
- * The value for the tas_height field.
- * @var int
- */
- protected $tas_height = 60;
-
-
- /**
- * The value for the tas_color field.
- * @var string
- */
- protected $tas_color = '';
-
-
- /**
- * The value for the tas_evn_uid field.
- * @var string
- */
- protected $tas_evn_uid = '';
-
-
- /**
- * The value for the tas_boundary field.
- * @var string
- */
- protected $tas_boundary = '';
-
-
- /**
- * The value for the tas_derivation_screen_tpl field.
- * @var string
- */
- protected $tas_derivation_screen_tpl = '';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [tas_type] column value.
- *
- * @return string
- */
- public function getTasType()
- {
-
- return $this->tas_type;
- }
-
- /**
- * Get the [tas_duration] column value.
- *
- * @return double
- */
- public function getTasDuration()
- {
-
- return $this->tas_duration;
- }
-
- /**
- * Get the [tas_delay_type] column value.
- *
- * @return string
- */
- public function getTasDelayType()
- {
-
- return $this->tas_delay_type;
- }
-
- /**
- * Get the [tas_temporizer] column value.
- *
- * @return double
- */
- public function getTasTemporizer()
- {
-
- return $this->tas_temporizer;
- }
-
- /**
- * Get the [tas_type_day] column value.
- *
- * @return string
- */
- public function getTasTypeDay()
- {
-
- return $this->tas_type_day;
- }
-
- /**
- * Get the [tas_timeunit] column value.
- *
- * @return string
- */
- public function getTasTimeunit()
- {
-
- return $this->tas_timeunit;
- }
-
- /**
- * Get the [tas_alert] column value.
- *
- * @return string
- */
- public function getTasAlert()
- {
-
- return $this->tas_alert;
- }
-
- /**
- * Get the [tas_priority_variable] column value.
- *
- * @return string
- */
- public function getTasPriorityVariable()
- {
-
- return $this->tas_priority_variable;
- }
-
- /**
- * Get the [tas_assign_type] column value.
- *
- * @return string
- */
- public function getTasAssignType()
- {
-
- return $this->tas_assign_type;
- }
-
- /**
- * Get the [tas_assign_variable] column value.
- *
- * @return string
- */
- public function getTasAssignVariable()
- {
-
- return $this->tas_assign_variable;
- }
-
- /**
- * Get the [tas_mi_instance_variable] column value.
- *
- * @return string
- */
- public function getTasMiInstanceVariable()
- {
-
- return $this->tas_mi_instance_variable;
- }
-
- /**
- * Get the [tas_mi_complete_variable] column value.
- *
- * @return string
- */
- public function getTasMiCompleteVariable()
- {
-
- return $this->tas_mi_complete_variable;
- }
-
- /**
- * Get the [tas_assign_location] column value.
- *
- * @return string
- */
- public function getTasAssignLocation()
- {
-
- return $this->tas_assign_location;
- }
-
- /**
- * Get the [tas_assign_location_adhoc] column value.
- *
- * @return string
- */
- public function getTasAssignLocationAdhoc()
- {
-
- return $this->tas_assign_location_adhoc;
- }
-
- /**
- * Get the [tas_transfer_fly] column value.
- *
- * @return string
- */
- public function getTasTransferFly()
- {
-
- return $this->tas_transfer_fly;
- }
-
- /**
- * Get the [tas_last_assigned] column value.
- *
- * @return string
- */
- public function getTasLastAssigned()
- {
-
- return $this->tas_last_assigned;
- }
-
- /**
- * Get the [tas_user] column value.
- *
- * @return string
- */
- public function getTasUser()
- {
-
- return $this->tas_user;
- }
-
- /**
- * Get the [tas_can_upload] column value.
- *
- * @return string
- */
- public function getTasCanUpload()
- {
-
- return $this->tas_can_upload;
- }
-
- /**
- * Get the [tas_view_upload] column value.
- *
- * @return string
- */
- public function getTasViewUpload()
- {
-
- return $this->tas_view_upload;
- }
-
- /**
- * Get the [tas_view_additional_documentation] column value.
- *
- * @return string
- */
- public function getTasViewAdditionalDocumentation()
- {
-
- return $this->tas_view_additional_documentation;
- }
-
- /**
- * Get the [tas_can_cancel] column value.
- *
- * @return string
- */
- public function getTasCanCancel()
- {
-
- return $this->tas_can_cancel;
- }
-
- /**
- * Get the [tas_owner_app] column value.
- *
- * @return string
- */
- public function getTasOwnerApp()
- {
-
- return $this->tas_owner_app;
- }
-
- /**
- * Get the [stg_uid] column value.
- *
- * @return string
- */
- public function getStgUid()
- {
-
- return $this->stg_uid;
- }
-
- /**
- * Get the [tas_can_pause] column value.
- *
- * @return string
- */
- public function getTasCanPause()
- {
-
- return $this->tas_can_pause;
- }
-
- /**
- * Get the [tas_can_send_message] column value.
- *
- * @return string
- */
- public function getTasCanSendMessage()
- {
-
- return $this->tas_can_send_message;
- }
-
- /**
- * Get the [tas_can_delete_docs] column value.
- *
- * @return string
- */
- public function getTasCanDeleteDocs()
- {
-
- return $this->tas_can_delete_docs;
- }
-
- /**
- * Get the [tas_self_service] column value.
- *
- * @return string
- */
- public function getTasSelfService()
- {
-
- return $this->tas_self_service;
- }
-
- /**
- * Get the [tas_start] column value.
- *
- * @return string
- */
- public function getTasStart()
- {
-
- return $this->tas_start;
- }
-
- /**
- * Get the [tas_to_last_user] column value.
- *
- * @return string
- */
- public function getTasToLastUser()
- {
-
- return $this->tas_to_last_user;
- }
-
- /**
- * Get the [tas_send_last_email] column value.
- *
- * @return string
- */
- public function getTasSendLastEmail()
- {
-
- return $this->tas_send_last_email;
- }
-
- /**
- * Get the [tas_derivation] column value.
- *
- * @return string
- */
- public function getTasDerivation()
- {
-
- return $this->tas_derivation;
- }
-
- /**
- * Get the [tas_posx] column value.
- *
- * @return int
- */
- public function getTasPosx()
- {
-
- return $this->tas_posx;
- }
-
- /**
- * Get the [tas_posy] column value.
- *
- * @return int
- */
- public function getTasPosy()
- {
-
- return $this->tas_posy;
- }
-
- /**
- * Get the [tas_width] column value.
- *
- * @return int
- */
- public function getTasWidth()
- {
-
- return $this->tas_width;
- }
-
- /**
- * Get the [tas_height] column value.
- *
- * @return int
- */
- public function getTasHeight()
- {
-
- return $this->tas_height;
- }
-
- /**
- * Get the [tas_color] column value.
- *
- * @return string
- */
- public function getTasColor()
- {
-
- return $this->tas_color;
- }
-
- /**
- * Get the [tas_evn_uid] column value.
- *
- * @return string
- */
- public function getTasEvnUid()
- {
-
- return $this->tas_evn_uid;
- }
-
- /**
- * Get the [tas_boundary] column value.
- *
- * @return string
- */
- public function getTasBoundary()
- {
-
- return $this->tas_boundary;
- }
-
- /**
- * Get the [tas_derivation_screen_tpl] column value.
- *
- * @return string
- */
- public function getTasDerivationScreenTpl()
- {
-
- return $this->tas_derivation_screen_tpl;
- }
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = TaskPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [tas_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_type !== $v || $v === 'NORMAL') {
- $this->tas_type = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_TYPE;
- }
-
- } // setTasType()
-
- /**
- * Set the value of [tas_duration] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setTasDuration($v)
- {
-
- if ($this->tas_duration !== $v || $v === 0) {
- $this->tas_duration = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_DURATION;
- }
-
- } // setTasDuration()
-
- /**
- * Set the value of [tas_delay_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasDelayType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_delay_type !== $v || $v === '') {
- $this->tas_delay_type = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_DELAY_TYPE;
- }
-
- } // setTasDelayType()
-
- /**
- * Set the value of [tas_temporizer] column.
- *
- * @param double $v new value
- * @return void
- */
- public function setTasTemporizer($v)
- {
-
- if ($this->tas_temporizer !== $v || $v === 0) {
- $this->tas_temporizer = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_TEMPORIZER;
- }
-
- } // setTasTemporizer()
-
- /**
- * Set the value of [tas_type_day] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasTypeDay($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_type_day !== $v || $v === '1') {
- $this->tas_type_day = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_TYPE_DAY;
- }
-
- } // setTasTypeDay()
-
- /**
- * Set the value of [tas_timeunit] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasTimeunit($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_timeunit !== $v || $v === 'DAYS') {
- $this->tas_timeunit = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_TIMEUNIT;
- }
-
- } // setTasTimeunit()
-
- /**
- * Set the value of [tas_alert] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasAlert($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_alert !== $v || $v === 'FALSE') {
- $this->tas_alert = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_ALERT;
- }
-
- } // setTasAlert()
-
- /**
- * Set the value of [tas_priority_variable] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasPriorityVariable($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_priority_variable !== $v || $v === '') {
- $this->tas_priority_variable = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_PRIORITY_VARIABLE;
- }
-
- } // setTasPriorityVariable()
-
- /**
- * Set the value of [tas_assign_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasAssignType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_assign_type !== $v || $v === 'BALANCED') {
- $this->tas_assign_type = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_TYPE;
- }
-
- } // setTasAssignType()
-
- /**
- * Set the value of [tas_assign_variable] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasAssignVariable($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_assign_variable !== $v || $v === '@@SYS_NEXT_USER_TO_BE_ASSIGNED') {
- $this->tas_assign_variable = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_VARIABLE;
- }
-
- } // setTasAssignVariable()
-
- /**
- * Set the value of [tas_mi_instance_variable] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasMiInstanceVariable($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_mi_instance_variable !== $v || $v === '@@SYS_VAR_TOTAL_INSTANCE') {
- $this->tas_mi_instance_variable = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_MI_INSTANCE_VARIABLE;
- }
-
- } // setTasMiInstanceVariable()
-
- /**
- * Set the value of [tas_mi_complete_variable] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasMiCompleteVariable($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_mi_complete_variable !== $v || $v === '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE') {
- $this->tas_mi_complete_variable = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_MI_COMPLETE_VARIABLE;
- }
-
- } // setTasMiCompleteVariable()
-
- /**
- * Set the value of [tas_assign_location] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasAssignLocation($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_assign_location !== $v || $v === 'FALSE') {
- $this->tas_assign_location = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_LOCATION;
- }
-
- } // setTasAssignLocation()
-
- /**
- * Set the value of [tas_assign_location_adhoc] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasAssignLocationAdhoc($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_assign_location_adhoc !== $v || $v === 'FALSE') {
- $this->tas_assign_location_adhoc = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_ASSIGN_LOCATION_ADHOC;
- }
-
- } // setTasAssignLocationAdhoc()
-
- /**
- * Set the value of [tas_transfer_fly] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasTransferFly($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_transfer_fly !== $v || $v === 'FALSE') {
- $this->tas_transfer_fly = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_TRANSFER_FLY;
- }
-
- } // setTasTransferFly()
-
- /**
- * Set the value of [tas_last_assigned] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasLastAssigned($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_last_assigned !== $v || $v === '0') {
- $this->tas_last_assigned = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_LAST_ASSIGNED;
- }
-
- } // setTasLastAssigned()
-
- /**
- * Set the value of [tas_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_user !== $v || $v === '0') {
- $this->tas_user = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_USER;
- }
-
- } // setTasUser()
-
- /**
- * Set the value of [tas_can_upload] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasCanUpload($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_can_upload !== $v || $v === 'FALSE') {
- $this->tas_can_upload = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_CAN_UPLOAD;
- }
-
- } // setTasCanUpload()
-
- /**
- * Set the value of [tas_view_upload] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasViewUpload($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_view_upload !== $v || $v === 'FALSE') {
- $this->tas_view_upload = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_VIEW_UPLOAD;
- }
-
- } // setTasViewUpload()
-
- /**
- * Set the value of [tas_view_additional_documentation] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasViewAdditionalDocumentation($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_view_additional_documentation !== $v || $v === 'FALSE') {
- $this->tas_view_additional_documentation = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION;
- }
-
- } // setTasViewAdditionalDocumentation()
-
- /**
- * Set the value of [tas_can_cancel] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasCanCancel($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_can_cancel !== $v || $v === 'FALSE') {
- $this->tas_can_cancel = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_CAN_CANCEL;
- }
-
- } // setTasCanCancel()
-
- /**
- * Set the value of [tas_owner_app] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasOwnerApp($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_owner_app !== $v || $v === '') {
- $this->tas_owner_app = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_OWNER_APP;
- }
-
- } // setTasOwnerApp()
-
- /**
- * Set the value of [stg_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setStgUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->stg_uid !== $v || $v === '') {
- $this->stg_uid = $v;
- $this->modifiedColumns[] = TaskPeer::STG_UID;
- }
-
- } // setStgUid()
-
- /**
- * Set the value of [tas_can_pause] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasCanPause($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_can_pause !== $v || $v === 'FALSE') {
- $this->tas_can_pause = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_CAN_PAUSE;
- }
-
- } // setTasCanPause()
-
- /**
- * Set the value of [tas_can_send_message] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasCanSendMessage($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_can_send_message !== $v || $v === 'TRUE') {
- $this->tas_can_send_message = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_CAN_SEND_MESSAGE;
- }
-
- } // setTasCanSendMessage()
-
- /**
- * Set the value of [tas_can_delete_docs] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasCanDeleteDocs($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_can_delete_docs !== $v || $v === 'FALSE') {
- $this->tas_can_delete_docs = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_CAN_DELETE_DOCS;
- }
-
- } // setTasCanDeleteDocs()
-
- /**
- * Set the value of [tas_self_service] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasSelfService($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_self_service !== $v || $v === 'FALSE') {
- $this->tas_self_service = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_SELF_SERVICE;
- }
-
- } // setTasSelfService()
-
- /**
- * Set the value of [tas_start] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasStart($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_start !== $v || $v === 'FALSE') {
- $this->tas_start = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_START;
- }
-
- } // setTasStart()
-
- /**
- * Set the value of [tas_to_last_user] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasToLastUser($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_to_last_user !== $v || $v === 'FALSE') {
- $this->tas_to_last_user = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_TO_LAST_USER;
- }
-
- } // setTasToLastUser()
-
- /**
- * Set the value of [tas_send_last_email] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasSendLastEmail($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_send_last_email !== $v || $v === 'TRUE') {
- $this->tas_send_last_email = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_SEND_LAST_EMAIL;
- }
-
- } // setTasSendLastEmail()
-
- /**
- * Set the value of [tas_derivation] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasDerivation($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_derivation !== $v || $v === 'NORMAL') {
- $this->tas_derivation = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_DERIVATION;
- }
-
- } // setTasDerivation()
-
- /**
- * Set the value of [tas_posx] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setTasPosx($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->tas_posx !== $v || $v === 0) {
- $this->tas_posx = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_POSX;
- }
-
- } // setTasPosx()
-
- /**
- * Set the value of [tas_posy] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setTasPosy($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->tas_posy !== $v || $v === 0) {
- $this->tas_posy = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_POSY;
- }
-
- } // setTasPosy()
-
- /**
- * Set the value of [tas_width] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setTasWidth($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->tas_width !== $v || $v === 110) {
- $this->tas_width = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_WIDTH;
- }
-
- } // setTasWidth()
-
- /**
- * Set the value of [tas_height] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setTasHeight($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->tas_height !== $v || $v === 60) {
- $this->tas_height = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_HEIGHT;
- }
-
- } // setTasHeight()
-
- /**
- * Set the value of [tas_color] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasColor($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_color !== $v || $v === '') {
- $this->tas_color = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_COLOR;
- }
-
- } // setTasColor()
-
- /**
- * Set the value of [tas_evn_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasEvnUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_evn_uid !== $v || $v === '') {
- $this->tas_evn_uid = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_EVN_UID;
- }
-
- } // setTasEvnUid()
-
- /**
- * Set the value of [tas_boundary] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasBoundary($v)
- {
+ if ($this->isColumnModified(TaskPeer::TAS_UID)) {
+ $criteria->add(TaskPeer::TAS_UID, $this->tas_uid);
+ }
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
+ if ($this->isColumnModified(TaskPeer::TAS_TYPE)) {
+ $criteria->add(TaskPeer::TAS_TYPE, $this->tas_type);
+ }
- if ($this->tas_boundary !== $v || $v === '') {
- $this->tas_boundary = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_BOUNDARY;
- }
+ if ($this->isColumnModified(TaskPeer::TAS_DURATION)) {
+ $criteria->add(TaskPeer::TAS_DURATION, $this->tas_duration);
+ }
- } // setTasBoundary()
+ if ($this->isColumnModified(TaskPeer::TAS_DELAY_TYPE)) {
+ $criteria->add(TaskPeer::TAS_DELAY_TYPE, $this->tas_delay_type);
+ }
- /**
- * Set the value of [tas_derivation_screen_tpl] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasDerivationScreenTpl($v)
- {
+ if ($this->isColumnModified(TaskPeer::TAS_TEMPORIZER)) {
+ $criteria->add(TaskPeer::TAS_TEMPORIZER, $this->tas_temporizer);
+ }
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
+ if ($this->isColumnModified(TaskPeer::TAS_TYPE_DAY)) {
+ $criteria->add(TaskPeer::TAS_TYPE_DAY, $this->tas_type_day);
+ }
- if ($this->tas_derivation_screen_tpl !== $v || $v === '') {
- $this->tas_derivation_screen_tpl = $v;
- $this->modifiedColumns[] = TaskPeer::TAS_DERIVATION_SCREEN_TPL;
- }
+ if ($this->isColumnModified(TaskPeer::TAS_TIMEUNIT)) {
+ $criteria->add(TaskPeer::TAS_TIMEUNIT, $this->tas_timeunit);
+ }
- } // setTasDerivationScreenTpl()
+ if ($this->isColumnModified(TaskPeer::TAS_ALERT)) {
+ $criteria->add(TaskPeer::TAS_ALERT, $this->tas_alert);
+ }
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
+ if ($this->isColumnModified(TaskPeer::TAS_PRIORITY_VARIABLE)) {
+ $criteria->add(TaskPeer::TAS_PRIORITY_VARIABLE, $this->tas_priority_variable);
+ }
- $this->pro_uid = $rs->getString($startcol + 0);
+ if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_TYPE)) {
+ $criteria->add(TaskPeer::TAS_ASSIGN_TYPE, $this->tas_assign_type);
+ }
- $this->tas_uid = $rs->getString($startcol + 1);
+ if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_VARIABLE)) {
+ $criteria->add(TaskPeer::TAS_ASSIGN_VARIABLE, $this->tas_assign_variable);
+ }
- $this->tas_type = $rs->getString($startcol + 2);
+ if ($this->isColumnModified(TaskPeer::TAS_MI_INSTANCE_VARIABLE)) {
+ $criteria->add(TaskPeer::TAS_MI_INSTANCE_VARIABLE, $this->tas_mi_instance_variable);
+ }
- $this->tas_duration = $rs->getFloat($startcol + 3);
+ if ($this->isColumnModified(TaskPeer::TAS_MI_COMPLETE_VARIABLE)) {
+ $criteria->add(TaskPeer::TAS_MI_COMPLETE_VARIABLE, $this->tas_mi_complete_variable);
+ }
- $this->tas_delay_type = $rs->getString($startcol + 4);
+ if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION)) {
+ $criteria->add(TaskPeer::TAS_ASSIGN_LOCATION, $this->tas_assign_location);
+ }
- $this->tas_temporizer = $rs->getFloat($startcol + 5);
+ if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC)) {
+ $criteria->add(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC, $this->tas_assign_location_adhoc);
+ }
- $this->tas_type_day = $rs->getString($startcol + 6);
+ if ($this->isColumnModified(TaskPeer::TAS_TRANSFER_FLY)) {
+ $criteria->add(TaskPeer::TAS_TRANSFER_FLY, $this->tas_transfer_fly);
+ }
- $this->tas_timeunit = $rs->getString($startcol + 7);
+ if ($this->isColumnModified(TaskPeer::TAS_LAST_ASSIGNED)) {
+ $criteria->add(TaskPeer::TAS_LAST_ASSIGNED, $this->tas_last_assigned);
+ }
- $this->tas_alert = $rs->getString($startcol + 8);
+ if ($this->isColumnModified(TaskPeer::TAS_USER)) {
+ $criteria->add(TaskPeer::TAS_USER, $this->tas_user);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_CAN_UPLOAD)) {
+ $criteria->add(TaskPeer::TAS_CAN_UPLOAD, $this->tas_can_upload);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_VIEW_UPLOAD)) {
+ $criteria->add(TaskPeer::TAS_VIEW_UPLOAD, $this->tas_view_upload);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION)) {
+ $criteria->add(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION, $this->tas_view_additional_documentation);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_CAN_CANCEL)) {
+ $criteria->add(TaskPeer::TAS_CAN_CANCEL, $this->tas_can_cancel);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_OWNER_APP)) {
+ $criteria->add(TaskPeer::TAS_OWNER_APP, $this->tas_owner_app);
+ }
+
+ if ($this->isColumnModified(TaskPeer::STG_UID)) {
+ $criteria->add(TaskPeer::STG_UID, $this->stg_uid);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_CAN_PAUSE)) {
+ $criteria->add(TaskPeer::TAS_CAN_PAUSE, $this->tas_can_pause);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_CAN_SEND_MESSAGE)) {
+ $criteria->add(TaskPeer::TAS_CAN_SEND_MESSAGE, $this->tas_can_send_message);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_CAN_DELETE_DOCS)) {
+ $criteria->add(TaskPeer::TAS_CAN_DELETE_DOCS, $this->tas_can_delete_docs);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_SELF_SERVICE)) {
+ $criteria->add(TaskPeer::TAS_SELF_SERVICE, $this->tas_self_service);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_START)) {
+ $criteria->add(TaskPeer::TAS_START, $this->tas_start);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_TO_LAST_USER)) {
+ $criteria->add(TaskPeer::TAS_TO_LAST_USER, $this->tas_to_last_user);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_SEND_LAST_EMAIL)) {
+ $criteria->add(TaskPeer::TAS_SEND_LAST_EMAIL, $this->tas_send_last_email);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_DERIVATION)) {
+ $criteria->add(TaskPeer::TAS_DERIVATION, $this->tas_derivation);
+ }
+
+ if ($this->isColumnModified(TaskPeer::TAS_POSX)) {
+ $criteria->add(TaskPeer::TAS_POSX, $this->tas_posx);
+ }
- $this->tas_priority_variable = $rs->getString($startcol + 9);
+ if ($this->isColumnModified(TaskPeer::TAS_POSY)) {
+ $criteria->add(TaskPeer::TAS_POSY, $this->tas_posy);
+ }
- $this->tas_assign_type = $rs->getString($startcol + 10);
+ if ($this->isColumnModified(TaskPeer::TAS_WIDTH)) {
+ $criteria->add(TaskPeer::TAS_WIDTH, $this->tas_width);
+ }
- $this->tas_assign_variable = $rs->getString($startcol + 11);
+ if ($this->isColumnModified(TaskPeer::TAS_HEIGHT)) {
+ $criteria->add(TaskPeer::TAS_HEIGHT, $this->tas_height);
+ }
- $this->tas_mi_instance_variable = $rs->getString($startcol + 12);
+ if ($this->isColumnModified(TaskPeer::TAS_COLOR)) {
+ $criteria->add(TaskPeer::TAS_COLOR, $this->tas_color);
+ }
- $this->tas_mi_complete_variable = $rs->getString($startcol + 13);
+ if ($this->isColumnModified(TaskPeer::TAS_EVN_UID)) {
+ $criteria->add(TaskPeer::TAS_EVN_UID, $this->tas_evn_uid);
+ }
- $this->tas_assign_location = $rs->getString($startcol + 14);
+ if ($this->isColumnModified(TaskPeer::TAS_BOUNDARY)) {
+ $criteria->add(TaskPeer::TAS_BOUNDARY, $this->tas_boundary);
+ }
- $this->tas_assign_location_adhoc = $rs->getString($startcol + 15);
+ if ($this->isColumnModified(TaskPeer::TAS_DERIVATION_SCREEN_TPL)) {
+ $criteria->add(TaskPeer::TAS_DERIVATION_SCREEN_TPL, $this->tas_derivation_screen_tpl);
+ }
- $this->tas_transfer_fly = $rs->getString($startcol + 16);
- $this->tas_last_assigned = $rs->getString($startcol + 17);
+ return $criteria;
+ }
- $this->tas_user = $rs->getString($startcol + 18);
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(TaskPeer::DATABASE_NAME);
- $this->tas_can_upload = $rs->getString($startcol + 19);
+ $criteria->add(TaskPeer::TAS_UID, $this->tas_uid);
- $this->tas_view_upload = $rs->getString($startcol + 20);
+ return $criteria;
+ }
- $this->tas_view_additional_documentation = $rs->getString($startcol + 21);
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getTasUid();
+ }
- $this->tas_can_cancel = $rs->getString($startcol + 22);
+ /**
+ * Generic method to set the primary key (tas_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setTasUid($key);
+ }
- $this->tas_owner_app = $rs->getString($startcol + 23);
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Task (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
- $this->stg_uid = $rs->getString($startcol + 24);
+ $copyObj->setProUid($this->pro_uid);
- $this->tas_can_pause = $rs->getString($startcol + 25);
+ $copyObj->setTasType($this->tas_type);
- $this->tas_can_send_message = $rs->getString($startcol + 26);
+ $copyObj->setTasDuration($this->tas_duration);
- $this->tas_can_delete_docs = $rs->getString($startcol + 27);
+ $copyObj->setTasDelayType($this->tas_delay_type);
- $this->tas_self_service = $rs->getString($startcol + 28);
+ $copyObj->setTasTemporizer($this->tas_temporizer);
- $this->tas_start = $rs->getString($startcol + 29);
+ $copyObj->setTasTypeDay($this->tas_type_day);
- $this->tas_to_last_user = $rs->getString($startcol + 30);
+ $copyObj->setTasTimeunit($this->tas_timeunit);
- $this->tas_send_last_email = $rs->getString($startcol + 31);
+ $copyObj->setTasAlert($this->tas_alert);
- $this->tas_derivation = $rs->getString($startcol + 32);
+ $copyObj->setTasPriorityVariable($this->tas_priority_variable);
- $this->tas_posx = $rs->getInt($startcol + 33);
+ $copyObj->setTasAssignType($this->tas_assign_type);
- $this->tas_posy = $rs->getInt($startcol + 34);
+ $copyObj->setTasAssignVariable($this->tas_assign_variable);
- $this->tas_width = $rs->getInt($startcol + 35);
+ $copyObj->setTasMiInstanceVariable($this->tas_mi_instance_variable);
- $this->tas_height = $rs->getInt($startcol + 36);
+ $copyObj->setTasMiCompleteVariable($this->tas_mi_complete_variable);
- $this->tas_color = $rs->getString($startcol + 37);
+ $copyObj->setTasAssignLocation($this->tas_assign_location);
- $this->tas_evn_uid = $rs->getString($startcol + 38);
+ $copyObj->setTasAssignLocationAdhoc($this->tas_assign_location_adhoc);
- $this->tas_boundary = $rs->getString($startcol + 39);
+ $copyObj->setTasTransferFly($this->tas_transfer_fly);
- $this->tas_derivation_screen_tpl = $rs->getString($startcol + 40);
+ $copyObj->setTasLastAssigned($this->tas_last_assigned);
- $this->resetModified();
+ $copyObj->setTasUser($this->tas_user);
- $this->setNew(false);
+ $copyObj->setTasCanUpload($this->tas_can_upload);
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 41; // 41 = TaskPeer::NUM_COLUMNS - TaskPeer::NUM_LAZY_LOAD_COLUMNS).
+ $copyObj->setTasViewUpload($this->tas_view_upload);
- } catch (Exception $e) {
- throw new PropelException("Error populating Task object", $e);
- }
- }
+ $copyObj->setTasViewAdditionalDocumentation($this->tas_view_additional_documentation);
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
+ $copyObj->setTasCanCancel($this->tas_can_cancel);
- if ($con === null) {
- $con = Propel::getConnection(TaskPeer::DATABASE_NAME);
- }
+ $copyObj->setTasOwnerApp($this->tas_owner_app);
- try {
- $con->begin();
- TaskPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(TaskPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = TaskPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += TaskPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = TaskPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TaskPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getProUid();
- break;
- case 1:
- return $this->getTasUid();
- break;
- case 2:
- return $this->getTasType();
- break;
- case 3:
- return $this->getTasDuration();
- break;
- case 4:
- return $this->getTasDelayType();
- break;
- case 5:
- return $this->getTasTemporizer();
- break;
- case 6:
- return $this->getTasTypeDay();
- break;
- case 7:
- return $this->getTasTimeunit();
- break;
- case 8:
- return $this->getTasAlert();
- break;
- case 9:
- return $this->getTasPriorityVariable();
- break;
- case 10:
- return $this->getTasAssignType();
- break;
- case 11:
- return $this->getTasAssignVariable();
- break;
- case 12:
- return $this->getTasMiInstanceVariable();
- break;
- case 13:
- return $this->getTasMiCompleteVariable();
- break;
- case 14:
- return $this->getTasAssignLocation();
- break;
- case 15:
- return $this->getTasAssignLocationAdhoc();
- break;
- case 16:
- return $this->getTasTransferFly();
- break;
- case 17:
- return $this->getTasLastAssigned();
- break;
- case 18:
- return $this->getTasUser();
- break;
- case 19:
- return $this->getTasCanUpload();
- break;
- case 20:
- return $this->getTasViewUpload();
- break;
- case 21:
- return $this->getTasViewAdditionalDocumentation();
- break;
- case 22:
- return $this->getTasCanCancel();
- break;
- case 23:
- return $this->getTasOwnerApp();
- break;
- case 24:
- return $this->getStgUid();
- break;
- case 25:
- return $this->getTasCanPause();
- break;
- case 26:
- return $this->getTasCanSendMessage();
- break;
- case 27:
- return $this->getTasCanDeleteDocs();
- break;
- case 28:
- return $this->getTasSelfService();
- break;
- case 29:
- return $this->getTasStart();
- break;
- case 30:
- return $this->getTasToLastUser();
- break;
- case 31:
- return $this->getTasSendLastEmail();
- break;
- case 32:
- return $this->getTasDerivation();
- break;
- case 33:
- return $this->getTasPosx();
- break;
- case 34:
- return $this->getTasPosy();
- break;
- case 35:
- return $this->getTasWidth();
- break;
- case 36:
- return $this->getTasHeight();
- break;
- case 37:
- return $this->getTasColor();
- break;
- case 38:
- return $this->getTasEvnUid();
- break;
- case 39:
- return $this->getTasBoundary();
- break;
- case 40:
- return $this->getTasDerivationScreenTpl();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TaskPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getProUid(),
- $keys[1] => $this->getTasUid(),
- $keys[2] => $this->getTasType(),
- $keys[3] => $this->getTasDuration(),
- $keys[4] => $this->getTasDelayType(),
- $keys[5] => $this->getTasTemporizer(),
- $keys[6] => $this->getTasTypeDay(),
- $keys[7] => $this->getTasTimeunit(),
- $keys[8] => $this->getTasAlert(),
- $keys[9] => $this->getTasPriorityVariable(),
- $keys[10] => $this->getTasAssignType(),
- $keys[11] => $this->getTasAssignVariable(),
- $keys[12] => $this->getTasMiInstanceVariable(),
- $keys[13] => $this->getTasMiCompleteVariable(),
- $keys[14] => $this->getTasAssignLocation(),
- $keys[15] => $this->getTasAssignLocationAdhoc(),
- $keys[16] => $this->getTasTransferFly(),
- $keys[17] => $this->getTasLastAssigned(),
- $keys[18] => $this->getTasUser(),
- $keys[19] => $this->getTasCanUpload(),
- $keys[20] => $this->getTasViewUpload(),
- $keys[21] => $this->getTasViewAdditionalDocumentation(),
- $keys[22] => $this->getTasCanCancel(),
- $keys[23] => $this->getTasOwnerApp(),
- $keys[24] => $this->getStgUid(),
- $keys[25] => $this->getTasCanPause(),
- $keys[26] => $this->getTasCanSendMessage(),
- $keys[27] => $this->getTasCanDeleteDocs(),
- $keys[28] => $this->getTasSelfService(),
- $keys[29] => $this->getTasStart(),
- $keys[30] => $this->getTasToLastUser(),
- $keys[31] => $this->getTasSendLastEmail(),
- $keys[32] => $this->getTasDerivation(),
- $keys[33] => $this->getTasPosx(),
- $keys[34] => $this->getTasPosy(),
- $keys[35] => $this->getTasWidth(),
- $keys[36] => $this->getTasHeight(),
- $keys[37] => $this->getTasColor(),
- $keys[38] => $this->getTasEvnUid(),
- $keys[39] => $this->getTasBoundary(),
- $keys[40] => $this->getTasDerivationScreenTpl(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TaskPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setProUid($value);
- break;
- case 1:
- $this->setTasUid($value);
- break;
- case 2:
- $this->setTasType($value);
- break;
- case 3:
- $this->setTasDuration($value);
- break;
- case 4:
- $this->setTasDelayType($value);
- break;
- case 5:
- $this->setTasTemporizer($value);
- break;
- case 6:
- $this->setTasTypeDay($value);
- break;
- case 7:
- $this->setTasTimeunit($value);
- break;
- case 8:
- $this->setTasAlert($value);
- break;
- case 9:
- $this->setTasPriorityVariable($value);
- break;
- case 10:
- $this->setTasAssignType($value);
- break;
- case 11:
- $this->setTasAssignVariable($value);
- break;
- case 12:
- $this->setTasMiInstanceVariable($value);
- break;
- case 13:
- $this->setTasMiCompleteVariable($value);
- break;
- case 14:
- $this->setTasAssignLocation($value);
- break;
- case 15:
- $this->setTasAssignLocationAdhoc($value);
- break;
- case 16:
- $this->setTasTransferFly($value);
- break;
- case 17:
- $this->setTasLastAssigned($value);
- break;
- case 18:
- $this->setTasUser($value);
- break;
- case 19:
- $this->setTasCanUpload($value);
- break;
- case 20:
- $this->setTasViewUpload($value);
- break;
- case 21:
- $this->setTasViewAdditionalDocumentation($value);
- break;
- case 22:
- $this->setTasCanCancel($value);
- break;
- case 23:
- $this->setTasOwnerApp($value);
- break;
- case 24:
- $this->setStgUid($value);
- break;
- case 25:
- $this->setTasCanPause($value);
- break;
- case 26:
- $this->setTasCanSendMessage($value);
- break;
- case 27:
- $this->setTasCanDeleteDocs($value);
- break;
- case 28:
- $this->setTasSelfService($value);
- break;
- case 29:
- $this->setTasStart($value);
- break;
- case 30:
- $this->setTasToLastUser($value);
- break;
- case 31:
- $this->setTasSendLastEmail($value);
- break;
- case 32:
- $this->setTasDerivation($value);
- break;
- case 33:
- $this->setTasPosx($value);
- break;
- case 34:
- $this->setTasPosy($value);
- break;
- case 35:
- $this->setTasWidth($value);
- break;
- case 36:
- $this->setTasHeight($value);
- break;
- case 37:
- $this->setTasColor($value);
- break;
- case 38:
- $this->setTasEvnUid($value);
- break;
- case 39:
- $this->setTasBoundary($value);
- break;
- case 40:
- $this->setTasDerivationScreenTpl($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TaskPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setProUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setTasUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTasType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setTasDuration($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setTasDelayType($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setTasTemporizer($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setTasTypeDay($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setTasTimeunit($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setTasAlert($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setTasPriorityVariable($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setTasAssignType($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setTasAssignVariable($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setTasMiInstanceVariable($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setTasMiCompleteVariable($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setTasAssignLocation($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setTasAssignLocationAdhoc($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setTasTransferFly($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setTasLastAssigned($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setTasUser($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setTasCanUpload($arr[$keys[19]]);
- if (array_key_exists($keys[20], $arr)) $this->setTasViewUpload($arr[$keys[20]]);
- if (array_key_exists($keys[21], $arr)) $this->setTasViewAdditionalDocumentation($arr[$keys[21]]);
- if (array_key_exists($keys[22], $arr)) $this->setTasCanCancel($arr[$keys[22]]);
- if (array_key_exists($keys[23], $arr)) $this->setTasOwnerApp($arr[$keys[23]]);
- if (array_key_exists($keys[24], $arr)) $this->setStgUid($arr[$keys[24]]);
- if (array_key_exists($keys[25], $arr)) $this->setTasCanPause($arr[$keys[25]]);
- if (array_key_exists($keys[26], $arr)) $this->setTasCanSendMessage($arr[$keys[26]]);
- if (array_key_exists($keys[27], $arr)) $this->setTasCanDeleteDocs($arr[$keys[27]]);
- if (array_key_exists($keys[28], $arr)) $this->setTasSelfService($arr[$keys[28]]);
- if (array_key_exists($keys[29], $arr)) $this->setTasStart($arr[$keys[29]]);
- if (array_key_exists($keys[30], $arr)) $this->setTasToLastUser($arr[$keys[30]]);
- if (array_key_exists($keys[31], $arr)) $this->setTasSendLastEmail($arr[$keys[31]]);
- if (array_key_exists($keys[32], $arr)) $this->setTasDerivation($arr[$keys[32]]);
- if (array_key_exists($keys[33], $arr)) $this->setTasPosx($arr[$keys[33]]);
- if (array_key_exists($keys[34], $arr)) $this->setTasPosy($arr[$keys[34]]);
- if (array_key_exists($keys[35], $arr)) $this->setTasWidth($arr[$keys[35]]);
- if (array_key_exists($keys[36], $arr)) $this->setTasHeight($arr[$keys[36]]);
- if (array_key_exists($keys[37], $arr)) $this->setTasColor($arr[$keys[37]]);
- if (array_key_exists($keys[38], $arr)) $this->setTasEvnUid($arr[$keys[38]]);
- if (array_key_exists($keys[39], $arr)) $this->setTasBoundary($arr[$keys[39]]);
- if (array_key_exists($keys[40], $arr)) $this->setTasDerivationScreenTpl($arr[$keys[40]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(TaskPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(TaskPeer::PRO_UID)) $criteria->add(TaskPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(TaskPeer::TAS_UID)) $criteria->add(TaskPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(TaskPeer::TAS_TYPE)) $criteria->add(TaskPeer::TAS_TYPE, $this->tas_type);
- if ($this->isColumnModified(TaskPeer::TAS_DURATION)) $criteria->add(TaskPeer::TAS_DURATION, $this->tas_duration);
- if ($this->isColumnModified(TaskPeer::TAS_DELAY_TYPE)) $criteria->add(TaskPeer::TAS_DELAY_TYPE, $this->tas_delay_type);
- if ($this->isColumnModified(TaskPeer::TAS_TEMPORIZER)) $criteria->add(TaskPeer::TAS_TEMPORIZER, $this->tas_temporizer);
- if ($this->isColumnModified(TaskPeer::TAS_TYPE_DAY)) $criteria->add(TaskPeer::TAS_TYPE_DAY, $this->tas_type_day);
- if ($this->isColumnModified(TaskPeer::TAS_TIMEUNIT)) $criteria->add(TaskPeer::TAS_TIMEUNIT, $this->tas_timeunit);
- if ($this->isColumnModified(TaskPeer::TAS_ALERT)) $criteria->add(TaskPeer::TAS_ALERT, $this->tas_alert);
- if ($this->isColumnModified(TaskPeer::TAS_PRIORITY_VARIABLE)) $criteria->add(TaskPeer::TAS_PRIORITY_VARIABLE, $this->tas_priority_variable);
- if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_TYPE)) $criteria->add(TaskPeer::TAS_ASSIGN_TYPE, $this->tas_assign_type);
- if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_VARIABLE)) $criteria->add(TaskPeer::TAS_ASSIGN_VARIABLE, $this->tas_assign_variable);
- if ($this->isColumnModified(TaskPeer::TAS_MI_INSTANCE_VARIABLE)) $criteria->add(TaskPeer::TAS_MI_INSTANCE_VARIABLE, $this->tas_mi_instance_variable);
- if ($this->isColumnModified(TaskPeer::TAS_MI_COMPLETE_VARIABLE)) $criteria->add(TaskPeer::TAS_MI_COMPLETE_VARIABLE, $this->tas_mi_complete_variable);
- if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION)) $criteria->add(TaskPeer::TAS_ASSIGN_LOCATION, $this->tas_assign_location);
- if ($this->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC)) $criteria->add(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC, $this->tas_assign_location_adhoc);
- if ($this->isColumnModified(TaskPeer::TAS_TRANSFER_FLY)) $criteria->add(TaskPeer::TAS_TRANSFER_FLY, $this->tas_transfer_fly);
- if ($this->isColumnModified(TaskPeer::TAS_LAST_ASSIGNED)) $criteria->add(TaskPeer::TAS_LAST_ASSIGNED, $this->tas_last_assigned);
- if ($this->isColumnModified(TaskPeer::TAS_USER)) $criteria->add(TaskPeer::TAS_USER, $this->tas_user);
- if ($this->isColumnModified(TaskPeer::TAS_CAN_UPLOAD)) $criteria->add(TaskPeer::TAS_CAN_UPLOAD, $this->tas_can_upload);
- if ($this->isColumnModified(TaskPeer::TAS_VIEW_UPLOAD)) $criteria->add(TaskPeer::TAS_VIEW_UPLOAD, $this->tas_view_upload);
- if ($this->isColumnModified(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION)) $criteria->add(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION, $this->tas_view_additional_documentation);
- if ($this->isColumnModified(TaskPeer::TAS_CAN_CANCEL)) $criteria->add(TaskPeer::TAS_CAN_CANCEL, $this->tas_can_cancel);
- if ($this->isColumnModified(TaskPeer::TAS_OWNER_APP)) $criteria->add(TaskPeer::TAS_OWNER_APP, $this->tas_owner_app);
- if ($this->isColumnModified(TaskPeer::STG_UID)) $criteria->add(TaskPeer::STG_UID, $this->stg_uid);
- if ($this->isColumnModified(TaskPeer::TAS_CAN_PAUSE)) $criteria->add(TaskPeer::TAS_CAN_PAUSE, $this->tas_can_pause);
- if ($this->isColumnModified(TaskPeer::TAS_CAN_SEND_MESSAGE)) $criteria->add(TaskPeer::TAS_CAN_SEND_MESSAGE, $this->tas_can_send_message);
- if ($this->isColumnModified(TaskPeer::TAS_CAN_DELETE_DOCS)) $criteria->add(TaskPeer::TAS_CAN_DELETE_DOCS, $this->tas_can_delete_docs);
- if ($this->isColumnModified(TaskPeer::TAS_SELF_SERVICE)) $criteria->add(TaskPeer::TAS_SELF_SERVICE, $this->tas_self_service);
- if ($this->isColumnModified(TaskPeer::TAS_START)) $criteria->add(TaskPeer::TAS_START, $this->tas_start);
- if ($this->isColumnModified(TaskPeer::TAS_TO_LAST_USER)) $criteria->add(TaskPeer::TAS_TO_LAST_USER, $this->tas_to_last_user);
- if ($this->isColumnModified(TaskPeer::TAS_SEND_LAST_EMAIL)) $criteria->add(TaskPeer::TAS_SEND_LAST_EMAIL, $this->tas_send_last_email);
- if ($this->isColumnModified(TaskPeer::TAS_DERIVATION)) $criteria->add(TaskPeer::TAS_DERIVATION, $this->tas_derivation);
- if ($this->isColumnModified(TaskPeer::TAS_POSX)) $criteria->add(TaskPeer::TAS_POSX, $this->tas_posx);
- if ($this->isColumnModified(TaskPeer::TAS_POSY)) $criteria->add(TaskPeer::TAS_POSY, $this->tas_posy);
- if ($this->isColumnModified(TaskPeer::TAS_WIDTH)) $criteria->add(TaskPeer::TAS_WIDTH, $this->tas_width);
- if ($this->isColumnModified(TaskPeer::TAS_HEIGHT)) $criteria->add(TaskPeer::TAS_HEIGHT, $this->tas_height);
- if ($this->isColumnModified(TaskPeer::TAS_COLOR)) $criteria->add(TaskPeer::TAS_COLOR, $this->tas_color);
- if ($this->isColumnModified(TaskPeer::TAS_EVN_UID)) $criteria->add(TaskPeer::TAS_EVN_UID, $this->tas_evn_uid);
- if ($this->isColumnModified(TaskPeer::TAS_BOUNDARY)) $criteria->add(TaskPeer::TAS_BOUNDARY, $this->tas_boundary);
- if ($this->isColumnModified(TaskPeer::TAS_DERIVATION_SCREEN_TPL)) $criteria->add(TaskPeer::TAS_DERIVATION_SCREEN_TPL, $this->tas_derivation_screen_tpl);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(TaskPeer::DATABASE_NAME);
-
- $criteria->add(TaskPeer::TAS_UID, $this->tas_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getTasUid();
- }
-
- /**
- * Generic method to set the primary key (tas_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setTasUid($key);
- }
+ $copyObj->setStgUid($this->stg_uid);
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Task (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
+ $copyObj->setTasCanPause($this->tas_can_pause);
- $copyObj->setProUid($this->pro_uid);
+ $copyObj->setTasCanSendMessage($this->tas_can_send_message);
- $copyObj->setTasType($this->tas_type);
+ $copyObj->setTasCanDeleteDocs($this->tas_can_delete_docs);
- $copyObj->setTasDuration($this->tas_duration);
+ $copyObj->setTasSelfService($this->tas_self_service);
- $copyObj->setTasDelayType($this->tas_delay_type);
+ $copyObj->setTasStart($this->tas_start);
- $copyObj->setTasTemporizer($this->tas_temporizer);
+ $copyObj->setTasToLastUser($this->tas_to_last_user);
- $copyObj->setTasTypeDay($this->tas_type_day);
+ $copyObj->setTasSendLastEmail($this->tas_send_last_email);
- $copyObj->setTasTimeunit($this->tas_timeunit);
+ $copyObj->setTasDerivation($this->tas_derivation);
- $copyObj->setTasAlert($this->tas_alert);
+ $copyObj->setTasPosx($this->tas_posx);
- $copyObj->setTasPriorityVariable($this->tas_priority_variable);
+ $copyObj->setTasPosy($this->tas_posy);
- $copyObj->setTasAssignType($this->tas_assign_type);
+ $copyObj->setTasWidth($this->tas_width);
- $copyObj->setTasAssignVariable($this->tas_assign_variable);
+ $copyObj->setTasHeight($this->tas_height);
- $copyObj->setTasMiInstanceVariable($this->tas_mi_instance_variable);
+ $copyObj->setTasColor($this->tas_color);
- $copyObj->setTasMiCompleteVariable($this->tas_mi_complete_variable);
+ $copyObj->setTasEvnUid($this->tas_evn_uid);
- $copyObj->setTasAssignLocation($this->tas_assign_location);
+ $copyObj->setTasBoundary($this->tas_boundary);
- $copyObj->setTasAssignLocationAdhoc($this->tas_assign_location_adhoc);
+ $copyObj->setTasDerivationScreenTpl($this->tas_derivation_screen_tpl);
- $copyObj->setTasTransferFly($this->tas_transfer_fly);
- $copyObj->setTasLastAssigned($this->tas_last_assigned);
+ $copyObj->setNew(true);
- $copyObj->setTasUser($this->tas_user);
+ $copyObj->setTasUid(''); // this is a pkey column, so set to default value
- $copyObj->setTasCanUpload($this->tas_can_upload);
+ }
- $copyObj->setTasViewUpload($this->tas_view_upload);
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Task Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
- $copyObj->setTasViewAdditionalDocumentation($this->tas_view_additional_documentation);
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return TaskPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new TaskPeer();
+ }
+ return self::$peer;
+ }
+}
- $copyObj->setTasCanCancel($this->tas_can_cancel);
-
- $copyObj->setTasOwnerApp($this->tas_owner_app);
-
- $copyObj->setStgUid($this->stg_uid);
-
- $copyObj->setTasCanPause($this->tas_can_pause);
-
- $copyObj->setTasCanSendMessage($this->tas_can_send_message);
-
- $copyObj->setTasCanDeleteDocs($this->tas_can_delete_docs);
-
- $copyObj->setTasSelfService($this->tas_self_service);
-
- $copyObj->setTasStart($this->tas_start);
-
- $copyObj->setTasToLastUser($this->tas_to_last_user);
-
- $copyObj->setTasSendLastEmail($this->tas_send_last_email);
-
- $copyObj->setTasDerivation($this->tas_derivation);
-
- $copyObj->setTasPosx($this->tas_posx);
-
- $copyObj->setTasPosy($this->tas_posy);
-
- $copyObj->setTasWidth($this->tas_width);
-
- $copyObj->setTasHeight($this->tas_height);
-
- $copyObj->setTasColor($this->tas_color);
-
- $copyObj->setTasEvnUid($this->tas_evn_uid);
-
- $copyObj->setTasBoundary($this->tas_boundary);
-
- $copyObj->setTasDerivationScreenTpl($this->tas_derivation_screen_tpl);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setTasUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Task Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return TaskPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new TaskPeer();
- }
- return self::$peer;
- }
-
-} // BaseTask
diff --git a/workflow/engine/classes/model/om/BaseTaskPeer.php b/workflow/engine/classes/model/om/BaseTaskPeer.php
index 38c20fe0d..e0a034320 100755
--- a/workflow/engine/classes/model/om/BaseTaskPeer.php
+++ b/workflow/engine/classes/model/om/BaseTaskPeer.php
@@ -12,811 +12,813 @@ include_once 'classes/model/Task.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTaskPeer {
+abstract class BaseTaskPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'TASK';
+ /** the table name for this class */
+ const TABLE_NAME = 'TASK';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Task';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Task';
- /** The total number of columns. */
- const NUM_COLUMNS = 41;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 41;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the PRO_UID field */
- const PRO_UID = 'TASK.PRO_UID';
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'TASK.PRO_UID';
- /** the column name for the TAS_UID field */
- const TAS_UID = 'TASK.TAS_UID';
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'TASK.TAS_UID';
- /** the column name for the TAS_TYPE field */
- const TAS_TYPE = 'TASK.TAS_TYPE';
+ /** the column name for the TAS_TYPE field */
+ const TAS_TYPE = 'TASK.TAS_TYPE';
- /** the column name for the TAS_DURATION field */
- const TAS_DURATION = 'TASK.TAS_DURATION';
+ /** the column name for the TAS_DURATION field */
+ const TAS_DURATION = 'TASK.TAS_DURATION';
- /** the column name for the TAS_DELAY_TYPE field */
- const TAS_DELAY_TYPE = 'TASK.TAS_DELAY_TYPE';
+ /** the column name for the TAS_DELAY_TYPE field */
+ const TAS_DELAY_TYPE = 'TASK.TAS_DELAY_TYPE';
- /** the column name for the TAS_TEMPORIZER field */
- const TAS_TEMPORIZER = 'TASK.TAS_TEMPORIZER';
+ /** the column name for the TAS_TEMPORIZER field */
+ const TAS_TEMPORIZER = 'TASK.TAS_TEMPORIZER';
- /** the column name for the TAS_TYPE_DAY field */
- const TAS_TYPE_DAY = 'TASK.TAS_TYPE_DAY';
+ /** the column name for the TAS_TYPE_DAY field */
+ const TAS_TYPE_DAY = 'TASK.TAS_TYPE_DAY';
- /** the column name for the TAS_TIMEUNIT field */
- const TAS_TIMEUNIT = 'TASK.TAS_TIMEUNIT';
+ /** the column name for the TAS_TIMEUNIT field */
+ const TAS_TIMEUNIT = 'TASK.TAS_TIMEUNIT';
- /** the column name for the TAS_ALERT field */
- const TAS_ALERT = 'TASK.TAS_ALERT';
+ /** the column name for the TAS_ALERT field */
+ const TAS_ALERT = 'TASK.TAS_ALERT';
- /** the column name for the TAS_PRIORITY_VARIABLE field */
- const TAS_PRIORITY_VARIABLE = 'TASK.TAS_PRIORITY_VARIABLE';
+ /** the column name for the TAS_PRIORITY_VARIABLE field */
+ const TAS_PRIORITY_VARIABLE = 'TASK.TAS_PRIORITY_VARIABLE';
- /** the column name for the TAS_ASSIGN_TYPE field */
- const TAS_ASSIGN_TYPE = 'TASK.TAS_ASSIGN_TYPE';
+ /** the column name for the TAS_ASSIGN_TYPE field */
+ const TAS_ASSIGN_TYPE = 'TASK.TAS_ASSIGN_TYPE';
- /** the column name for the TAS_ASSIGN_VARIABLE field */
- const TAS_ASSIGN_VARIABLE = 'TASK.TAS_ASSIGN_VARIABLE';
+ /** the column name for the TAS_ASSIGN_VARIABLE field */
+ const TAS_ASSIGN_VARIABLE = 'TASK.TAS_ASSIGN_VARIABLE';
- /** the column name for the TAS_MI_INSTANCE_VARIABLE field */
- const TAS_MI_INSTANCE_VARIABLE = 'TASK.TAS_MI_INSTANCE_VARIABLE';
+ /** the column name for the TAS_MI_INSTANCE_VARIABLE field */
+ const TAS_MI_INSTANCE_VARIABLE = 'TASK.TAS_MI_INSTANCE_VARIABLE';
- /** the column name for the TAS_MI_COMPLETE_VARIABLE field */
- const TAS_MI_COMPLETE_VARIABLE = 'TASK.TAS_MI_COMPLETE_VARIABLE';
+ /** the column name for the TAS_MI_COMPLETE_VARIABLE field */
+ const TAS_MI_COMPLETE_VARIABLE = 'TASK.TAS_MI_COMPLETE_VARIABLE';
- /** the column name for the TAS_ASSIGN_LOCATION field */
- const TAS_ASSIGN_LOCATION = 'TASK.TAS_ASSIGN_LOCATION';
+ /** the column name for the TAS_ASSIGN_LOCATION field */
+ const TAS_ASSIGN_LOCATION = 'TASK.TAS_ASSIGN_LOCATION';
- /** the column name for the TAS_ASSIGN_LOCATION_ADHOC field */
- const TAS_ASSIGN_LOCATION_ADHOC = 'TASK.TAS_ASSIGN_LOCATION_ADHOC';
+ /** the column name for the TAS_ASSIGN_LOCATION_ADHOC field */
+ const TAS_ASSIGN_LOCATION_ADHOC = 'TASK.TAS_ASSIGN_LOCATION_ADHOC';
- /** the column name for the TAS_TRANSFER_FLY field */
- const TAS_TRANSFER_FLY = 'TASK.TAS_TRANSFER_FLY';
+ /** the column name for the TAS_TRANSFER_FLY field */
+ const TAS_TRANSFER_FLY = 'TASK.TAS_TRANSFER_FLY';
- /** the column name for the TAS_LAST_ASSIGNED field */
- const TAS_LAST_ASSIGNED = 'TASK.TAS_LAST_ASSIGNED';
+ /** the column name for the TAS_LAST_ASSIGNED field */
+ const TAS_LAST_ASSIGNED = 'TASK.TAS_LAST_ASSIGNED';
- /** the column name for the TAS_USER field */
- const TAS_USER = 'TASK.TAS_USER';
+ /** the column name for the TAS_USER field */
+ const TAS_USER = 'TASK.TAS_USER';
- /** the column name for the TAS_CAN_UPLOAD field */
- const TAS_CAN_UPLOAD = 'TASK.TAS_CAN_UPLOAD';
+ /** the column name for the TAS_CAN_UPLOAD field */
+ const TAS_CAN_UPLOAD = 'TASK.TAS_CAN_UPLOAD';
- /** the column name for the TAS_VIEW_UPLOAD field */
- const TAS_VIEW_UPLOAD = 'TASK.TAS_VIEW_UPLOAD';
+ /** the column name for the TAS_VIEW_UPLOAD field */
+ const TAS_VIEW_UPLOAD = 'TASK.TAS_VIEW_UPLOAD';
- /** the column name for the TAS_VIEW_ADDITIONAL_DOCUMENTATION field */
- const TAS_VIEW_ADDITIONAL_DOCUMENTATION = 'TASK.TAS_VIEW_ADDITIONAL_DOCUMENTATION';
+ /** the column name for the TAS_VIEW_ADDITIONAL_DOCUMENTATION field */
+ const TAS_VIEW_ADDITIONAL_DOCUMENTATION = 'TASK.TAS_VIEW_ADDITIONAL_DOCUMENTATION';
- /** the column name for the TAS_CAN_CANCEL field */
- const TAS_CAN_CANCEL = 'TASK.TAS_CAN_CANCEL';
+ /** the column name for the TAS_CAN_CANCEL field */
+ const TAS_CAN_CANCEL = 'TASK.TAS_CAN_CANCEL';
- /** the column name for the TAS_OWNER_APP field */
- const TAS_OWNER_APP = 'TASK.TAS_OWNER_APP';
+ /** the column name for the TAS_OWNER_APP field */
+ const TAS_OWNER_APP = 'TASK.TAS_OWNER_APP';
- /** the column name for the STG_UID field */
- const STG_UID = 'TASK.STG_UID';
+ /** the column name for the STG_UID field */
+ const STG_UID = 'TASK.STG_UID';
- /** the column name for the TAS_CAN_PAUSE field */
- const TAS_CAN_PAUSE = 'TASK.TAS_CAN_PAUSE';
+ /** the column name for the TAS_CAN_PAUSE field */
+ const TAS_CAN_PAUSE = 'TASK.TAS_CAN_PAUSE';
- /** the column name for the TAS_CAN_SEND_MESSAGE field */
- const TAS_CAN_SEND_MESSAGE = 'TASK.TAS_CAN_SEND_MESSAGE';
+ /** the column name for the TAS_CAN_SEND_MESSAGE field */
+ const TAS_CAN_SEND_MESSAGE = 'TASK.TAS_CAN_SEND_MESSAGE';
- /** the column name for the TAS_CAN_DELETE_DOCS field */
- const TAS_CAN_DELETE_DOCS = 'TASK.TAS_CAN_DELETE_DOCS';
+ /** the column name for the TAS_CAN_DELETE_DOCS field */
+ const TAS_CAN_DELETE_DOCS = 'TASK.TAS_CAN_DELETE_DOCS';
- /** the column name for the TAS_SELF_SERVICE field */
- const TAS_SELF_SERVICE = 'TASK.TAS_SELF_SERVICE';
+ /** the column name for the TAS_SELF_SERVICE field */
+ const TAS_SELF_SERVICE = 'TASK.TAS_SELF_SERVICE';
- /** the column name for the TAS_START field */
- const TAS_START = 'TASK.TAS_START';
+ /** the column name for the TAS_START field */
+ const TAS_START = 'TASK.TAS_START';
- /** the column name for the TAS_TO_LAST_USER field */
- const TAS_TO_LAST_USER = 'TASK.TAS_TO_LAST_USER';
-
- /** the column name for the TAS_SEND_LAST_EMAIL field */
- const TAS_SEND_LAST_EMAIL = 'TASK.TAS_SEND_LAST_EMAIL';
-
- /** the column name for the TAS_DERIVATION field */
- const TAS_DERIVATION = 'TASK.TAS_DERIVATION';
-
- /** the column name for the TAS_POSX field */
- const TAS_POSX = 'TASK.TAS_POSX';
-
- /** the column name for the TAS_POSY field */
- const TAS_POSY = 'TASK.TAS_POSY';
-
- /** the column name for the TAS_WIDTH field */
- const TAS_WIDTH = 'TASK.TAS_WIDTH';
-
- /** the column name for the TAS_HEIGHT field */
- const TAS_HEIGHT = 'TASK.TAS_HEIGHT';
-
- /** the column name for the TAS_COLOR field */
- const TAS_COLOR = 'TASK.TAS_COLOR';
-
- /** the column name for the TAS_EVN_UID field */
- const TAS_EVN_UID = 'TASK.TAS_EVN_UID';
-
- /** the column name for the TAS_BOUNDARY field */
- const TAS_BOUNDARY = 'TASK.TAS_BOUNDARY';
-
- /** the column name for the TAS_DERIVATION_SCREEN_TPL field */
- const TAS_DERIVATION_SCREEN_TPL = 'TASK.TAS_DERIVATION_SCREEN_TPL';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('ProUid', 'TasUid', 'TasType', 'TasDuration', 'TasDelayType', 'TasTemporizer', 'TasTypeDay', 'TasTimeunit', 'TasAlert', 'TasPriorityVariable', 'TasAssignType', 'TasAssignVariable', 'TasMiInstanceVariable', 'TasMiCompleteVariable', 'TasAssignLocation', 'TasAssignLocationAdhoc', 'TasTransferFly', 'TasLastAssigned', 'TasUser', 'TasCanUpload', 'TasViewUpload', 'TasViewAdditionalDocumentation', 'TasCanCancel', 'TasOwnerApp', 'StgUid', 'TasCanPause', 'TasCanSendMessage', 'TasCanDeleteDocs', 'TasSelfService', 'TasStart', 'TasToLastUser', 'TasSendLastEmail', 'TasDerivation', 'TasPosx', 'TasPosy', 'TasWidth', 'TasHeight', 'TasColor', 'TasEvnUid', 'TasBoundary', 'TasDerivationScreenTpl', ),
- BasePeer::TYPE_COLNAME => array (TaskPeer::PRO_UID, TaskPeer::TAS_UID, TaskPeer::TAS_TYPE, TaskPeer::TAS_DURATION, TaskPeer::TAS_DELAY_TYPE, TaskPeer::TAS_TEMPORIZER, TaskPeer::TAS_TYPE_DAY, TaskPeer::TAS_TIMEUNIT, TaskPeer::TAS_ALERT, TaskPeer::TAS_PRIORITY_VARIABLE, TaskPeer::TAS_ASSIGN_TYPE, TaskPeer::TAS_ASSIGN_VARIABLE, TaskPeer::TAS_MI_INSTANCE_VARIABLE, TaskPeer::TAS_MI_COMPLETE_VARIABLE, TaskPeer::TAS_ASSIGN_LOCATION, TaskPeer::TAS_ASSIGN_LOCATION_ADHOC, TaskPeer::TAS_TRANSFER_FLY, TaskPeer::TAS_LAST_ASSIGNED, TaskPeer::TAS_USER, TaskPeer::TAS_CAN_UPLOAD, TaskPeer::TAS_VIEW_UPLOAD, TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION, TaskPeer::TAS_CAN_CANCEL, TaskPeer::TAS_OWNER_APP, TaskPeer::STG_UID, TaskPeer::TAS_CAN_PAUSE, TaskPeer::TAS_CAN_SEND_MESSAGE, TaskPeer::TAS_CAN_DELETE_DOCS, TaskPeer::TAS_SELF_SERVICE, TaskPeer::TAS_START, TaskPeer::TAS_TO_LAST_USER, TaskPeer::TAS_SEND_LAST_EMAIL, TaskPeer::TAS_DERIVATION, TaskPeer::TAS_POSX, TaskPeer::TAS_POSY, TaskPeer::TAS_WIDTH, TaskPeer::TAS_HEIGHT, TaskPeer::TAS_COLOR, TaskPeer::TAS_EVN_UID, TaskPeer::TAS_BOUNDARY, TaskPeer::TAS_DERIVATION_SCREEN_TPL, ),
- BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'TAS_UID', 'TAS_TYPE', 'TAS_DURATION', 'TAS_DELAY_TYPE', 'TAS_TEMPORIZER', 'TAS_TYPE_DAY', 'TAS_TIMEUNIT', 'TAS_ALERT', 'TAS_PRIORITY_VARIABLE', 'TAS_ASSIGN_TYPE', 'TAS_ASSIGN_VARIABLE', 'TAS_MI_INSTANCE_VARIABLE', 'TAS_MI_COMPLETE_VARIABLE', 'TAS_ASSIGN_LOCATION', 'TAS_ASSIGN_LOCATION_ADHOC', 'TAS_TRANSFER_FLY', 'TAS_LAST_ASSIGNED', 'TAS_USER', 'TAS_CAN_UPLOAD', 'TAS_VIEW_UPLOAD', 'TAS_VIEW_ADDITIONAL_DOCUMENTATION', 'TAS_CAN_CANCEL', 'TAS_OWNER_APP', 'STG_UID', 'TAS_CAN_PAUSE', 'TAS_CAN_SEND_MESSAGE', 'TAS_CAN_DELETE_DOCS', 'TAS_SELF_SERVICE', 'TAS_START', 'TAS_TO_LAST_USER', 'TAS_SEND_LAST_EMAIL', 'TAS_DERIVATION', 'TAS_POSX', 'TAS_POSY', 'TAS_WIDTH', 'TAS_HEIGHT', 'TAS_COLOR', 'TAS_EVN_UID', 'TAS_BOUNDARY', 'TAS_DERIVATION_SCREEN_TPL', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'TasUid' => 1, 'TasType' => 2, 'TasDuration' => 3, 'TasDelayType' => 4, 'TasTemporizer' => 5, 'TasTypeDay' => 6, 'TasTimeunit' => 7, 'TasAlert' => 8, 'TasPriorityVariable' => 9, 'TasAssignType' => 10, 'TasAssignVariable' => 11, 'TasMiInstanceVariable' => 12, 'TasMiCompleteVariable' => 13, 'TasAssignLocation' => 14, 'TasAssignLocationAdhoc' => 15, 'TasTransferFly' => 16, 'TasLastAssigned' => 17, 'TasUser' => 18, 'TasCanUpload' => 19, 'TasViewUpload' => 20, 'TasViewAdditionalDocumentation' => 21, 'TasCanCancel' => 22, 'TasOwnerApp' => 23, 'StgUid' => 24, 'TasCanPause' => 25, 'TasCanSendMessage' => 26, 'TasCanDeleteDocs' => 27, 'TasSelfService' => 28, 'TasStart' => 29, 'TasToLastUser' => 30, 'TasSendLastEmail' => 31, 'TasDerivation' => 32, 'TasPosx' => 33, 'TasPosy' => 34, 'TasWidth' => 35, 'TasHeight' => 36, 'TasColor' => 37, 'TasEvnUid' => 38, 'TasBoundary' => 39, 'TasDerivationScreenTpl' => 40, ),
- BasePeer::TYPE_COLNAME => array (TaskPeer::PRO_UID => 0, TaskPeer::TAS_UID => 1, TaskPeer::TAS_TYPE => 2, TaskPeer::TAS_DURATION => 3, TaskPeer::TAS_DELAY_TYPE => 4, TaskPeer::TAS_TEMPORIZER => 5, TaskPeer::TAS_TYPE_DAY => 6, TaskPeer::TAS_TIMEUNIT => 7, TaskPeer::TAS_ALERT => 8, TaskPeer::TAS_PRIORITY_VARIABLE => 9, TaskPeer::TAS_ASSIGN_TYPE => 10, TaskPeer::TAS_ASSIGN_VARIABLE => 11, TaskPeer::TAS_MI_INSTANCE_VARIABLE => 12, TaskPeer::TAS_MI_COMPLETE_VARIABLE => 13, TaskPeer::TAS_ASSIGN_LOCATION => 14, TaskPeer::TAS_ASSIGN_LOCATION_ADHOC => 15, TaskPeer::TAS_TRANSFER_FLY => 16, TaskPeer::TAS_LAST_ASSIGNED => 17, TaskPeer::TAS_USER => 18, TaskPeer::TAS_CAN_UPLOAD => 19, TaskPeer::TAS_VIEW_UPLOAD => 20, TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION => 21, TaskPeer::TAS_CAN_CANCEL => 22, TaskPeer::TAS_OWNER_APP => 23, TaskPeer::STG_UID => 24, TaskPeer::TAS_CAN_PAUSE => 25, TaskPeer::TAS_CAN_SEND_MESSAGE => 26, TaskPeer::TAS_CAN_DELETE_DOCS => 27, TaskPeer::TAS_SELF_SERVICE => 28, TaskPeer::TAS_START => 29, TaskPeer::TAS_TO_LAST_USER => 30, TaskPeer::TAS_SEND_LAST_EMAIL => 31, TaskPeer::TAS_DERIVATION => 32, TaskPeer::TAS_POSX => 33, TaskPeer::TAS_POSY => 34, TaskPeer::TAS_WIDTH => 35, TaskPeer::TAS_HEIGHT => 36, TaskPeer::TAS_COLOR => 37, TaskPeer::TAS_EVN_UID => 38, TaskPeer::TAS_BOUNDARY => 39, TaskPeer::TAS_DERIVATION_SCREEN_TPL => 40, ),
- BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'TAS_UID' => 1, 'TAS_TYPE' => 2, 'TAS_DURATION' => 3, 'TAS_DELAY_TYPE' => 4, 'TAS_TEMPORIZER' => 5, 'TAS_TYPE_DAY' => 6, 'TAS_TIMEUNIT' => 7, 'TAS_ALERT' => 8, 'TAS_PRIORITY_VARIABLE' => 9, 'TAS_ASSIGN_TYPE' => 10, 'TAS_ASSIGN_VARIABLE' => 11, 'TAS_MI_INSTANCE_VARIABLE' => 12, 'TAS_MI_COMPLETE_VARIABLE' => 13, 'TAS_ASSIGN_LOCATION' => 14, 'TAS_ASSIGN_LOCATION_ADHOC' => 15, 'TAS_TRANSFER_FLY' => 16, 'TAS_LAST_ASSIGNED' => 17, 'TAS_USER' => 18, 'TAS_CAN_UPLOAD' => 19, 'TAS_VIEW_UPLOAD' => 20, 'TAS_VIEW_ADDITIONAL_DOCUMENTATION' => 21, 'TAS_CAN_CANCEL' => 22, 'TAS_OWNER_APP' => 23, 'STG_UID' => 24, 'TAS_CAN_PAUSE' => 25, 'TAS_CAN_SEND_MESSAGE' => 26, 'TAS_CAN_DELETE_DOCS' => 27, 'TAS_SELF_SERVICE' => 28, 'TAS_START' => 29, 'TAS_TO_LAST_USER' => 30, 'TAS_SEND_LAST_EMAIL' => 31, 'TAS_DERIVATION' => 32, 'TAS_POSX' => 33, 'TAS_POSY' => 34, 'TAS_WIDTH' => 35, 'TAS_HEIGHT' => 36, 'TAS_COLOR' => 37, 'TAS_EVN_UID' => 38, 'TAS_BOUNDARY' => 39, 'TAS_DERIVATION_SCREEN_TPL' => 40, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/TaskMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.TaskMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = TaskPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. TaskPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(TaskPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
+ /** the column name for the TAS_TO_LAST_USER field */
+ const TAS_TO_LAST_USER = 'TASK.TAS_TO_LAST_USER';
+
+ /** the column name for the TAS_SEND_LAST_EMAIL field */
+ const TAS_SEND_LAST_EMAIL = 'TASK.TAS_SEND_LAST_EMAIL';
+
+ /** the column name for the TAS_DERIVATION field */
+ const TAS_DERIVATION = 'TASK.TAS_DERIVATION';
+
+ /** the column name for the TAS_POSX field */
+ const TAS_POSX = 'TASK.TAS_POSX';
+
+ /** the column name for the TAS_POSY field */
+ const TAS_POSY = 'TASK.TAS_POSY';
+
+ /** the column name for the TAS_WIDTH field */
+ const TAS_WIDTH = 'TASK.TAS_WIDTH';
+
+ /** the column name for the TAS_HEIGHT field */
+ const TAS_HEIGHT = 'TASK.TAS_HEIGHT';
+
+ /** the column name for the TAS_COLOR field */
+ const TAS_COLOR = 'TASK.TAS_COLOR';
+
+ /** the column name for the TAS_EVN_UID field */
+ const TAS_EVN_UID = 'TASK.TAS_EVN_UID';
+
+ /** the column name for the TAS_BOUNDARY field */
+ const TAS_BOUNDARY = 'TASK.TAS_BOUNDARY';
+
+ /** the column name for the TAS_DERIVATION_SCREEN_TPL field */
+ const TAS_DERIVATION_SCREEN_TPL = 'TASK.TAS_DERIVATION_SCREEN_TPL';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('ProUid', 'TasUid', 'TasType', 'TasDuration', 'TasDelayType', 'TasTemporizer', 'TasTypeDay', 'TasTimeunit', 'TasAlert', 'TasPriorityVariable', 'TasAssignType', 'TasAssignVariable', 'TasMiInstanceVariable', 'TasMiCompleteVariable', 'TasAssignLocation', 'TasAssignLocationAdhoc', 'TasTransferFly', 'TasLastAssigned', 'TasUser', 'TasCanUpload', 'TasViewUpload', 'TasViewAdditionalDocumentation', 'TasCanCancel', 'TasOwnerApp', 'StgUid', 'TasCanPause', 'TasCanSendMessage', 'TasCanDeleteDocs', 'TasSelfService', 'TasStart', 'TasToLastUser', 'TasSendLastEmail', 'TasDerivation', 'TasPosx', 'TasPosy', 'TasWidth', 'TasHeight', 'TasColor', 'TasEvnUid', 'TasBoundary', 'TasDerivationScreenTpl', ),
+ BasePeer::TYPE_COLNAME => array (TaskPeer::PRO_UID, TaskPeer::TAS_UID, TaskPeer::TAS_TYPE, TaskPeer::TAS_DURATION, TaskPeer::TAS_DELAY_TYPE, TaskPeer::TAS_TEMPORIZER, TaskPeer::TAS_TYPE_DAY, TaskPeer::TAS_TIMEUNIT, TaskPeer::TAS_ALERT, TaskPeer::TAS_PRIORITY_VARIABLE, TaskPeer::TAS_ASSIGN_TYPE, TaskPeer::TAS_ASSIGN_VARIABLE, TaskPeer::TAS_MI_INSTANCE_VARIABLE, TaskPeer::TAS_MI_COMPLETE_VARIABLE, TaskPeer::TAS_ASSIGN_LOCATION, TaskPeer::TAS_ASSIGN_LOCATION_ADHOC, TaskPeer::TAS_TRANSFER_FLY, TaskPeer::TAS_LAST_ASSIGNED, TaskPeer::TAS_USER, TaskPeer::TAS_CAN_UPLOAD, TaskPeer::TAS_VIEW_UPLOAD, TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION, TaskPeer::TAS_CAN_CANCEL, TaskPeer::TAS_OWNER_APP, TaskPeer::STG_UID, TaskPeer::TAS_CAN_PAUSE, TaskPeer::TAS_CAN_SEND_MESSAGE, TaskPeer::TAS_CAN_DELETE_DOCS, TaskPeer::TAS_SELF_SERVICE, TaskPeer::TAS_START, TaskPeer::TAS_TO_LAST_USER, TaskPeer::TAS_SEND_LAST_EMAIL, TaskPeer::TAS_DERIVATION, TaskPeer::TAS_POSX, TaskPeer::TAS_POSY, TaskPeer::TAS_WIDTH, TaskPeer::TAS_HEIGHT, TaskPeer::TAS_COLOR, TaskPeer::TAS_EVN_UID, TaskPeer::TAS_BOUNDARY, TaskPeer::TAS_DERIVATION_SCREEN_TPL, ),
+ BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'TAS_UID', 'TAS_TYPE', 'TAS_DURATION', 'TAS_DELAY_TYPE', 'TAS_TEMPORIZER', 'TAS_TYPE_DAY', 'TAS_TIMEUNIT', 'TAS_ALERT', 'TAS_PRIORITY_VARIABLE', 'TAS_ASSIGN_TYPE', 'TAS_ASSIGN_VARIABLE', 'TAS_MI_INSTANCE_VARIABLE', 'TAS_MI_COMPLETE_VARIABLE', 'TAS_ASSIGN_LOCATION', 'TAS_ASSIGN_LOCATION_ADHOC', 'TAS_TRANSFER_FLY', 'TAS_LAST_ASSIGNED', 'TAS_USER', 'TAS_CAN_UPLOAD', 'TAS_VIEW_UPLOAD', 'TAS_VIEW_ADDITIONAL_DOCUMENTATION', 'TAS_CAN_CANCEL', 'TAS_OWNER_APP', 'STG_UID', 'TAS_CAN_PAUSE', 'TAS_CAN_SEND_MESSAGE', 'TAS_CAN_DELETE_DOCS', 'TAS_SELF_SERVICE', 'TAS_START', 'TAS_TO_LAST_USER', 'TAS_SEND_LAST_EMAIL', 'TAS_DERIVATION', 'TAS_POSX', 'TAS_POSY', 'TAS_WIDTH', 'TAS_HEIGHT', 'TAS_COLOR', 'TAS_EVN_UID', 'TAS_BOUNDARY', 'TAS_DERIVATION_SCREEN_TPL', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'TasUid' => 1, 'TasType' => 2, 'TasDuration' => 3, 'TasDelayType' => 4, 'TasTemporizer' => 5, 'TasTypeDay' => 6, 'TasTimeunit' => 7, 'TasAlert' => 8, 'TasPriorityVariable' => 9, 'TasAssignType' => 10, 'TasAssignVariable' => 11, 'TasMiInstanceVariable' => 12, 'TasMiCompleteVariable' => 13, 'TasAssignLocation' => 14, 'TasAssignLocationAdhoc' => 15, 'TasTransferFly' => 16, 'TasLastAssigned' => 17, 'TasUser' => 18, 'TasCanUpload' => 19, 'TasViewUpload' => 20, 'TasViewAdditionalDocumentation' => 21, 'TasCanCancel' => 22, 'TasOwnerApp' => 23, 'StgUid' => 24, 'TasCanPause' => 25, 'TasCanSendMessage' => 26, 'TasCanDeleteDocs' => 27, 'TasSelfService' => 28, 'TasStart' => 29, 'TasToLastUser' => 30, 'TasSendLastEmail' => 31, 'TasDerivation' => 32, 'TasPosx' => 33, 'TasPosy' => 34, 'TasWidth' => 35, 'TasHeight' => 36, 'TasColor' => 37, 'TasEvnUid' => 38, 'TasBoundary' => 39, 'TasDerivationScreenTpl' => 40, ),
+ BasePeer::TYPE_COLNAME => array (TaskPeer::PRO_UID => 0, TaskPeer::TAS_UID => 1, TaskPeer::TAS_TYPE => 2, TaskPeer::TAS_DURATION => 3, TaskPeer::TAS_DELAY_TYPE => 4, TaskPeer::TAS_TEMPORIZER => 5, TaskPeer::TAS_TYPE_DAY => 6, TaskPeer::TAS_TIMEUNIT => 7, TaskPeer::TAS_ALERT => 8, TaskPeer::TAS_PRIORITY_VARIABLE => 9, TaskPeer::TAS_ASSIGN_TYPE => 10, TaskPeer::TAS_ASSIGN_VARIABLE => 11, TaskPeer::TAS_MI_INSTANCE_VARIABLE => 12, TaskPeer::TAS_MI_COMPLETE_VARIABLE => 13, TaskPeer::TAS_ASSIGN_LOCATION => 14, TaskPeer::TAS_ASSIGN_LOCATION_ADHOC => 15, TaskPeer::TAS_TRANSFER_FLY => 16, TaskPeer::TAS_LAST_ASSIGNED => 17, TaskPeer::TAS_USER => 18, TaskPeer::TAS_CAN_UPLOAD => 19, TaskPeer::TAS_VIEW_UPLOAD => 20, TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION => 21, TaskPeer::TAS_CAN_CANCEL => 22, TaskPeer::TAS_OWNER_APP => 23, TaskPeer::STG_UID => 24, TaskPeer::TAS_CAN_PAUSE => 25, TaskPeer::TAS_CAN_SEND_MESSAGE => 26, TaskPeer::TAS_CAN_DELETE_DOCS => 27, TaskPeer::TAS_SELF_SERVICE => 28, TaskPeer::TAS_START => 29, TaskPeer::TAS_TO_LAST_USER => 30, TaskPeer::TAS_SEND_LAST_EMAIL => 31, TaskPeer::TAS_DERIVATION => 32, TaskPeer::TAS_POSX => 33, TaskPeer::TAS_POSY => 34, TaskPeer::TAS_WIDTH => 35, TaskPeer::TAS_HEIGHT => 36, TaskPeer::TAS_COLOR => 37, TaskPeer::TAS_EVN_UID => 38, TaskPeer::TAS_BOUNDARY => 39, TaskPeer::TAS_DERIVATION_SCREEN_TPL => 40, ),
+ BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'TAS_UID' => 1, 'TAS_TYPE' => 2, 'TAS_DURATION' => 3, 'TAS_DELAY_TYPE' => 4, 'TAS_TEMPORIZER' => 5, 'TAS_TYPE_DAY' => 6, 'TAS_TIMEUNIT' => 7, 'TAS_ALERT' => 8, 'TAS_PRIORITY_VARIABLE' => 9, 'TAS_ASSIGN_TYPE' => 10, 'TAS_ASSIGN_VARIABLE' => 11, 'TAS_MI_INSTANCE_VARIABLE' => 12, 'TAS_MI_COMPLETE_VARIABLE' => 13, 'TAS_ASSIGN_LOCATION' => 14, 'TAS_ASSIGN_LOCATION_ADHOC' => 15, 'TAS_TRANSFER_FLY' => 16, 'TAS_LAST_ASSIGNED' => 17, 'TAS_USER' => 18, 'TAS_CAN_UPLOAD' => 19, 'TAS_VIEW_UPLOAD' => 20, 'TAS_VIEW_ADDITIONAL_DOCUMENTATION' => 21, 'TAS_CAN_CANCEL' => 22, 'TAS_OWNER_APP' => 23, 'STG_UID' => 24, 'TAS_CAN_PAUSE' => 25, 'TAS_CAN_SEND_MESSAGE' => 26, 'TAS_CAN_DELETE_DOCS' => 27, 'TAS_SELF_SERVICE' => 28, 'TAS_START' => 29, 'TAS_TO_LAST_USER' => 30, 'TAS_SEND_LAST_EMAIL' => 31, 'TAS_DERIVATION' => 32, 'TAS_POSX' => 33, 'TAS_POSY' => 34, 'TAS_WIDTH' => 35, 'TAS_HEIGHT' => 36, 'TAS_COLOR' => 37, 'TAS_EVN_UID' => 38, 'TAS_BOUNDARY' => 39, 'TAS_DERIVATION_SCREEN_TPL' => 40, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/TaskMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.TaskMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = TaskPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. TaskPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(TaskPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
- $criteria->addSelectColumn(TaskPeer::PRO_UID);
+ $criteria->addSelectColumn(TaskPeer::PRO_UID);
- $criteria->addSelectColumn(TaskPeer::TAS_UID);
-
- $criteria->addSelectColumn(TaskPeer::TAS_TYPE);
-
- $criteria->addSelectColumn(TaskPeer::TAS_DURATION);
+ $criteria->addSelectColumn(TaskPeer::TAS_UID);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_TYPE);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_DURATION);
- $criteria->addSelectColumn(TaskPeer::TAS_DELAY_TYPE);
+ $criteria->addSelectColumn(TaskPeer::TAS_DELAY_TYPE);
- $criteria->addSelectColumn(TaskPeer::TAS_TEMPORIZER);
+ $criteria->addSelectColumn(TaskPeer::TAS_TEMPORIZER);
- $criteria->addSelectColumn(TaskPeer::TAS_TYPE_DAY);
+ $criteria->addSelectColumn(TaskPeer::TAS_TYPE_DAY);
- $criteria->addSelectColumn(TaskPeer::TAS_TIMEUNIT);
+ $criteria->addSelectColumn(TaskPeer::TAS_TIMEUNIT);
- $criteria->addSelectColumn(TaskPeer::TAS_ALERT);
+ $criteria->addSelectColumn(TaskPeer::TAS_ALERT);
- $criteria->addSelectColumn(TaskPeer::TAS_PRIORITY_VARIABLE);
+ $criteria->addSelectColumn(TaskPeer::TAS_PRIORITY_VARIABLE);
- $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_TYPE);
+ $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_TYPE);
- $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_VARIABLE);
+ $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_VARIABLE);
- $criteria->addSelectColumn(TaskPeer::TAS_MI_INSTANCE_VARIABLE);
+ $criteria->addSelectColumn(TaskPeer::TAS_MI_INSTANCE_VARIABLE);
- $criteria->addSelectColumn(TaskPeer::TAS_MI_COMPLETE_VARIABLE);
+ $criteria->addSelectColumn(TaskPeer::TAS_MI_COMPLETE_VARIABLE);
- $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_LOCATION);
+ $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_LOCATION);
- $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC);
+ $criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC);
- $criteria->addSelectColumn(TaskPeer::TAS_TRANSFER_FLY);
+ $criteria->addSelectColumn(TaskPeer::TAS_TRANSFER_FLY);
- $criteria->addSelectColumn(TaskPeer::TAS_LAST_ASSIGNED);
+ $criteria->addSelectColumn(TaskPeer::TAS_LAST_ASSIGNED);
- $criteria->addSelectColumn(TaskPeer::TAS_USER);
+ $criteria->addSelectColumn(TaskPeer::TAS_USER);
- $criteria->addSelectColumn(TaskPeer::TAS_CAN_UPLOAD);
+ $criteria->addSelectColumn(TaskPeer::TAS_CAN_UPLOAD);
- $criteria->addSelectColumn(TaskPeer::TAS_VIEW_UPLOAD);
+ $criteria->addSelectColumn(TaskPeer::TAS_VIEW_UPLOAD);
- $criteria->addSelectColumn(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION);
+ $criteria->addSelectColumn(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION);
- $criteria->addSelectColumn(TaskPeer::TAS_CAN_CANCEL);
+ $criteria->addSelectColumn(TaskPeer::TAS_CAN_CANCEL);
- $criteria->addSelectColumn(TaskPeer::TAS_OWNER_APP);
+ $criteria->addSelectColumn(TaskPeer::TAS_OWNER_APP);
- $criteria->addSelectColumn(TaskPeer::STG_UID);
+ $criteria->addSelectColumn(TaskPeer::STG_UID);
- $criteria->addSelectColumn(TaskPeer::TAS_CAN_PAUSE);
+ $criteria->addSelectColumn(TaskPeer::TAS_CAN_PAUSE);
- $criteria->addSelectColumn(TaskPeer::TAS_CAN_SEND_MESSAGE);
+ $criteria->addSelectColumn(TaskPeer::TAS_CAN_SEND_MESSAGE);
- $criteria->addSelectColumn(TaskPeer::TAS_CAN_DELETE_DOCS);
+ $criteria->addSelectColumn(TaskPeer::TAS_CAN_DELETE_DOCS);
- $criteria->addSelectColumn(TaskPeer::TAS_SELF_SERVICE);
+ $criteria->addSelectColumn(TaskPeer::TAS_SELF_SERVICE);
- $criteria->addSelectColumn(TaskPeer::TAS_START);
+ $criteria->addSelectColumn(TaskPeer::TAS_START);
- $criteria->addSelectColumn(TaskPeer::TAS_TO_LAST_USER);
-
- $criteria->addSelectColumn(TaskPeer::TAS_SEND_LAST_EMAIL);
-
- $criteria->addSelectColumn(TaskPeer::TAS_DERIVATION);
-
- $criteria->addSelectColumn(TaskPeer::TAS_POSX);
-
- $criteria->addSelectColumn(TaskPeer::TAS_POSY);
-
- $criteria->addSelectColumn(TaskPeer::TAS_WIDTH);
-
- $criteria->addSelectColumn(TaskPeer::TAS_HEIGHT);
-
- $criteria->addSelectColumn(TaskPeer::TAS_COLOR);
-
- $criteria->addSelectColumn(TaskPeer::TAS_EVN_UID);
-
- $criteria->addSelectColumn(TaskPeer::TAS_BOUNDARY);
+ $criteria->addSelectColumn(TaskPeer::TAS_TO_LAST_USER);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_SEND_LAST_EMAIL);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_DERIVATION);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_POSX);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_POSY);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_WIDTH);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_HEIGHT);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_COLOR);
+
+ $criteria->addSelectColumn(TaskPeer::TAS_EVN_UID);
- $criteria->addSelectColumn(TaskPeer::TAS_DERIVATION_SCREEN_TPL);
+ $criteria->addSelectColumn(TaskPeer::TAS_BOUNDARY);
- }
+ $criteria->addSelectColumn(TaskPeer::TAS_DERIVATION_SCREEN_TPL);
- const COUNT = 'COUNT(TASK.TAS_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT TASK.TAS_UID)';
+ }
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
+ const COUNT = 'COUNT(TASK.TAS_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT TASK.TAS_UID)';
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(TaskPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(TaskPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = TaskPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Task
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = TaskPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return TaskPeer::populateObjects(TaskPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- TaskPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = TaskPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return TaskPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Task or Criteria object.
- *
- * @param mixed $values Criteria or Task object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Task object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Task or Criteria object.
- *
- * @param mixed $values Criteria or Task object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(TaskPeer::TAS_UID);
- $selectCriteria->add(TaskPeer::TAS_UID, $criteria->remove(TaskPeer::TAS_UID), $comparison);
-
- } else { // $values is Task object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the TASK table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(TaskPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Task or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Task object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(TaskPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Task) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(TaskPeer::TAS_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Task object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Task $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Task $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(TaskPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(TaskPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TYPE))
- $columns[TaskPeer::TAS_TYPE] = $obj->getTasType();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TIMEUNIT))
- $columns[TaskPeer::TAS_TIMEUNIT] = $obj->getTasTimeunit();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ALERT))
- $columns[TaskPeer::TAS_ALERT] = $obj->getTasAlert();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_TYPE))
- $columns[TaskPeer::TAS_ASSIGN_TYPE] = $obj->getTasAssignType();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION))
- $columns[TaskPeer::TAS_ASSIGN_LOCATION] = $obj->getTasAssignLocation();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC))
- $columns[TaskPeer::TAS_ASSIGN_LOCATION_ADHOC] = $obj->getTasAssignLocationAdhoc();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TRANSFER_FLY))
- $columns[TaskPeer::TAS_TRANSFER_FLY] = $obj->getTasTransferFly();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_UPLOAD))
- $columns[TaskPeer::TAS_CAN_UPLOAD] = $obj->getTasCanUpload();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_UPLOAD))
- $columns[TaskPeer::TAS_VIEW_UPLOAD] = $obj->getTasViewUpload();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION))
- $columns[TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION] = $obj->getTasViewAdditionalDocumentation();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_CANCEL))
- $columns[TaskPeer::TAS_CAN_CANCEL] = $obj->getTasCanCancel();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_PAUSE))
- $columns[TaskPeer::TAS_CAN_PAUSE] = $obj->getTasCanPause();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_SEND_MESSAGE))
- $columns[TaskPeer::TAS_CAN_SEND_MESSAGE] = $obj->getTasCanSendMessage();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_DELETE_DOCS))
- $columns[TaskPeer::TAS_CAN_DELETE_DOCS] = $obj->getTasCanDeleteDocs();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SELF_SERVICE))
- $columns[TaskPeer::TAS_SELF_SERVICE] = $obj->getTasSelfService();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_START))
- $columns[TaskPeer::TAS_START] = $obj->getTasStart();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TO_LAST_USER))
- $columns[TaskPeer::TAS_TO_LAST_USER] = $obj->getTasToLastUser();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SEND_LAST_EMAIL))
- $columns[TaskPeer::TAS_SEND_LAST_EMAIL] = $obj->getTasSendLastEmail();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_DERIVATION))
- $columns[TaskPeer::TAS_DERIVATION] = $obj->getTasDerivation();
-
- }
-
- return BasePeer::doValidate(TaskPeer::DATABASE_NAME, TaskPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Task
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(TaskPeer::DATABASE_NAME);
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
- $criteria->add(TaskPeer::TAS_UID, $pk);
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(TaskPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(TaskPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = TaskPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Task
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = TaskPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return TaskPeer::populateObjects(TaskPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ TaskPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = TaskPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return TaskPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Task or Criteria object.
+ *
+ * @param mixed $values Criteria or Task object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Task object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Task or Criteria object.
+ *
+ * @param mixed $values Criteria or Task object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(TaskPeer::TAS_UID);
+ $selectCriteria->add(TaskPeer::TAS_UID, $criteria->remove(TaskPeer::TAS_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the TASK table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(TaskPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Task or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Task object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(TaskPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Task) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(TaskPeer::TAS_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Task object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Task $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Task $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(TaskPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(TaskPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TYPE))
+ $columns[TaskPeer::TAS_TYPE] = $obj->getTasType();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TIMEUNIT))
+ $columns[TaskPeer::TAS_TIMEUNIT] = $obj->getTasTimeunit();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ALERT))
+ $columns[TaskPeer::TAS_ALERT] = $obj->getTasAlert();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_TYPE))
+ $columns[TaskPeer::TAS_ASSIGN_TYPE] = $obj->getTasAssignType();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION))
+ $columns[TaskPeer::TAS_ASSIGN_LOCATION] = $obj->getTasAssignLocation();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC))
+ $columns[TaskPeer::TAS_ASSIGN_LOCATION_ADHOC] = $obj->getTasAssignLocationAdhoc();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TRANSFER_FLY))
+ $columns[TaskPeer::TAS_TRANSFER_FLY] = $obj->getTasTransferFly();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_UPLOAD))
+ $columns[TaskPeer::TAS_CAN_UPLOAD] = $obj->getTasCanUpload();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_UPLOAD))
+ $columns[TaskPeer::TAS_VIEW_UPLOAD] = $obj->getTasViewUpload();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION))
+ $columns[TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION] = $obj->getTasViewAdditionalDocumentation();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_CANCEL))
+ $columns[TaskPeer::TAS_CAN_CANCEL] = $obj->getTasCanCancel();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_PAUSE))
+ $columns[TaskPeer::TAS_CAN_PAUSE] = $obj->getTasCanPause();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_SEND_MESSAGE))
+ $columns[TaskPeer::TAS_CAN_SEND_MESSAGE] = $obj->getTasCanSendMessage();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_CAN_DELETE_DOCS))
+ $columns[TaskPeer::TAS_CAN_DELETE_DOCS] = $obj->getTasCanDeleteDocs();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SELF_SERVICE))
+ $columns[TaskPeer::TAS_SELF_SERVICE] = $obj->getTasSelfService();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_START))
+ $columns[TaskPeer::TAS_START] = $obj->getTasStart();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_TO_LAST_USER))
+ $columns[TaskPeer::TAS_TO_LAST_USER] = $obj->getTasToLastUser();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_SEND_LAST_EMAIL))
+ $columns[TaskPeer::TAS_SEND_LAST_EMAIL] = $obj->getTasSendLastEmail();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskPeer::TAS_DERIVATION))
+ $columns[TaskPeer::TAS_DERIVATION] = $obj->getTasDerivation();
+
+ }
+
+ return BasePeer::doValidate(TaskPeer::DATABASE_NAME, TaskPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Task
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(TaskPeer::DATABASE_NAME);
+ $criteria->add(TaskPeer::TAS_UID, $pk);
- $v = TaskPeer::doSelect($criteria, $con);
- return !empty($v) > 0 ? $v[0] : null;
- }
+ $v = TaskPeer::doSelect($criteria, $con);
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
+ return !empty($v) > 0 ? $v[0] : null;
+ }
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(TaskPeer::TAS_UID, $pks, Criteria::IN);
- $objs = TaskPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(TaskPeer::TAS_UID, $pks, Criteria::IN);
+ $objs = TaskPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
-} // BaseTaskPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseTaskPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseTaskPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/TaskMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.TaskMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/TaskMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.TaskMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseTaskUser.php b/workflow/engine/classes/model/om/BaseTaskUser.php
index efacee41e..89e7f375c 100755
--- a/workflow/engine/classes/model/om/BaseTaskUser.php
+++ b/workflow/engine/classes/model/om/BaseTaskUser.php
@@ -16,670 +16,691 @@ include_once 'classes/model/TaskUserPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTaskUser extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var TaskUserPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the tas_uid field.
- * @var string
- */
- protected $tas_uid = '';
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
-
- /**
- * The value for the tu_type field.
- * @var int
- */
- protected $tu_type = 1;
-
-
- /**
- * The value for the tu_relation field.
- * @var int
- */
- protected $tu_relation = 0;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [tas_uid] column value.
- *
- * @return string
- */
- public function getTasUid()
- {
-
- return $this->tas_uid;
- }
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [tu_type] column value.
- *
- * @return int
- */
- public function getTuType()
- {
-
- return $this->tu_type;
- }
-
- /**
- * Get the [tu_relation] column value.
- *
- * @return int
- */
- public function getTuRelation()
- {
-
- return $this->tu_relation;
- }
-
- /**
- * Set the value of [tas_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTasUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tas_uid !== $v || $v === '') {
- $this->tas_uid = $v;
- $this->modifiedColumns[] = TaskUserPeer::TAS_UID;
- }
-
- } // setTasUid()
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = TaskUserPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [tu_type] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setTuType($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->tu_type !== $v || $v === 1) {
- $this->tu_type = $v;
- $this->modifiedColumns[] = TaskUserPeer::TU_TYPE;
- }
-
- } // setTuType()
-
- /**
- * Set the value of [tu_relation] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setTuRelation($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->tu_relation !== $v || $v === 0) {
- $this->tu_relation = $v;
- $this->modifiedColumns[] = TaskUserPeer::TU_RELATION;
- }
-
- } // setTuRelation()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->tas_uid = $rs->getString($startcol + 0);
-
- $this->usr_uid = $rs->getString($startcol + 1);
-
- $this->tu_type = $rs->getInt($startcol + 2);
-
- $this->tu_relation = $rs->getInt($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = TaskUserPeer::NUM_COLUMNS - TaskUserPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating TaskUser object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- TaskUserPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = TaskUserPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += TaskUserPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = TaskUserPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TaskUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getTasUid();
- break;
- case 1:
- return $this->getUsrUid();
- break;
- case 2:
- return $this->getTuType();
- break;
- case 3:
- return $this->getTuRelation();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TaskUserPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getTasUid(),
- $keys[1] => $this->getUsrUid(),
- $keys[2] => $this->getTuType(),
- $keys[3] => $this->getTuRelation(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TaskUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setTasUid($value);
- break;
- case 1:
- $this->setUsrUid($value);
- break;
- case 2:
- $this->setTuType($value);
- break;
- case 3:
- $this->setTuRelation($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TaskUserPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setTasUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setUsrUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTuType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setTuRelation($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(TaskUserPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(TaskUserPeer::TAS_UID)) $criteria->add(TaskUserPeer::TAS_UID, $this->tas_uid);
- if ($this->isColumnModified(TaskUserPeer::USR_UID)) $criteria->add(TaskUserPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(TaskUserPeer::TU_TYPE)) $criteria->add(TaskUserPeer::TU_TYPE, $this->tu_type);
- if ($this->isColumnModified(TaskUserPeer::TU_RELATION)) $criteria->add(TaskUserPeer::TU_RELATION, $this->tu_relation);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(TaskUserPeer::DATABASE_NAME);
-
- $criteria->add(TaskUserPeer::TAS_UID, $this->tas_uid);
- $criteria->add(TaskUserPeer::USR_UID, $this->usr_uid);
- $criteria->add(TaskUserPeer::TU_TYPE, $this->tu_type);
- $criteria->add(TaskUserPeer::TU_RELATION, $this->tu_relation);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getTasUid();
-
- $pks[1] = $this->getUsrUid();
-
- $pks[2] = $this->getTuType();
-
- $pks[3] = $this->getTuRelation();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setTasUid($keys[0]);
-
- $this->setUsrUid($keys[1]);
-
- $this->setTuType($keys[2]);
-
- $this->setTuRelation($keys[3]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of TaskUser (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
-
- $copyObj->setNew(true);
-
- $copyObj->setTasUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
-
- $copyObj->setTuType('1'); // this is a pkey column, so set to default value
-
- $copyObj->setTuRelation('0'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return TaskUser Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return TaskUserPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new TaskUserPeer();
- }
- return self::$peer;
- }
-
-} // BaseTaskUser
+abstract class BaseTaskUser extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var TaskUserPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the tas_uid field.
+ * @var string
+ */
+ protected $tas_uid = '';
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the tu_type field.
+ * @var int
+ */
+ protected $tu_type = 1;
+
+ /**
+ * The value for the tu_relation field.
+ * @var int
+ */
+ protected $tu_relation = 0;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [tas_uid] column value.
+ *
+ * @return string
+ */
+ public function getTasUid()
+ {
+
+ return $this->tas_uid;
+ }
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [tu_type] column value.
+ *
+ * @return int
+ */
+ public function getTuType()
+ {
+
+ return $this->tu_type;
+ }
+
+ /**
+ * Get the [tu_relation] column value.
+ *
+ * @return int
+ */
+ public function getTuRelation()
+ {
+
+ return $this->tu_relation;
+ }
+
+ /**
+ * Set the value of [tas_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTasUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tas_uid !== $v || $v === '') {
+ $this->tas_uid = $v;
+ $this->modifiedColumns[] = TaskUserPeer::TAS_UID;
+ }
+
+ } // setTasUid()
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = TaskUserPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [tu_type] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setTuType($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->tu_type !== $v || $v === 1) {
+ $this->tu_type = $v;
+ $this->modifiedColumns[] = TaskUserPeer::TU_TYPE;
+ }
+
+ } // setTuType()
+
+ /**
+ * Set the value of [tu_relation] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setTuRelation($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->tu_relation !== $v || $v === 0) {
+ $this->tu_relation = $v;
+ $this->modifiedColumns[] = TaskUserPeer::TU_RELATION;
+ }
+
+ } // setTuRelation()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->tas_uid = $rs->getString($startcol + 0);
+
+ $this->usr_uid = $rs->getString($startcol + 1);
+
+ $this->tu_type = $rs->getInt($startcol + 2);
+
+ $this->tu_relation = $rs->getInt($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = TaskUserPeer::NUM_COLUMNS - TaskUserPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating TaskUser object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ TaskUserPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = TaskUserPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += TaskUserPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = TaskUserPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TaskUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getTasUid();
+ break;
+ case 1:
+ return $this->getUsrUid();
+ break;
+ case 2:
+ return $this->getTuType();
+ break;
+ case 3:
+ return $this->getTuRelation();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TaskUserPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getTasUid(),
+ $keys[1] => $this->getUsrUid(),
+ $keys[2] => $this->getTuType(),
+ $keys[3] => $this->getTuRelation(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TaskUserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setTasUid($value);
+ break;
+ case 1:
+ $this->setUsrUid($value);
+ break;
+ case 2:
+ $this->setTuType($value);
+ break;
+ case 3:
+ $this->setTuRelation($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TaskUserPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setTasUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setUsrUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTuType($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setTuRelation($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(TaskUserPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(TaskUserPeer::TAS_UID)) {
+ $criteria->add(TaskUserPeer::TAS_UID, $this->tas_uid);
+ }
+
+ if ($this->isColumnModified(TaskUserPeer::USR_UID)) {
+ $criteria->add(TaskUserPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(TaskUserPeer::TU_TYPE)) {
+ $criteria->add(TaskUserPeer::TU_TYPE, $this->tu_type);
+ }
+
+ if ($this->isColumnModified(TaskUserPeer::TU_RELATION)) {
+ $criteria->add(TaskUserPeer::TU_RELATION, $this->tu_relation);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(TaskUserPeer::DATABASE_NAME);
+
+ $criteria->add(TaskUserPeer::TAS_UID, $this->tas_uid);
+ $criteria->add(TaskUserPeer::USR_UID, $this->usr_uid);
+ $criteria->add(TaskUserPeer::TU_TYPE, $this->tu_type);
+ $criteria->add(TaskUserPeer::TU_RELATION, $this->tu_relation);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getTasUid();
+
+ $pks[1] = $this->getUsrUid();
+
+ $pks[2] = $this->getTuType();
+
+ $pks[3] = $this->getTuRelation();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setTasUid($keys[0]);
+
+ $this->setUsrUid($keys[1]);
+
+ $this->setTuType($keys[2]);
+
+ $this->setTuRelation($keys[3]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of TaskUser (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setTasUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
+
+ $copyObj->setTuType('1'); // this is a pkey column, so set to default value
+
+ $copyObj->setTuRelation('0'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return TaskUser Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return TaskUserPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new TaskUserPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseTaskUserPeer.php b/workflow/engine/classes/model/om/BaseTaskUserPeer.php
index 22eed26fd..4bd8110ca 100755
--- a/workflow/engine/classes/model/om/BaseTaskUserPeer.php
+++ b/workflow/engine/classes/model/om/BaseTaskUserPeer.php
@@ -12,586 +12,587 @@ include_once 'classes/model/TaskUser.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTaskUserPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'TASK_USER';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.TaskUser';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the TAS_UID field */
- const TAS_UID = 'TASK_USER.TAS_UID';
-
- /** the column name for the USR_UID field */
- const USR_UID = 'TASK_USER.USR_UID';
-
- /** the column name for the TU_TYPE field */
- const TU_TYPE = 'TASK_USER.TU_TYPE';
-
- /** the column name for the TU_RELATION field */
- const TU_RELATION = 'TASK_USER.TU_RELATION';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('TasUid', 'UsrUid', 'TuType', 'TuRelation', ),
- BasePeer::TYPE_COLNAME => array (TaskUserPeer::TAS_UID, TaskUserPeer::USR_UID, TaskUserPeer::TU_TYPE, TaskUserPeer::TU_RELATION, ),
- BasePeer::TYPE_FIELDNAME => array ('TAS_UID', 'USR_UID', 'TU_TYPE', 'TU_RELATION', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('TasUid' => 0, 'UsrUid' => 1, 'TuType' => 2, 'TuRelation' => 3, ),
- BasePeer::TYPE_COLNAME => array (TaskUserPeer::TAS_UID => 0, TaskUserPeer::USR_UID => 1, TaskUserPeer::TU_TYPE => 2, TaskUserPeer::TU_RELATION => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('TAS_UID' => 0, 'USR_UID' => 1, 'TU_TYPE' => 2, 'TU_RELATION' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/TaskUserMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.TaskUserMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = TaskUserPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. TaskUserPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(TaskUserPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(TaskUserPeer::TAS_UID);
-
- $criteria->addSelectColumn(TaskUserPeer::USR_UID);
-
- $criteria->addSelectColumn(TaskUserPeer::TU_TYPE);
-
- $criteria->addSelectColumn(TaskUserPeer::TU_RELATION);
-
- }
-
- const COUNT = 'COUNT(TASK_USER.TAS_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT TASK_USER.TAS_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(TaskUserPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(TaskUserPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = TaskUserPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return TaskUser
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = TaskUserPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return TaskUserPeer::populateObjects(TaskUserPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- TaskUserPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = TaskUserPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return TaskUserPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a TaskUser or Criteria object.
- *
- * @param mixed $values Criteria or TaskUser object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from TaskUser object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a TaskUser or Criteria object.
- *
- * @param mixed $values Criteria or TaskUser object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(TaskUserPeer::TAS_UID);
- $selectCriteria->add(TaskUserPeer::TAS_UID, $criteria->remove(TaskUserPeer::TAS_UID), $comparison);
-
- $comparison = $criteria->getComparison(TaskUserPeer::USR_UID);
- $selectCriteria->add(TaskUserPeer::USR_UID, $criteria->remove(TaskUserPeer::USR_UID), $comparison);
-
- $comparison = $criteria->getComparison(TaskUserPeer::TU_TYPE);
- $selectCriteria->add(TaskUserPeer::TU_TYPE, $criteria->remove(TaskUserPeer::TU_TYPE), $comparison);
-
- $comparison = $criteria->getComparison(TaskUserPeer::TU_RELATION);
- $selectCriteria->add(TaskUserPeer::TU_RELATION, $criteria->remove(TaskUserPeer::TU_RELATION), $comparison);
-
- } else { // $values is TaskUser object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the TASK_USER table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(TaskUserPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a TaskUser or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or TaskUser object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof TaskUser) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- $vals[3][] = $value[3];
- }
-
- $criteria->add(TaskUserPeer::TAS_UID, $vals[0], Criteria::IN);
- $criteria->add(TaskUserPeer::USR_UID, $vals[1], Criteria::IN);
- $criteria->add(TaskUserPeer::TU_TYPE, $vals[2], Criteria::IN);
- $criteria->add(TaskUserPeer::TU_RELATION, $vals[3], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given TaskUser object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param TaskUser $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(TaskUser $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(TaskUserPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(TaskUserPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::TAS_UID))
- $columns[TaskUserPeer::TAS_UID] = $obj->getTasUid();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::USR_UID))
- $columns[TaskUserPeer::USR_UID] = $obj->getUsrUid();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::TU_TYPE))
- $columns[TaskUserPeer::TU_TYPE] = $obj->getTuType();
-
- if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::TU_RELATION))
- $columns[TaskUserPeer::TU_RELATION] = $obj->getTuRelation();
-
- }
-
- return BasePeer::doValidate(TaskUserPeer::DATABASE_NAME, TaskUserPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $tas_uid
- @param string $usr_uid
- @param int $tu_type
- @param int $tu_relation
-
- * @param Connection $con
- * @return TaskUser
- */
- public static function retrieveByPK( $tas_uid, $usr_uid, $tu_type, $tu_relation, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(TaskUserPeer::TAS_UID, $tas_uid);
- $criteria->add(TaskUserPeer::USR_UID, $usr_uid);
- $criteria->add(TaskUserPeer::TU_TYPE, $tu_type);
- $criteria->add(TaskUserPeer::TU_RELATION, $tu_relation);
- $v = TaskUserPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseTaskUserPeer
+abstract class BaseTaskUserPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'TASK_USER';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.TaskUser';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the TAS_UID field */
+ const TAS_UID = 'TASK_USER.TAS_UID';
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'TASK_USER.USR_UID';
+
+ /** the column name for the TU_TYPE field */
+ const TU_TYPE = 'TASK_USER.TU_TYPE';
+
+ /** the column name for the TU_RELATION field */
+ const TU_RELATION = 'TASK_USER.TU_RELATION';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('TasUid', 'UsrUid', 'TuType', 'TuRelation', ),
+ BasePeer::TYPE_COLNAME => array (TaskUserPeer::TAS_UID, TaskUserPeer::USR_UID, TaskUserPeer::TU_TYPE, TaskUserPeer::TU_RELATION, ),
+ BasePeer::TYPE_FIELDNAME => array ('TAS_UID', 'USR_UID', 'TU_TYPE', 'TU_RELATION', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('TasUid' => 0, 'UsrUid' => 1, 'TuType' => 2, 'TuRelation' => 3, ),
+ BasePeer::TYPE_COLNAME => array (TaskUserPeer::TAS_UID => 0, TaskUserPeer::USR_UID => 1, TaskUserPeer::TU_TYPE => 2, TaskUserPeer::TU_RELATION => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('TAS_UID' => 0, 'USR_UID' => 1, 'TU_TYPE' => 2, 'TU_RELATION' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/TaskUserMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.TaskUserMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = TaskUserPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. TaskUserPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(TaskUserPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(TaskUserPeer::TAS_UID);
+
+ $criteria->addSelectColumn(TaskUserPeer::USR_UID);
+
+ $criteria->addSelectColumn(TaskUserPeer::TU_TYPE);
+
+ $criteria->addSelectColumn(TaskUserPeer::TU_RELATION);
+
+ }
+
+ const COUNT = 'COUNT(TASK_USER.TAS_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT TASK_USER.TAS_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(TaskUserPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(TaskUserPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = TaskUserPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return TaskUser
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = TaskUserPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return TaskUserPeer::populateObjects(TaskUserPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ TaskUserPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = TaskUserPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return TaskUserPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a TaskUser or Criteria object.
+ *
+ * @param mixed $values Criteria or TaskUser object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from TaskUser object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a TaskUser or Criteria object.
+ *
+ * @param mixed $values Criteria or TaskUser object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(TaskUserPeer::TAS_UID);
+ $selectCriteria->add(TaskUserPeer::TAS_UID, $criteria->remove(TaskUserPeer::TAS_UID), $comparison);
+
+ $comparison = $criteria->getComparison(TaskUserPeer::USR_UID);
+ $selectCriteria->add(TaskUserPeer::USR_UID, $criteria->remove(TaskUserPeer::USR_UID), $comparison);
+
+ $comparison = $criteria->getComparison(TaskUserPeer::TU_TYPE);
+ $selectCriteria->add(TaskUserPeer::TU_TYPE, $criteria->remove(TaskUserPeer::TU_TYPE), $comparison);
+
+ $comparison = $criteria->getComparison(TaskUserPeer::TU_RELATION);
+ $selectCriteria->add(TaskUserPeer::TU_RELATION, $criteria->remove(TaskUserPeer::TU_RELATION), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the TASK_USER table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(TaskUserPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a TaskUser or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or TaskUser object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof TaskUser) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ $vals[3][] = $value[3];
+ }
+
+ $criteria->add(TaskUserPeer::TAS_UID, $vals[0], Criteria::IN);
+ $criteria->add(TaskUserPeer::USR_UID, $vals[1], Criteria::IN);
+ $criteria->add(TaskUserPeer::TU_TYPE, $vals[2], Criteria::IN);
+ $criteria->add(TaskUserPeer::TU_RELATION, $vals[3], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given TaskUser object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param TaskUser $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(TaskUser $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(TaskUserPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(TaskUserPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::TAS_UID))
+ $columns[TaskUserPeer::TAS_UID] = $obj->getTasUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::USR_UID))
+ $columns[TaskUserPeer::USR_UID] = $obj->getUsrUid();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::TU_TYPE))
+ $columns[TaskUserPeer::TU_TYPE] = $obj->getTuType();
+
+ if ($obj->isNew() || $obj->isColumnModified(TaskUserPeer::TU_RELATION))
+ $columns[TaskUserPeer::TU_RELATION] = $obj->getTuRelation();
+
+ }
+
+ return BasePeer::doValidate(TaskUserPeer::DATABASE_NAME, TaskUserPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $tas_uid
+ * @param string $usr_uid
+ * @param int $tu_type
+ * @param int $tu_relation
+ * @param Connection $con
+ * @return TaskUser
+ */
+ public static function retrieveByPK($tas_uid, $usr_uid, $tu_type, $tu_relation, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(TaskUserPeer::TAS_UID, $tas_uid);
+ $criteria->add(TaskUserPeer::USR_UID, $usr_uid);
+ $criteria->add(TaskUserPeer::TU_TYPE, $tu_type);
+ $criteria->add(TaskUserPeer::TU_RELATION, $tu_relation);
+ $v = TaskUserPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseTaskUserPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseTaskUserPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/TaskUserMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.TaskUserMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/TaskUserMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.TaskUserMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseTranslation.php b/workflow/engine/classes/model/om/BaseTranslation.php
index c6d132133..5d63ba145 100755
--- a/workflow/engine/classes/model/om/BaseTranslation.php
+++ b/workflow/engine/classes/model/om/BaseTranslation.php
@@ -16,740 +16,768 @@ include_once 'classes/model/TranslationPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTranslation extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var TranslationPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the trn_category field.
- * @var string
- */
- protected $trn_category = '';
-
-
- /**
- * The value for the trn_id field.
- * @var string
- */
- protected $trn_id = '';
-
-
- /**
- * The value for the trn_lang field.
- * @var string
- */
- protected $trn_lang = 'en';
-
-
- /**
- * The value for the trn_value field.
- * @var string
- */
- protected $trn_value;
-
-
- /**
- * The value for the trn_update_date field.
- * @var int
- */
- protected $trn_update_date;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [trn_category] column value.
- *
- * @return string
- */
- public function getTrnCategory()
- {
-
- return $this->trn_category;
- }
-
- /**
- * Get the [trn_id] column value.
- *
- * @return string
- */
- public function getTrnId()
- {
-
- return $this->trn_id;
- }
-
- /**
- * Get the [trn_lang] column value.
- *
- * @return string
- */
- public function getTrnLang()
- {
-
- return $this->trn_lang;
- }
-
- /**
- * Get the [trn_value] column value.
- *
- * @return string
- */
- public function getTrnValue()
- {
-
- return $this->trn_value;
- }
-
- /**
- * Get the [optionally formatted] [trn_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getTrnUpdateDate($format = 'Y-m-d')
- {
-
- if ($this->trn_update_date === null || $this->trn_update_date === '') {
- return null;
- } elseif (!is_int($this->trn_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->trn_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [trn_update_date] as date/time value: " . var_export($this->trn_update_date, true));
- }
- } else {
- $ts = $this->trn_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Set the value of [trn_category] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTrnCategory($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->trn_category !== $v || $v === '') {
- $this->trn_category = $v;
- $this->modifiedColumns[] = TranslationPeer::TRN_CATEGORY;
- }
-
- } // setTrnCategory()
-
- /**
- * Set the value of [trn_id] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTrnId($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->trn_id !== $v || $v === '') {
- $this->trn_id = $v;
- $this->modifiedColumns[] = TranslationPeer::TRN_ID;
- }
-
- } // setTrnId()
-
- /**
- * Set the value of [trn_lang] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTrnLang($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->trn_lang !== $v || $v === 'en') {
- $this->trn_lang = $v;
- $this->modifiedColumns[] = TranslationPeer::TRN_LANG;
- }
-
- } // setTrnLang()
-
- /**
- * Set the value of [trn_value] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTrnValue($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->trn_value !== $v) {
- $this->trn_value = $v;
- $this->modifiedColumns[] = TranslationPeer::TRN_VALUE;
- }
-
- } // setTrnValue()
-
- /**
- * Set the value of [trn_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setTrnUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [trn_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->trn_update_date !== $ts) {
- $this->trn_update_date = $ts;
- $this->modifiedColumns[] = TranslationPeer::TRN_UPDATE_DATE;
- }
-
- } // setTrnUpdateDate()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->trn_category = $rs->getString($startcol + 0);
-
- $this->trn_id = $rs->getString($startcol + 1);
-
- $this->trn_lang = $rs->getString($startcol + 2);
-
- $this->trn_value = $rs->getString($startcol + 3);
-
- $this->trn_update_date = $rs->getDate($startcol + 4, null);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = TranslationPeer::NUM_COLUMNS - TranslationPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Translation object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(TranslationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- TranslationPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(TranslationPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = TranslationPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += TranslationPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = TranslationPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TranslationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getTrnCategory();
- break;
- case 1:
- return $this->getTrnId();
- break;
- case 2:
- return $this->getTrnLang();
- break;
- case 3:
- return $this->getTrnValue();
- break;
- case 4:
- return $this->getTrnUpdateDate();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TranslationPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getTrnCategory(),
- $keys[1] => $this->getTrnId(),
- $keys[2] => $this->getTrnLang(),
- $keys[3] => $this->getTrnValue(),
- $keys[4] => $this->getTrnUpdateDate(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TranslationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setTrnCategory($value);
- break;
- case 1:
- $this->setTrnId($value);
- break;
- case 2:
- $this->setTrnLang($value);
- break;
- case 3:
- $this->setTrnValue($value);
- break;
- case 4:
- $this->setTrnUpdateDate($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TranslationPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setTrnCategory($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setTrnId($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTrnLang($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setTrnValue($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setTrnUpdateDate($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(TranslationPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(TranslationPeer::TRN_CATEGORY)) $criteria->add(TranslationPeer::TRN_CATEGORY, $this->trn_category);
- if ($this->isColumnModified(TranslationPeer::TRN_ID)) $criteria->add(TranslationPeer::TRN_ID, $this->trn_id);
- if ($this->isColumnModified(TranslationPeer::TRN_LANG)) $criteria->add(TranslationPeer::TRN_LANG, $this->trn_lang);
- if ($this->isColumnModified(TranslationPeer::TRN_VALUE)) $criteria->add(TranslationPeer::TRN_VALUE, $this->trn_value);
- if ($this->isColumnModified(TranslationPeer::TRN_UPDATE_DATE)) $criteria->add(TranslationPeer::TRN_UPDATE_DATE, $this->trn_update_date);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(TranslationPeer::DATABASE_NAME);
-
- $criteria->add(TranslationPeer::TRN_CATEGORY, $this->trn_category);
- $criteria->add(TranslationPeer::TRN_ID, $this->trn_id);
- $criteria->add(TranslationPeer::TRN_LANG, $this->trn_lang);
-
- return $criteria;
- }
-
- /**
- * Returns the composite primary key for this object.
- * The array elements will be in same order as specified in XML.
- * @return array
- */
- public function getPrimaryKey()
- {
- $pks = array();
-
- $pks[0] = $this->getTrnCategory();
-
- $pks[1] = $this->getTrnId();
-
- $pks[2] = $this->getTrnLang();
-
- return $pks;
- }
-
- /**
- * Set the [composite] primary key.
- *
- * @param array $keys The elements of the composite key (order must match the order in XML file).
- * @return void
- */
- public function setPrimaryKey($keys)
- {
-
- $this->setTrnCategory($keys[0]);
-
- $this->setTrnId($keys[1]);
-
- $this->setTrnLang($keys[2]);
-
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Translation (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setTrnValue($this->trn_value);
-
- $copyObj->setTrnUpdateDate($this->trn_update_date);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setTrnCategory(''); // this is a pkey column, so set to default value
-
- $copyObj->setTrnId(''); // this is a pkey column, so set to default value
-
- $copyObj->setTrnLang('en'); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Translation Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return TranslationPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new TranslationPeer();
- }
- return self::$peer;
- }
-
-} // BaseTranslation
+abstract class BaseTranslation extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var TranslationPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the trn_category field.
+ * @var string
+ */
+ protected $trn_category = '';
+
+ /**
+ * The value for the trn_id field.
+ * @var string
+ */
+ protected $trn_id = '';
+
+ /**
+ * The value for the trn_lang field.
+ * @var string
+ */
+ protected $trn_lang = 'en';
+
+ /**
+ * The value for the trn_value field.
+ * @var string
+ */
+ protected $trn_value;
+
+ /**
+ * The value for the trn_update_date field.
+ * @var int
+ */
+ protected $trn_update_date;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [trn_category] column value.
+ *
+ * @return string
+ */
+ public function getTrnCategory()
+ {
+
+ return $this->trn_category;
+ }
+
+ /**
+ * Get the [trn_id] column value.
+ *
+ * @return string
+ */
+ public function getTrnId()
+ {
+
+ return $this->trn_id;
+ }
+
+ /**
+ * Get the [trn_lang] column value.
+ *
+ * @return string
+ */
+ public function getTrnLang()
+ {
+
+ return $this->trn_lang;
+ }
+
+ /**
+ * Get the [trn_value] column value.
+ *
+ * @return string
+ */
+ public function getTrnValue()
+ {
+
+ return $this->trn_value;
+ }
+
+ /**
+ * Get the [optionally formatted] [trn_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getTrnUpdateDate($format = 'Y-m-d')
+ {
+
+ if ($this->trn_update_date === null || $this->trn_update_date === '') {
+ return null;
+ } elseif (!is_int($this->trn_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->trn_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [trn_update_date] as date/time value: " .
+ var_export($this->trn_update_date, true));
+ }
+ } else {
+ $ts = $this->trn_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Set the value of [trn_category] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTrnCategory($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->trn_category !== $v || $v === '') {
+ $this->trn_category = $v;
+ $this->modifiedColumns[] = TranslationPeer::TRN_CATEGORY;
+ }
+
+ } // setTrnCategory()
+
+ /**
+ * Set the value of [trn_id] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTrnId($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->trn_id !== $v || $v === '') {
+ $this->trn_id = $v;
+ $this->modifiedColumns[] = TranslationPeer::TRN_ID;
+ }
+
+ } // setTrnId()
+
+ /**
+ * Set the value of [trn_lang] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTrnLang($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->trn_lang !== $v || $v === 'en') {
+ $this->trn_lang = $v;
+ $this->modifiedColumns[] = TranslationPeer::TRN_LANG;
+ }
+
+ } // setTrnLang()
+
+ /**
+ * Set the value of [trn_value] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTrnValue($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->trn_value !== $v) {
+ $this->trn_value = $v;
+ $this->modifiedColumns[] = TranslationPeer::TRN_VALUE;
+ }
+
+ } // setTrnValue()
+
+ /**
+ * Set the value of [trn_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setTrnUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [trn_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->trn_update_date !== $ts) {
+ $this->trn_update_date = $ts;
+ $this->modifiedColumns[] = TranslationPeer::TRN_UPDATE_DATE;
+ }
+
+ } // setTrnUpdateDate()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->trn_category = $rs->getString($startcol + 0);
+
+ $this->trn_id = $rs->getString($startcol + 1);
+
+ $this->trn_lang = $rs->getString($startcol + 2);
+
+ $this->trn_value = $rs->getString($startcol + 3);
+
+ $this->trn_update_date = $rs->getDate($startcol + 4, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = TranslationPeer::NUM_COLUMNS - TranslationPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Translation object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(TranslationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ TranslationPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(TranslationPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = TranslationPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += TranslationPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = TranslationPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TranslationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getTrnCategory();
+ break;
+ case 1:
+ return $this->getTrnId();
+ break;
+ case 2:
+ return $this->getTrnLang();
+ break;
+ case 3:
+ return $this->getTrnValue();
+ break;
+ case 4:
+ return $this->getTrnUpdateDate();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TranslationPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getTrnCategory(),
+ $keys[1] => $this->getTrnId(),
+ $keys[2] => $this->getTrnLang(),
+ $keys[3] => $this->getTrnValue(),
+ $keys[4] => $this->getTrnUpdateDate(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TranslationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setTrnCategory($value);
+ break;
+ case 1:
+ $this->setTrnId($value);
+ break;
+ case 2:
+ $this->setTrnLang($value);
+ break;
+ case 3:
+ $this->setTrnValue($value);
+ break;
+ case 4:
+ $this->setTrnUpdateDate($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TranslationPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setTrnCategory($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setTrnId($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTrnLang($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setTrnValue($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setTrnUpdateDate($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(TranslationPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(TranslationPeer::TRN_CATEGORY)) {
+ $criteria->add(TranslationPeer::TRN_CATEGORY, $this->trn_category);
+ }
+
+ if ($this->isColumnModified(TranslationPeer::TRN_ID)) {
+ $criteria->add(TranslationPeer::TRN_ID, $this->trn_id);
+ }
+
+ if ($this->isColumnModified(TranslationPeer::TRN_LANG)) {
+ $criteria->add(TranslationPeer::TRN_LANG, $this->trn_lang);
+ }
+
+ if ($this->isColumnModified(TranslationPeer::TRN_VALUE)) {
+ $criteria->add(TranslationPeer::TRN_VALUE, $this->trn_value);
+ }
+
+ if ($this->isColumnModified(TranslationPeer::TRN_UPDATE_DATE)) {
+ $criteria->add(TranslationPeer::TRN_UPDATE_DATE, $this->trn_update_date);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(TranslationPeer::DATABASE_NAME);
+
+ $criteria->add(TranslationPeer::TRN_CATEGORY, $this->trn_category);
+ $criteria->add(TranslationPeer::TRN_ID, $this->trn_id);
+ $criteria->add(TranslationPeer::TRN_LANG, $this->trn_lang);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the composite primary key for this object.
+ * The array elements will be in same order as specified in XML.
+ * @return array
+ */
+ public function getPrimaryKey()
+ {
+ $pks = array();
+
+ $pks[0] = $this->getTrnCategory();
+
+ $pks[1] = $this->getTrnId();
+
+ $pks[2] = $this->getTrnLang();
+
+ return $pks;
+ }
+
+ /**
+ * Set the [composite] primary key.
+ *
+ * @param array $keys The elements of the composite key (order must match the order in XML file).
+ * @return void
+ */
+ public function setPrimaryKey($keys)
+ {
+
+ $this->setTrnCategory($keys[0]);
+
+ $this->setTrnId($keys[1]);
+
+ $this->setTrnLang($keys[2]);
+
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Translation (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setTrnValue($this->trn_value);
+
+ $copyObj->setTrnUpdateDate($this->trn_update_date);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setTrnCategory(''); // this is a pkey column, so set to default value
+
+ $copyObj->setTrnId(''); // this is a pkey column, so set to default value
+
+ $copyObj->setTrnLang('en'); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Translation Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return TranslationPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new TranslationPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseTranslationPeer.php b/workflow/engine/classes/model/om/BaseTranslationPeer.php
index 82664a986..3c5949555 100755
--- a/workflow/engine/classes/model/om/BaseTranslationPeer.php
+++ b/workflow/engine/classes/model/om/BaseTranslationPeer.php
@@ -12,584 +12,585 @@ include_once 'classes/model/Translation.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTranslationPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'TRANSLATION';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Translation';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the TRN_CATEGORY field */
- const TRN_CATEGORY = 'TRANSLATION.TRN_CATEGORY';
-
- /** the column name for the TRN_ID field */
- const TRN_ID = 'TRANSLATION.TRN_ID';
-
- /** the column name for the TRN_LANG field */
- const TRN_LANG = 'TRANSLATION.TRN_LANG';
-
- /** the column name for the TRN_VALUE field */
- const TRN_VALUE = 'TRANSLATION.TRN_VALUE';
-
- /** the column name for the TRN_UPDATE_DATE field */
- const TRN_UPDATE_DATE = 'TRANSLATION.TRN_UPDATE_DATE';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('TrnCategory', 'TrnId', 'TrnLang', 'TrnValue', 'TrnUpdateDate', ),
- BasePeer::TYPE_COLNAME => array (TranslationPeer::TRN_CATEGORY, TranslationPeer::TRN_ID, TranslationPeer::TRN_LANG, TranslationPeer::TRN_VALUE, TranslationPeer::TRN_UPDATE_DATE, ),
- BasePeer::TYPE_FIELDNAME => array ('TRN_CATEGORY', 'TRN_ID', 'TRN_LANG', 'TRN_VALUE', 'TRN_UPDATE_DATE', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('TrnCategory' => 0, 'TrnId' => 1, 'TrnLang' => 2, 'TrnValue' => 3, 'TrnUpdateDate' => 4, ),
- BasePeer::TYPE_COLNAME => array (TranslationPeer::TRN_CATEGORY => 0, TranslationPeer::TRN_ID => 1, TranslationPeer::TRN_LANG => 2, TranslationPeer::TRN_VALUE => 3, TranslationPeer::TRN_UPDATE_DATE => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('TRN_CATEGORY' => 0, 'TRN_ID' => 1, 'TRN_LANG' => 2, 'TRN_VALUE' => 3, 'TRN_UPDATE_DATE' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/TranslationMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.TranslationMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = TranslationPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. TranslationPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(TranslationPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(TranslationPeer::TRN_CATEGORY);
-
- $criteria->addSelectColumn(TranslationPeer::TRN_ID);
-
- $criteria->addSelectColumn(TranslationPeer::TRN_LANG);
-
- $criteria->addSelectColumn(TranslationPeer::TRN_VALUE);
-
- $criteria->addSelectColumn(TranslationPeer::TRN_UPDATE_DATE);
-
- }
-
- const COUNT = 'COUNT(TRANSLATION.TRN_CATEGORY)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT TRANSLATION.TRN_CATEGORY)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(TranslationPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(TranslationPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = TranslationPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Translation
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = TranslationPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return TranslationPeer::populateObjects(TranslationPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- TranslationPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = TranslationPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return TranslationPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Translation or Criteria object.
- *
- * @param mixed $values Criteria or Translation object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Translation object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Translation or Criteria object.
- *
- * @param mixed $values Criteria or Translation object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(TranslationPeer::TRN_CATEGORY);
- $selectCriteria->add(TranslationPeer::TRN_CATEGORY, $criteria->remove(TranslationPeer::TRN_CATEGORY), $comparison);
-
- $comparison = $criteria->getComparison(TranslationPeer::TRN_ID);
- $selectCriteria->add(TranslationPeer::TRN_ID, $criteria->remove(TranslationPeer::TRN_ID), $comparison);
-
- $comparison = $criteria->getComparison(TranslationPeer::TRN_LANG);
- $selectCriteria->add(TranslationPeer::TRN_LANG, $criteria->remove(TranslationPeer::TRN_LANG), $comparison);
-
- } else { // $values is Translation object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the TRANSLATION table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(TranslationPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Translation or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Translation object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(TranslationPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Translation) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- // primary key is composite; we therefore, expect
- // the primary key passed to be an array of pkey
- // values
- if(count($values) == count($values, COUNT_RECURSIVE))
- {
- // array is not multi-dimensional
- $values = array($values);
- }
- $vals = array();
- foreach($values as $value)
- {
-
- $vals[0][] = $value[0];
- $vals[1][] = $value[1];
- $vals[2][] = $value[2];
- }
-
- $criteria->add(TranslationPeer::TRN_CATEGORY, $vals[0], Criteria::IN);
- $criteria->add(TranslationPeer::TRN_ID, $vals[1], Criteria::IN);
- $criteria->add(TranslationPeer::TRN_LANG, $vals[2], Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Translation object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Translation $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Translation $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(TranslationPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(TranslationPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_CATEGORY))
- $columns[TranslationPeer::TRN_CATEGORY] = $obj->getTrnCategory();
-
- if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_ID))
- $columns[TranslationPeer::TRN_ID] = $obj->getTrnId();
-
- if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_LANG))
- $columns[TranslationPeer::TRN_LANG] = $obj->getTrnLang();
-
- if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_VALUE))
- $columns[TranslationPeer::TRN_VALUE] = $obj->getTrnValue();
-
- }
-
- return BasePeer::doValidate(TranslationPeer::DATABASE_NAME, TranslationPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve object using using composite pkey values.
- * @param string $trn_category
- @param string $trn_id
- @param string $trn_lang
-
- * @param Connection $con
- * @return Translation
- */
- public static function retrieveByPK( $trn_category, $trn_id, $trn_lang, $con = null) {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $criteria = new Criteria();
- $criteria->add(TranslationPeer::TRN_CATEGORY, $trn_category);
- $criteria->add(TranslationPeer::TRN_ID, $trn_id);
- $criteria->add(TranslationPeer::TRN_LANG, $trn_lang);
- $v = TranslationPeer::doSelect($criteria, $con);
-
- return !empty($v) ? $v[0] : null;
- }
-} // BaseTranslationPeer
+abstract class BaseTranslationPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'TRANSLATION';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Translation';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the TRN_CATEGORY field */
+ const TRN_CATEGORY = 'TRANSLATION.TRN_CATEGORY';
+
+ /** the column name for the TRN_ID field */
+ const TRN_ID = 'TRANSLATION.TRN_ID';
+
+ /** the column name for the TRN_LANG field */
+ const TRN_LANG = 'TRANSLATION.TRN_LANG';
+
+ /** the column name for the TRN_VALUE field */
+ const TRN_VALUE = 'TRANSLATION.TRN_VALUE';
+
+ /** the column name for the TRN_UPDATE_DATE field */
+ const TRN_UPDATE_DATE = 'TRANSLATION.TRN_UPDATE_DATE';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('TrnCategory', 'TrnId', 'TrnLang', 'TrnValue', 'TrnUpdateDate', ),
+ BasePeer::TYPE_COLNAME => array (TranslationPeer::TRN_CATEGORY, TranslationPeer::TRN_ID, TranslationPeer::TRN_LANG, TranslationPeer::TRN_VALUE, TranslationPeer::TRN_UPDATE_DATE, ),
+ BasePeer::TYPE_FIELDNAME => array ('TRN_CATEGORY', 'TRN_ID', 'TRN_LANG', 'TRN_VALUE', 'TRN_UPDATE_DATE', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('TrnCategory' => 0, 'TrnId' => 1, 'TrnLang' => 2, 'TrnValue' => 3, 'TrnUpdateDate' => 4, ),
+ BasePeer::TYPE_COLNAME => array (TranslationPeer::TRN_CATEGORY => 0, TranslationPeer::TRN_ID => 1, TranslationPeer::TRN_LANG => 2, TranslationPeer::TRN_VALUE => 3, TranslationPeer::TRN_UPDATE_DATE => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('TRN_CATEGORY' => 0, 'TRN_ID' => 1, 'TRN_LANG' => 2, 'TRN_VALUE' => 3, 'TRN_UPDATE_DATE' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/TranslationMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.TranslationMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = TranslationPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. TranslationPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(TranslationPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(TranslationPeer::TRN_CATEGORY);
+
+ $criteria->addSelectColumn(TranslationPeer::TRN_ID);
+
+ $criteria->addSelectColumn(TranslationPeer::TRN_LANG);
+
+ $criteria->addSelectColumn(TranslationPeer::TRN_VALUE);
+
+ $criteria->addSelectColumn(TranslationPeer::TRN_UPDATE_DATE);
+
+ }
+
+ const COUNT = 'COUNT(TRANSLATION.TRN_CATEGORY)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT TRANSLATION.TRN_CATEGORY)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(TranslationPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(TranslationPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = TranslationPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Translation
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = TranslationPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return TranslationPeer::populateObjects(TranslationPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ TranslationPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = TranslationPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return TranslationPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Translation or Criteria object.
+ *
+ * @param mixed $values Criteria or Translation object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Translation object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Translation or Criteria object.
+ *
+ * @param mixed $values Criteria or Translation object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(TranslationPeer::TRN_CATEGORY);
+ $selectCriteria->add(TranslationPeer::TRN_CATEGORY, $criteria->remove(TranslationPeer::TRN_CATEGORY), $comparison);
+
+ $comparison = $criteria->getComparison(TranslationPeer::TRN_ID);
+ $selectCriteria->add(TranslationPeer::TRN_ID, $criteria->remove(TranslationPeer::TRN_ID), $comparison);
+
+ $comparison = $criteria->getComparison(TranslationPeer::TRN_LANG);
+ $selectCriteria->add(TranslationPeer::TRN_LANG, $criteria->remove(TranslationPeer::TRN_LANG), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the TRANSLATION table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(TranslationPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Translation or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Translation object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(TranslationPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Translation) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ // primary key is composite; we therefore, expect
+ // the primary key passed to be an array of pkey
+ // values
+ if (count($values) == count($values, COUNT_RECURSIVE)) {
+ // array is not multi-dimensional
+ $values = array($values);
+ }
+ $vals = array();
+ foreach ($values as $value) {
+
+ $vals[0][] = $value[0];
+ $vals[1][] = $value[1];
+ $vals[2][] = $value[2];
+ }
+
+ $criteria->add(TranslationPeer::TRN_CATEGORY, $vals[0], Criteria::IN);
+ $criteria->add(TranslationPeer::TRN_ID, $vals[1], Criteria::IN);
+ $criteria->add(TranslationPeer::TRN_LANG, $vals[2], Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Translation object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Translation $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Translation $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(TranslationPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(TranslationPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_CATEGORY))
+ $columns[TranslationPeer::TRN_CATEGORY] = $obj->getTrnCategory();
+
+ if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_ID))
+ $columns[TranslationPeer::TRN_ID] = $obj->getTrnId();
+
+ if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_LANG))
+ $columns[TranslationPeer::TRN_LANG] = $obj->getTrnLang();
+
+ if ($obj->isNew() || $obj->isColumnModified(TranslationPeer::TRN_VALUE))
+ $columns[TranslationPeer::TRN_VALUE] = $obj->getTrnValue();
+
+ }
+
+ return BasePeer::doValidate(TranslationPeer::DATABASE_NAME, TranslationPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve object using using composite pkey values.
+ * @param string $trn_category
+ * @param string $trn_id
+ * @param string $trn_lang
+ * @param Connection $con
+ * @return Translation
+ */
+ public static function retrieveByPK($trn_category, $trn_id, $trn_lang, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $criteria = new Criteria();
+ $criteria->add(TranslationPeer::TRN_CATEGORY, $trn_category);
+ $criteria->add(TranslationPeer::TRN_ID, $trn_id);
+ $criteria->add(TranslationPeer::TRN_LANG, $trn_lang);
+ $v = TranslationPeer::doSelect($criteria, $con);
+
+ return !empty($v) ? $v[0] : null;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseTranslationPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseTranslationPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/TranslationMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.TranslationMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/TranslationMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.TranslationMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseTriggers.php b/workflow/engine/classes/model/om/BaseTriggers.php
index 9f9e86253..4ed1ff21f 100755
--- a/workflow/engine/classes/model/om/BaseTriggers.php
+++ b/workflow/engine/classes/model/om/BaseTriggers.php
@@ -16,701 +16,727 @@ include_once 'classes/model/TriggersPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTriggers extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var TriggersPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the tri_uid field.
- * @var string
- */
- protected $tri_uid = '';
-
-
- /**
- * The value for the pro_uid field.
- * @var string
- */
- protected $pro_uid = '';
-
-
- /**
- * The value for the tri_type field.
- * @var string
- */
- protected $tri_type = 'SCRIPT';
-
-
- /**
- * The value for the tri_webbot field.
- * @var string
- */
- protected $tri_webbot;
-
-
- /**
- * The value for the tri_param field.
- * @var string
- */
- protected $tri_param;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [tri_uid] column value.
- *
- * @return string
- */
- public function getTriUid()
- {
-
- return $this->tri_uid;
- }
-
- /**
- * Get the [pro_uid] column value.
- *
- * @return string
- */
- public function getProUid()
- {
-
- return $this->pro_uid;
- }
-
- /**
- * Get the [tri_type] column value.
- *
- * @return string
- */
- public function getTriType()
- {
-
- return $this->tri_type;
- }
-
- /**
- * Get the [tri_webbot] column value.
- *
- * @return string
- */
- public function getTriWebbot()
- {
-
- return $this->tri_webbot;
- }
-
- /**
- * Get the [tri_param] column value.
- *
- * @return string
- */
- public function getTriParam()
- {
-
- return $this->tri_param;
- }
-
- /**
- * Set the value of [tri_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTriUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tri_uid !== $v || $v === '') {
- $this->tri_uid = $v;
- $this->modifiedColumns[] = TriggersPeer::TRI_UID;
- }
-
- } // setTriUid()
-
- /**
- * Set the value of [pro_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setProUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->pro_uid !== $v || $v === '') {
- $this->pro_uid = $v;
- $this->modifiedColumns[] = TriggersPeer::PRO_UID;
- }
-
- } // setProUid()
-
- /**
- * Set the value of [tri_type] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTriType($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tri_type !== $v || $v === 'SCRIPT') {
- $this->tri_type = $v;
- $this->modifiedColumns[] = TriggersPeer::TRI_TYPE;
- }
-
- } // setTriType()
-
- /**
- * Set the value of [tri_webbot] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTriWebbot($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tri_webbot !== $v) {
- $this->tri_webbot = $v;
- $this->modifiedColumns[] = TriggersPeer::TRI_WEBBOT;
- }
-
- } // setTriWebbot()
-
- /**
- * Set the value of [tri_param] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setTriParam($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->tri_param !== $v) {
- $this->tri_param = $v;
- $this->modifiedColumns[] = TriggersPeer::TRI_PARAM;
- }
-
- } // setTriParam()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->tri_uid = $rs->getString($startcol + 0);
-
- $this->pro_uid = $rs->getString($startcol + 1);
-
- $this->tri_type = $rs->getString($startcol + 2);
-
- $this->tri_webbot = $rs->getString($startcol + 3);
-
- $this->tri_param = $rs->getString($startcol + 4);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 5; // 5 = TriggersPeer::NUM_COLUMNS - TriggersPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Triggers object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- TriggersPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = TriggersPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += TriggersPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = TriggersPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TriggersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getTriUid();
- break;
- case 1:
- return $this->getProUid();
- break;
- case 2:
- return $this->getTriType();
- break;
- case 3:
- return $this->getTriWebbot();
- break;
- case 4:
- return $this->getTriParam();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TriggersPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getTriUid(),
- $keys[1] => $this->getProUid(),
- $keys[2] => $this->getTriType(),
- $keys[3] => $this->getTriWebbot(),
- $keys[4] => $this->getTriParam(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = TriggersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setTriUid($value);
- break;
- case 1:
- $this->setProUid($value);
- break;
- case 2:
- $this->setTriType($value);
- break;
- case 3:
- $this->setTriWebbot($value);
- break;
- case 4:
- $this->setTriParam($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = TriggersPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setTriUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setProUid($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setTriType($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setTriWebbot($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setTriParam($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(TriggersPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(TriggersPeer::TRI_UID)) $criteria->add(TriggersPeer::TRI_UID, $this->tri_uid);
- if ($this->isColumnModified(TriggersPeer::PRO_UID)) $criteria->add(TriggersPeer::PRO_UID, $this->pro_uid);
- if ($this->isColumnModified(TriggersPeer::TRI_TYPE)) $criteria->add(TriggersPeer::TRI_TYPE, $this->tri_type);
- if ($this->isColumnModified(TriggersPeer::TRI_WEBBOT)) $criteria->add(TriggersPeer::TRI_WEBBOT, $this->tri_webbot);
- if ($this->isColumnModified(TriggersPeer::TRI_PARAM)) $criteria->add(TriggersPeer::TRI_PARAM, $this->tri_param);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(TriggersPeer::DATABASE_NAME);
-
- $criteria->add(TriggersPeer::TRI_UID, $this->tri_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getTriUid();
- }
-
- /**
- * Generic method to set the primary key (tri_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setTriUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Triggers (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setProUid($this->pro_uid);
-
- $copyObj->setTriType($this->tri_type);
-
- $copyObj->setTriWebbot($this->tri_webbot);
-
- $copyObj->setTriParam($this->tri_param);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setTriUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Triggers Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return TriggersPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new TriggersPeer();
- }
- return self::$peer;
- }
-
-} // BaseTriggers
+abstract class BaseTriggers extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var TriggersPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the tri_uid field.
+ * @var string
+ */
+ protected $tri_uid = '';
+
+ /**
+ * The value for the pro_uid field.
+ * @var string
+ */
+ protected $pro_uid = '';
+
+ /**
+ * The value for the tri_type field.
+ * @var string
+ */
+ protected $tri_type = 'SCRIPT';
+
+ /**
+ * The value for the tri_webbot field.
+ * @var string
+ */
+ protected $tri_webbot;
+
+ /**
+ * The value for the tri_param field.
+ * @var string
+ */
+ protected $tri_param;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [tri_uid] column value.
+ *
+ * @return string
+ */
+ public function getTriUid()
+ {
+
+ return $this->tri_uid;
+ }
+
+ /**
+ * Get the [pro_uid] column value.
+ *
+ * @return string
+ */
+ public function getProUid()
+ {
+
+ return $this->pro_uid;
+ }
+
+ /**
+ * Get the [tri_type] column value.
+ *
+ * @return string
+ */
+ public function getTriType()
+ {
+
+ return $this->tri_type;
+ }
+
+ /**
+ * Get the [tri_webbot] column value.
+ *
+ * @return string
+ */
+ public function getTriWebbot()
+ {
+
+ return $this->tri_webbot;
+ }
+
+ /**
+ * Get the [tri_param] column value.
+ *
+ * @return string
+ */
+ public function getTriParam()
+ {
+
+ return $this->tri_param;
+ }
+
+ /**
+ * Set the value of [tri_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTriUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tri_uid !== $v || $v === '') {
+ $this->tri_uid = $v;
+ $this->modifiedColumns[] = TriggersPeer::TRI_UID;
+ }
+
+ } // setTriUid()
+
+ /**
+ * Set the value of [pro_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setProUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->pro_uid !== $v || $v === '') {
+ $this->pro_uid = $v;
+ $this->modifiedColumns[] = TriggersPeer::PRO_UID;
+ }
+
+ } // setProUid()
+
+ /**
+ * Set the value of [tri_type] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTriType($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tri_type !== $v || $v === 'SCRIPT') {
+ $this->tri_type = $v;
+ $this->modifiedColumns[] = TriggersPeer::TRI_TYPE;
+ }
+
+ } // setTriType()
+
+ /**
+ * Set the value of [tri_webbot] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTriWebbot($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tri_webbot !== $v) {
+ $this->tri_webbot = $v;
+ $this->modifiedColumns[] = TriggersPeer::TRI_WEBBOT;
+ }
+
+ } // setTriWebbot()
+
+ /**
+ * Set the value of [tri_param] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setTriParam($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->tri_param !== $v) {
+ $this->tri_param = $v;
+ $this->modifiedColumns[] = TriggersPeer::TRI_PARAM;
+ }
+
+ } // setTriParam()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->tri_uid = $rs->getString($startcol + 0);
+
+ $this->pro_uid = $rs->getString($startcol + 1);
+
+ $this->tri_type = $rs->getString($startcol + 2);
+
+ $this->tri_webbot = $rs->getString($startcol + 3);
+
+ $this->tri_param = $rs->getString($startcol + 4);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 5; // 5 = TriggersPeer::NUM_COLUMNS - TriggersPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Triggers object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ TriggersPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = TriggersPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += TriggersPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = TriggersPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TriggersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getTriUid();
+ break;
+ case 1:
+ return $this->getProUid();
+ break;
+ case 2:
+ return $this->getTriType();
+ break;
+ case 3:
+ return $this->getTriWebbot();
+ break;
+ case 4:
+ return $this->getTriParam();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TriggersPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getTriUid(),
+ $keys[1] => $this->getProUid(),
+ $keys[2] => $this->getTriType(),
+ $keys[3] => $this->getTriWebbot(),
+ $keys[4] => $this->getTriParam(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = TriggersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setTriUid($value);
+ break;
+ case 1:
+ $this->setProUid($value);
+ break;
+ case 2:
+ $this->setTriType($value);
+ break;
+ case 3:
+ $this->setTriWebbot($value);
+ break;
+ case 4:
+ $this->setTriParam($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = TriggersPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setTriUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setProUid($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setTriType($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setTriWebbot($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setTriParam($arr[$keys[4]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(TriggersPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(TriggersPeer::TRI_UID)) {
+ $criteria->add(TriggersPeer::TRI_UID, $this->tri_uid);
+ }
+
+ if ($this->isColumnModified(TriggersPeer::PRO_UID)) {
+ $criteria->add(TriggersPeer::PRO_UID, $this->pro_uid);
+ }
+
+ if ($this->isColumnModified(TriggersPeer::TRI_TYPE)) {
+ $criteria->add(TriggersPeer::TRI_TYPE, $this->tri_type);
+ }
+
+ if ($this->isColumnModified(TriggersPeer::TRI_WEBBOT)) {
+ $criteria->add(TriggersPeer::TRI_WEBBOT, $this->tri_webbot);
+ }
+
+ if ($this->isColumnModified(TriggersPeer::TRI_PARAM)) {
+ $criteria->add(TriggersPeer::TRI_PARAM, $this->tri_param);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(TriggersPeer::DATABASE_NAME);
+
+ $criteria->add(TriggersPeer::TRI_UID, $this->tri_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getTriUid();
+ }
+
+ /**
+ * Generic method to set the primary key (tri_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setTriUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Triggers (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setProUid($this->pro_uid);
+
+ $copyObj->setTriType($this->tri_type);
+
+ $copyObj->setTriWebbot($this->tri_webbot);
+
+ $copyObj->setTriParam($this->tri_param);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setTriUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Triggers Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return TriggersPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new TriggersPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseTriggersPeer.php b/workflow/engine/classes/model/om/BaseTriggersPeer.php
index 3f6f82108..e02f1f532 100755
--- a/workflow/engine/classes/model/om/BaseTriggersPeer.php
+++ b/workflow/engine/classes/model/om/BaseTriggersPeer.php
@@ -12,577 +12,579 @@ include_once 'classes/model/Triggers.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseTriggersPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'TRIGGERS';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Triggers';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 5;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the TRI_UID field */
- const TRI_UID = 'TRIGGERS.TRI_UID';
-
- /** the column name for the PRO_UID field */
- const PRO_UID = 'TRIGGERS.PRO_UID';
-
- /** the column name for the TRI_TYPE field */
- const TRI_TYPE = 'TRIGGERS.TRI_TYPE';
-
- /** the column name for the TRI_WEBBOT field */
- const TRI_WEBBOT = 'TRIGGERS.TRI_WEBBOT';
-
- /** the column name for the TRI_PARAM field */
- const TRI_PARAM = 'TRIGGERS.TRI_PARAM';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('TriUid', 'ProUid', 'TriType', 'TriWebbot', 'TriParam', ),
- BasePeer::TYPE_COLNAME => array (TriggersPeer::TRI_UID, TriggersPeer::PRO_UID, TriggersPeer::TRI_TYPE, TriggersPeer::TRI_WEBBOT, TriggersPeer::TRI_PARAM, ),
- BasePeer::TYPE_FIELDNAME => array ('TRI_UID', 'PRO_UID', 'TRI_TYPE', 'TRI_WEBBOT', 'TRI_PARAM', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('TriUid' => 0, 'ProUid' => 1, 'TriType' => 2, 'TriWebbot' => 3, 'TriParam' => 4, ),
- BasePeer::TYPE_COLNAME => array (TriggersPeer::TRI_UID => 0, TriggersPeer::PRO_UID => 1, TriggersPeer::TRI_TYPE => 2, TriggersPeer::TRI_WEBBOT => 3, TriggersPeer::TRI_PARAM => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('TRI_UID' => 0, 'PRO_UID' => 1, 'TRI_TYPE' => 2, 'TRI_WEBBOT' => 3, 'TRI_PARAM' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/TriggersMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.TriggersMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = TriggersPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. TriggersPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(TriggersPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(TriggersPeer::TRI_UID);
-
- $criteria->addSelectColumn(TriggersPeer::PRO_UID);
-
- $criteria->addSelectColumn(TriggersPeer::TRI_TYPE);
-
- $criteria->addSelectColumn(TriggersPeer::TRI_WEBBOT);
-
- $criteria->addSelectColumn(TriggersPeer::TRI_PARAM);
-
- }
-
- const COUNT = 'COUNT(TRIGGERS.TRI_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT TRIGGERS.TRI_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(TriggersPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(TriggersPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = TriggersPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Triggers
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = TriggersPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return TriggersPeer::populateObjects(TriggersPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- TriggersPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = TriggersPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return TriggersPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Triggers or Criteria object.
- *
- * @param mixed $values Criteria or Triggers object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Triggers object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Triggers or Criteria object.
- *
- * @param mixed $values Criteria or Triggers object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(TriggersPeer::TRI_UID);
- $selectCriteria->add(TriggersPeer::TRI_UID, $criteria->remove(TriggersPeer::TRI_UID), $comparison);
-
- } else { // $values is Triggers object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the TRIGGERS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(TriggersPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Triggers or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Triggers object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Triggers) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(TriggersPeer::TRI_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Triggers object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Triggers $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Triggers $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(TriggersPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(TriggersPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(TriggersPeer::TRI_TYPE))
- $columns[TriggersPeer::TRI_TYPE] = $obj->getTriType();
-
- }
-
- return BasePeer::doValidate(TriggersPeer::DATABASE_NAME, TriggersPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Triggers
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(TriggersPeer::DATABASE_NAME);
-
- $criteria->add(TriggersPeer::TRI_UID, $pk);
-
-
- $v = TriggersPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(TriggersPeer::TRI_UID, $pks, Criteria::IN);
- $objs = TriggersPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseTriggersPeer
+abstract class BaseTriggersPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'TRIGGERS';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Triggers';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 5;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the TRI_UID field */
+ const TRI_UID = 'TRIGGERS.TRI_UID';
+
+ /** the column name for the PRO_UID field */
+ const PRO_UID = 'TRIGGERS.PRO_UID';
+
+ /** the column name for the TRI_TYPE field */
+ const TRI_TYPE = 'TRIGGERS.TRI_TYPE';
+
+ /** the column name for the TRI_WEBBOT field */
+ const TRI_WEBBOT = 'TRIGGERS.TRI_WEBBOT';
+
+ /** the column name for the TRI_PARAM field */
+ const TRI_PARAM = 'TRIGGERS.TRI_PARAM';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('TriUid', 'ProUid', 'TriType', 'TriWebbot', 'TriParam', ),
+ BasePeer::TYPE_COLNAME => array (TriggersPeer::TRI_UID, TriggersPeer::PRO_UID, TriggersPeer::TRI_TYPE, TriggersPeer::TRI_WEBBOT, TriggersPeer::TRI_PARAM, ),
+ BasePeer::TYPE_FIELDNAME => array ('TRI_UID', 'PRO_UID', 'TRI_TYPE', 'TRI_WEBBOT', 'TRI_PARAM', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('TriUid' => 0, 'ProUid' => 1, 'TriType' => 2, 'TriWebbot' => 3, 'TriParam' => 4, ),
+ BasePeer::TYPE_COLNAME => array (TriggersPeer::TRI_UID => 0, TriggersPeer::PRO_UID => 1, TriggersPeer::TRI_TYPE => 2, TriggersPeer::TRI_WEBBOT => 3, TriggersPeer::TRI_PARAM => 4, ),
+ BasePeer::TYPE_FIELDNAME => array ('TRI_UID' => 0, 'PRO_UID' => 1, 'TRI_TYPE' => 2, 'TRI_WEBBOT' => 3, 'TRI_PARAM' => 4, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/TriggersMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.TriggersMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = TriggersPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. TriggersPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(TriggersPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(TriggersPeer::TRI_UID);
+
+ $criteria->addSelectColumn(TriggersPeer::PRO_UID);
+
+ $criteria->addSelectColumn(TriggersPeer::TRI_TYPE);
+
+ $criteria->addSelectColumn(TriggersPeer::TRI_WEBBOT);
+
+ $criteria->addSelectColumn(TriggersPeer::TRI_PARAM);
+
+ }
+
+ const COUNT = 'COUNT(TRIGGERS.TRI_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT TRIGGERS.TRI_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(TriggersPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(TriggersPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = TriggersPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Triggers
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = TriggersPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return TriggersPeer::populateObjects(TriggersPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ TriggersPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = TriggersPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return TriggersPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Triggers or Criteria object.
+ *
+ * @param mixed $values Criteria or Triggers object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Triggers object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Triggers or Criteria object.
+ *
+ * @param mixed $values Criteria or Triggers object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(TriggersPeer::TRI_UID);
+ $selectCriteria->add(TriggersPeer::TRI_UID, $criteria->remove(TriggersPeer::TRI_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the TRIGGERS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(TriggersPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Triggers or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Triggers object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Triggers) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(TriggersPeer::TRI_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Triggers object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Triggers $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Triggers $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(TriggersPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(TriggersPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(TriggersPeer::TRI_TYPE))
+ $columns[TriggersPeer::TRI_TYPE] = $obj->getTriType();
+
+ }
+
+ return BasePeer::doValidate(TriggersPeer::DATABASE_NAME, TriggersPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Triggers
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(TriggersPeer::DATABASE_NAME);
+
+ $criteria->add(TriggersPeer::TRI_UID, $pk);
+
+
+ $v = TriggersPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(TriggersPeer::TRI_UID, $pks, Criteria::IN);
+ $objs = TriggersPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseTriggersPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseTriggersPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/TriggersMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.TriggersMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/TriggersMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.TriggersMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseUsers.php b/workflow/engine/classes/model/om/BaseUsers.php
index 81991c30b..307f8036e 100755
--- a/workflow/engine/classes/model/om/BaseUsers.php
+++ b/workflow/engine/classes/model/om/BaseUsers.php
@@ -16,1902 +16,2041 @@ include_once 'classes/model/UsersPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseUsers extends BaseObject implements Persistent {
+abstract class BaseUsers extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var UsersPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the usr_username field.
+ * @var string
+ */
+ protected $usr_username = '';
+
+ /**
+ * The value for the usr_password field.
+ * @var string
+ */
+ protected $usr_password = '';
+
+ /**
+ * The value for the usr_firstname field.
+ * @var string
+ */
+ protected $usr_firstname = '';
+
+ /**
+ * The value for the usr_lastname field.
+ * @var string
+ */
+ protected $usr_lastname = '';
+
+ /**
+ * The value for the usr_email field.
+ * @var string
+ */
+ protected $usr_email = '';
+
+ /**
+ * The value for the usr_due_date field.
+ * @var int
+ */
+ protected $usr_due_date;
+
+ /**
+ * The value for the usr_create_date field.
+ * @var int
+ */
+ protected $usr_create_date;
+
+ /**
+ * The value for the usr_update_date field.
+ * @var int
+ */
+ protected $usr_update_date;
+
+ /**
+ * The value for the usr_status field.
+ * @var string
+ */
+ protected $usr_status = 'ACTIVE';
+
+ /**
+ * The value for the usr_country field.
+ * @var string
+ */
+ protected $usr_country = '';
+
+ /**
+ * The value for the usr_city field.
+ * @var string
+ */
+ protected $usr_city = '';
+
+ /**
+ * The value for the usr_location field.
+ * @var string
+ */
+ protected $usr_location = '';
+
+ /**
+ * The value for the usr_address field.
+ * @var string
+ */
+ protected $usr_address = '';
+
+ /**
+ * The value for the usr_phone field.
+ * @var string
+ */
+ protected $usr_phone = '';
+
+ /**
+ * The value for the usr_fax field.
+ * @var string
+ */
+ protected $usr_fax = '';
+
+ /**
+ * The value for the usr_cellular field.
+ * @var string
+ */
+ protected $usr_cellular = '';
+
+ /**
+ * The value for the usr_zip_code field.
+ * @var string
+ */
+ protected $usr_zip_code = '';
+
+ /**
+ * The value for the dep_uid field.
+ * @var string
+ */
+ protected $dep_uid = '';
+
+ /**
+ * The value for the usr_position field.
+ * @var string
+ */
+ protected $usr_position = '';
+
+ /**
+ * The value for the usr_resume field.
+ * @var string
+ */
+ protected $usr_resume = '';
+
+ /**
+ * The value for the usr_birthday field.
+ * @var int
+ */
+ protected $usr_birthday;
+
+ /**
+ * The value for the usr_role field.
+ * @var string
+ */
+ protected $usr_role = 'PROCESSMAKER_ADMIN';
+
+ /**
+ * The value for the usr_reports_to field.
+ * @var string
+ */
+ protected $usr_reports_to = '';
+
+ /**
+ * The value for the usr_replaced_by field.
+ * @var string
+ */
+ protected $usr_replaced_by = '';
+
+ /**
+ * The value for the usr_ux field.
+ * @var string
+ */
+ protected $usr_ux = 'NORMAL';
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [usr_username] column value.
+ *
+ * @return string
+ */
+ public function getUsrUsername()
+ {
+
+ return $this->usr_username;
+ }
+
+ /**
+ * Get the [usr_password] column value.
+ *
+ * @return string
+ */
+ public function getUsrPassword()
+ {
+
+ return $this->usr_password;
+ }
+
+ /**
+ * Get the [usr_firstname] column value.
+ *
+ * @return string
+ */
+ public function getUsrFirstname()
+ {
+
+ return $this->usr_firstname;
+ }
+
+ /**
+ * Get the [usr_lastname] column value.
+ *
+ * @return string
+ */
+ public function getUsrLastname()
+ {
+
+ return $this->usr_lastname;
+ }
+
+ /**
+ * Get the [usr_email] column value.
+ *
+ * @return string
+ */
+ public function getUsrEmail()
+ {
+
+ return $this->usr_email;
+ }
+
+ /**
+ * Get the [optionally formatted] [usr_due_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getUsrDueDate($format = 'Y-m-d')
+ {
+
+ if ($this->usr_due_date === null || $this->usr_due_date === '') {
+ return null;
+ } elseif (!is_int($this->usr_due_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->usr_due_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [usr_due_date] as date/time value: " .
+ var_export($this->usr_due_date, true));
+ }
+ } else {
+ $ts = $this->usr_due_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [usr_create_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getUsrCreateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->usr_create_date === null || $this->usr_create_date === '') {
+ return null;
+ } elseif (!is_int($this->usr_create_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->usr_create_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [usr_create_date] as date/time value: " .
+ var_export($this->usr_create_date, true));
+ }
+ } else {
+ $ts = $this->usr_create_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [optionally formatted] [usr_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getUsrUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->usr_update_date === null || $this->usr_update_date === '') {
+ return null;
+ } elseif (!is_int($this->usr_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->usr_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [usr_update_date] as date/time value: " .
+ var_export($this->usr_update_date, true));
+ }
+ } else {
+ $ts = $this->usr_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [usr_status] column value.
+ *
+ * @return string
+ */
+ public function getUsrStatus()
+ {
+
+ return $this->usr_status;
+ }
+
+ /**
+ * Get the [usr_country] column value.
+ *
+ * @return string
+ */
+ public function getUsrCountry()
+ {
+
+ return $this->usr_country;
+ }
+
+ /**
+ * Get the [usr_city] column value.
+ *
+ * @return string
+ */
+ public function getUsrCity()
+ {
+
+ return $this->usr_city;
+ }
+
+ /**
+ * Get the [usr_location] column value.
+ *
+ * @return string
+ */
+ public function getUsrLocation()
+ {
+
+ return $this->usr_location;
+ }
+
+ /**
+ * Get the [usr_address] column value.
+ *
+ * @return string
+ */
+ public function getUsrAddress()
+ {
+
+ return $this->usr_address;
+ }
+
+ /**
+ * Get the [usr_phone] column value.
+ *
+ * @return string
+ */
+ public function getUsrPhone()
+ {
+
+ return $this->usr_phone;
+ }
+
+ /**
+ * Get the [usr_fax] column value.
+ *
+ * @return string
+ */
+ public function getUsrFax()
+ {
+
+ return $this->usr_fax;
+ }
+
+ /**
+ * Get the [usr_cellular] column value.
+ *
+ * @return string
+ */
+ public function getUsrCellular()
+ {
+
+ return $this->usr_cellular;
+ }
+
+ /**
+ * Get the [usr_zip_code] column value.
+ *
+ * @return string
+ */
+ public function getUsrZipCode()
+ {
+
+ return $this->usr_zip_code;
+ }
+
+ /**
+ * Get the [dep_uid] column value.
+ *
+ * @return string
+ */
+ public function getDepUid()
+ {
+
+ return $this->dep_uid;
+ }
+
+ /**
+ * Get the [usr_position] column value.
+ *
+ * @return string
+ */
+ public function getUsrPosition()
+ {
+
+ return $this->usr_position;
+ }
+
+ /**
+ * Get the [usr_resume] column value.
+ *
+ * @return string
+ */
+ public function getUsrResume()
+ {
+
+ return $this->usr_resume;
+ }
+
+ /**
+ * Get the [optionally formatted] [usr_birthday] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getUsrBirthday($format = 'Y-m-d')
+ {
+
+ if ($this->usr_birthday === null || $this->usr_birthday === '') {
+ return null;
+ } elseif (!is_int($this->usr_birthday)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->usr_birthday);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [usr_birthday] as date/time value: " .
+ var_export($this->usr_birthday, true));
+ }
+ } else {
+ $ts = $this->usr_birthday;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [usr_role] column value.
+ *
+ * @return string
+ */
+ public function getUsrRole()
+ {
+
+ return $this->usr_role;
+ }
+
+ /**
+ * Get the [usr_reports_to] column value.
+ *
+ * @return string
+ */
+ public function getUsrReportsTo()
+ {
+
+ return $this->usr_reports_to;
+ }
+
+ /**
+ * Get the [usr_replaced_by] column value.
+ *
+ * @return string
+ */
+ public function getUsrReplacedBy()
+ {
+
+ return $this->usr_replaced_by;
+ }
+
+ /**
+ * Get the [usr_ux] column value.
+ *
+ * @return string
+ */
+ public function getUsrUx()
+ {
+
+ return $this->usr_ux;
+ }
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [usr_username] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUsername($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_username !== $v || $v === '') {
+ $this->usr_username = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_USERNAME;
+ }
+
+ } // setUsrUsername()
+
+ /**
+ * Set the value of [usr_password] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrPassword($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_password !== $v || $v === '') {
+ $this->usr_password = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_PASSWORD;
+ }
+
+ } // setUsrPassword()
+
+ /**
+ * Set the value of [usr_firstname] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrFirstname($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_firstname !== $v || $v === '') {
+ $this->usr_firstname = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_FIRSTNAME;
+ }
+
+ } // setUsrFirstname()
+
+ /**
+ * Set the value of [usr_lastname] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrLastname($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_lastname !== $v || $v === '') {
+ $this->usr_lastname = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_LASTNAME;
+ }
+
+ } // setUsrLastname()
+
+ /**
+ * Set the value of [usr_email] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrEmail($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_email !== $v || $v === '') {
+ $this->usr_email = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_EMAIL;
+ }
+
+ } // setUsrEmail()
+
+ /**
+ * Set the value of [usr_due_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setUsrDueDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [usr_due_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->usr_due_date !== $ts) {
+ $this->usr_due_date = $ts;
+ $this->modifiedColumns[] = UsersPeer::USR_DUE_DATE;
+ }
+
+ } // setUsrDueDate()
+
+ /**
+ * Set the value of [usr_create_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setUsrCreateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [usr_create_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->usr_create_date !== $ts) {
+ $this->usr_create_date = $ts;
+ $this->modifiedColumns[] = UsersPeer::USR_CREATE_DATE;
+ }
+
+ } // setUsrCreateDate()
+
+ /**
+ * Set the value of [usr_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setUsrUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [usr_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->usr_update_date !== $ts) {
+ $this->usr_update_date = $ts;
+ $this->modifiedColumns[] = UsersPeer::USR_UPDATE_DATE;
+ }
+
+ } // setUsrUpdateDate()
+
+ /**
+ * Set the value of [usr_status] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrStatus($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_status !== $v || $v === 'ACTIVE') {
+ $this->usr_status = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_STATUS;
+ }
+
+ } // setUsrStatus()
+
+ /**
+ * Set the value of [usr_country] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrCountry($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_country !== $v || $v === '') {
+ $this->usr_country = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_COUNTRY;
+ }
+
+ } // setUsrCountry()
+
+ /**
+ * Set the value of [usr_city] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrCity($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_city !== $v || $v === '') {
+ $this->usr_city = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_CITY;
+ }
+
+ } // setUsrCity()
+
+ /**
+ * Set the value of [usr_location] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrLocation($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_location !== $v || $v === '') {
+ $this->usr_location = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_LOCATION;
+ }
+
+ } // setUsrLocation()
+
+ /**
+ * Set the value of [usr_address] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrAddress($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_address !== $v || $v === '') {
+ $this->usr_address = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_ADDRESS;
+ }
+
+ } // setUsrAddress()
+
+ /**
+ * Set the value of [usr_phone] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrPhone($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_phone !== $v || $v === '') {
+ $this->usr_phone = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_PHONE;
+ }
+
+ } // setUsrPhone()
+
+ /**
+ * Set the value of [usr_fax] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrFax($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_fax !== $v || $v === '') {
+ $this->usr_fax = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_FAX;
+ }
+
+ } // setUsrFax()
+
+ /**
+ * Set the value of [usr_cellular] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrCellular($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_cellular !== $v || $v === '') {
+ $this->usr_cellular = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_CELLULAR;
+ }
+
+ } // setUsrCellular()
+
+ /**
+ * Set the value of [usr_zip_code] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrZipCode($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_zip_code !== $v || $v === '') {
+ $this->usr_zip_code = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_ZIP_CODE;
+ }
+
+ } // setUsrZipCode()
+
+ /**
+ * Set the value of [dep_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setDepUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->dep_uid !== $v || $v === '') {
+ $this->dep_uid = $v;
+ $this->modifiedColumns[] = UsersPeer::DEP_UID;
+ }
+
+ } // setDepUid()
+
+ /**
+ * Set the value of [usr_position] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrPosition($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_position !== $v || $v === '') {
+ $this->usr_position = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_POSITION;
+ }
+
+ } // setUsrPosition()
+
+ /**
+ * Set the value of [usr_resume] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrResume($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_resume !== $v || $v === '') {
+ $this->usr_resume = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_RESUME;
+ }
+
+ } // setUsrResume()
+
+ /**
+ * Set the value of [usr_birthday] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setUsrBirthday($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [usr_birthday] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->usr_birthday !== $ts) {
+ $this->usr_birthday = $ts;
+ $this->modifiedColumns[] = UsersPeer::USR_BIRTHDAY;
+ }
+
+ } // setUsrBirthday()
+
+ /**
+ * Set the value of [usr_role] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrRole($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_role !== $v || $v === 'PROCESSMAKER_ADMIN') {
+ $this->usr_role = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_ROLE;
+ }
+
+ } // setUsrRole()
+
+ /**
+ * Set the value of [usr_reports_to] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrReportsTo($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_reports_to !== $v || $v === '') {
+ $this->usr_reports_to = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_REPORTS_TO;
+ }
+
+ } // setUsrReportsTo()
+
+ /**
+ * Set the value of [usr_replaced_by] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrReplacedBy($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+ if ($this->usr_replaced_by !== $v || $v === '') {
+ $this->usr_replaced_by = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_REPLACED_BY;
+ }
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var UsersPeer
- */
- protected static $peer;
+ } // setUsrReplacedBy()
+ /**
+ * Set the value of [usr_ux] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUx($v)
+ {
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+ if ($this->usr_ux !== $v || $v === 'NORMAL') {
+ $this->usr_ux = $v;
+ $this->modifiedColumns[] = UsersPeer::USR_UX;
+ }
- /**
- * The value for the usr_username field.
- * @var string
- */
- protected $usr_username = '';
+ } // setUsrUx()
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
- /**
- * The value for the usr_password field.
- * @var string
- */
- protected $usr_password = '';
+ $this->usr_uid = $rs->getString($startcol + 0);
+ $this->usr_username = $rs->getString($startcol + 1);
- /**
- * The value for the usr_firstname field.
- * @var string
- */
- protected $usr_firstname = '';
+ $this->usr_password = $rs->getString($startcol + 2);
+
+ $this->usr_firstname = $rs->getString($startcol + 3);
+
+ $this->usr_lastname = $rs->getString($startcol + 4);
+ $this->usr_email = $rs->getString($startcol + 5);
+
+ $this->usr_due_date = $rs->getDate($startcol + 6, null);
- /**
- * The value for the usr_lastname field.
- * @var string
- */
- protected $usr_lastname = '';
+ $this->usr_create_date = $rs->getTimestamp($startcol + 7, null);
+
+ $this->usr_update_date = $rs->getTimestamp($startcol + 8, null);
+
+ $this->usr_status = $rs->getString($startcol + 9);
+
+ $this->usr_country = $rs->getString($startcol + 10);
+
+ $this->usr_city = $rs->getString($startcol + 11);
+
+ $this->usr_location = $rs->getString($startcol + 12);
+
+ $this->usr_address = $rs->getString($startcol + 13);
+
+ $this->usr_phone = $rs->getString($startcol + 14);
+
+ $this->usr_fax = $rs->getString($startcol + 15);
+
+ $this->usr_cellular = $rs->getString($startcol + 16);
+
+ $this->usr_zip_code = $rs->getString($startcol + 17);
+
+ $this->dep_uid = $rs->getString($startcol + 18);
+
+ $this->usr_position = $rs->getString($startcol + 19);
+
+ $this->usr_resume = $rs->getString($startcol + 20);
+
+ $this->usr_birthday = $rs->getDate($startcol + 21, null);
+
+ $this->usr_role = $rs->getString($startcol + 22);
+
+ $this->usr_reports_to = $rs->getString($startcol + 23);
+
+ $this->usr_replaced_by = $rs->getString($startcol + 24);
+
+ $this->usr_ux = $rs->getString($startcol + 25);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 26; // 26 = UsersPeer::NUM_COLUMNS - UsersPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Users object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(UsersPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ UsersPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(UsersPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = UsersPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += UsersPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = UsersPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = UsersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getUsrUid();
+ break;
+ case 1:
+ return $this->getUsrUsername();
+ break;
+ case 2:
+ return $this->getUsrPassword();
+ break;
+ case 3:
+ return $this->getUsrFirstname();
+ break;
+ case 4:
+ return $this->getUsrLastname();
+ break;
+ case 5:
+ return $this->getUsrEmail();
+ break;
+ case 6:
+ return $this->getUsrDueDate();
+ break;
+ case 7:
+ return $this->getUsrCreateDate();
+ break;
+ case 8:
+ return $this->getUsrUpdateDate();
+ break;
+ case 9:
+ return $this->getUsrStatus();
+ break;
+ case 10:
+ return $this->getUsrCountry();
+ break;
+ case 11:
+ return $this->getUsrCity();
+ break;
+ case 12:
+ return $this->getUsrLocation();
+ break;
+ case 13:
+ return $this->getUsrAddress();
+ break;
+ case 14:
+ return $this->getUsrPhone();
+ break;
+ case 15:
+ return $this->getUsrFax();
+ break;
+ case 16:
+ return $this->getUsrCellular();
+ break;
+ case 17:
+ return $this->getUsrZipCode();
+ break;
+ case 18:
+ return $this->getDepUid();
+ break;
+ case 19:
+ return $this->getUsrPosition();
+ break;
+ case 20:
+ return $this->getUsrResume();
+ break;
+ case 21:
+ return $this->getUsrBirthday();
+ break;
+ case 22:
+ return $this->getUsrRole();
+ break;
+ case 23:
+ return $this->getUsrReportsTo();
+ break;
+ case 24:
+ return $this->getUsrReplacedBy();
+ break;
+ case 25:
+ return $this->getUsrUx();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = UsersPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getUsrUid(),
+ $keys[1] => $this->getUsrUsername(),
+ $keys[2] => $this->getUsrPassword(),
+ $keys[3] => $this->getUsrFirstname(),
+ $keys[4] => $this->getUsrLastname(),
+ $keys[5] => $this->getUsrEmail(),
+ $keys[6] => $this->getUsrDueDate(),
+ $keys[7] => $this->getUsrCreateDate(),
+ $keys[8] => $this->getUsrUpdateDate(),
+ $keys[9] => $this->getUsrStatus(),
+ $keys[10] => $this->getUsrCountry(),
+ $keys[11] => $this->getUsrCity(),
+ $keys[12] => $this->getUsrLocation(),
+ $keys[13] => $this->getUsrAddress(),
+ $keys[14] => $this->getUsrPhone(),
+ $keys[15] => $this->getUsrFax(),
+ $keys[16] => $this->getUsrCellular(),
+ $keys[17] => $this->getUsrZipCode(),
+ $keys[18] => $this->getDepUid(),
+ $keys[19] => $this->getUsrPosition(),
+ $keys[20] => $this->getUsrResume(),
+ $keys[21] => $this->getUsrBirthday(),
+ $keys[22] => $this->getUsrRole(),
+ $keys[23] => $this->getUsrReportsTo(),
+ $keys[24] => $this->getUsrReplacedBy(),
+ $keys[25] => $this->getUsrUx(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = UsersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setUsrUid($value);
+ break;
+ case 1:
+ $this->setUsrUsername($value);
+ break;
+ case 2:
+ $this->setUsrPassword($value);
+ break;
+ case 3:
+ $this->setUsrFirstname($value);
+ break;
+ case 4:
+ $this->setUsrLastname($value);
+ break;
+ case 5:
+ $this->setUsrEmail($value);
+ break;
+ case 6:
+ $this->setUsrDueDate($value);
+ break;
+ case 7:
+ $this->setUsrCreateDate($value);
+ break;
+ case 8:
+ $this->setUsrUpdateDate($value);
+ break;
+ case 9:
+ $this->setUsrStatus($value);
+ break;
+ case 10:
+ $this->setUsrCountry($value);
+ break;
+ case 11:
+ $this->setUsrCity($value);
+ break;
+ case 12:
+ $this->setUsrLocation($value);
+ break;
+ case 13:
+ $this->setUsrAddress($value);
+ break;
+ case 14:
+ $this->setUsrPhone($value);
+ break;
+ case 15:
+ $this->setUsrFax($value);
+ break;
+ case 16:
+ $this->setUsrCellular($value);
+ break;
+ case 17:
+ $this->setUsrZipCode($value);
+ break;
+ case 18:
+ $this->setDepUid($value);
+ break;
+ case 19:
+ $this->setUsrPosition($value);
+ break;
+ case 20:
+ $this->setUsrResume($value);
+ break;
+ case 21:
+ $this->setUsrBirthday($value);
+ break;
+ case 22:
+ $this->setUsrRole($value);
+ break;
+ case 23:
+ $this->setUsrReportsTo($value);
+ break;
+ case 24:
+ $this->setUsrReplacedBy($value);
+ break;
+ case 25:
+ $this->setUsrUx($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = UsersPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setUsrUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setUsrUsername($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setUsrPassword($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setUsrFirstname($arr[$keys[3]]);
+ }
+
+ if (array_key_exists($keys[4], $arr)) {
+ $this->setUsrLastname($arr[$keys[4]]);
+ }
+
+ if (array_key_exists($keys[5], $arr)) {
+ $this->setUsrEmail($arr[$keys[5]]);
+ }
+
+ if (array_key_exists($keys[6], $arr)) {
+ $this->setUsrDueDate($arr[$keys[6]]);
+ }
+
+ if (array_key_exists($keys[7], $arr)) {
+ $this->setUsrCreateDate($arr[$keys[7]]);
+ }
+
+ if (array_key_exists($keys[8], $arr)) {
+ $this->setUsrUpdateDate($arr[$keys[8]]);
+ }
+
+ if (array_key_exists($keys[9], $arr)) {
+ $this->setUsrStatus($arr[$keys[9]]);
+ }
+
+ if (array_key_exists($keys[10], $arr)) {
+ $this->setUsrCountry($arr[$keys[10]]);
+ }
+
+ if (array_key_exists($keys[11], $arr)) {
+ $this->setUsrCity($arr[$keys[11]]);
+ }
+
+ if (array_key_exists($keys[12], $arr)) {
+ $this->setUsrLocation($arr[$keys[12]]);
+ }
+
+ if (array_key_exists($keys[13], $arr)) {
+ $this->setUsrAddress($arr[$keys[13]]);
+ }
+
+ if (array_key_exists($keys[14], $arr)) {
+ $this->setUsrPhone($arr[$keys[14]]);
+ }
+
+ if (array_key_exists($keys[15], $arr)) {
+ $this->setUsrFax($arr[$keys[15]]);
+ }
+
+ if (array_key_exists($keys[16], $arr)) {
+ $this->setUsrCellular($arr[$keys[16]]);
+ }
+
+ if (array_key_exists($keys[17], $arr)) {
+ $this->setUsrZipCode($arr[$keys[17]]);
+ }
+
+ if (array_key_exists($keys[18], $arr)) {
+ $this->setDepUid($arr[$keys[18]]);
+ }
+
+ if (array_key_exists($keys[19], $arr)) {
+ $this->setUsrPosition($arr[$keys[19]]);
+ }
+
+ if (array_key_exists($keys[20], $arr)) {
+ $this->setUsrResume($arr[$keys[20]]);
+ }
+
+ if (array_key_exists($keys[21], $arr)) {
+ $this->setUsrBirthday($arr[$keys[21]]);
+ }
+
+ if (array_key_exists($keys[22], $arr)) {
+ $this->setUsrRole($arr[$keys[22]]);
+ }
+
+ if (array_key_exists($keys[23], $arr)) {
+ $this->setUsrReportsTo($arr[$keys[23]]);
+ }
+
+ if (array_key_exists($keys[24], $arr)) {
+ $this->setUsrReplacedBy($arr[$keys[24]]);
+ }
+ if (array_key_exists($keys[25], $arr)) {
+ $this->setUsrUx($arr[$keys[25]]);
+ }
- /**
- * The value for the usr_email field.
- * @var string
- */
- protected $usr_email = '';
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(UsersPeer::DATABASE_NAME);
+ if ($this->isColumnModified(UsersPeer::USR_UID)) {
+ $criteria->add(UsersPeer::USR_UID, $this->usr_uid);
+ }
- /**
- * The value for the usr_due_date field.
- * @var int
- */
- protected $usr_due_date;
+ if ($this->isColumnModified(UsersPeer::USR_USERNAME)) {
+ $criteria->add(UsersPeer::USR_USERNAME, $this->usr_username);
+ }
+ if ($this->isColumnModified(UsersPeer::USR_PASSWORD)) {
+ $criteria->add(UsersPeer::USR_PASSWORD, $this->usr_password);
+ }
- /**
- * The value for the usr_create_date field.
- * @var int
- */
- protected $usr_create_date;
+ if ($this->isColumnModified(UsersPeer::USR_FIRSTNAME)) {
+ $criteria->add(UsersPeer::USR_FIRSTNAME, $this->usr_firstname);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_LASTNAME)) {
+ $criteria->add(UsersPeer::USR_LASTNAME, $this->usr_lastname);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_EMAIL)) {
+ $criteria->add(UsersPeer::USR_EMAIL, $this->usr_email);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_DUE_DATE)) {
+ $criteria->add(UsersPeer::USR_DUE_DATE, $this->usr_due_date);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_CREATE_DATE)) {
+ $criteria->add(UsersPeer::USR_CREATE_DATE, $this->usr_create_date);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_UPDATE_DATE)) {
+ $criteria->add(UsersPeer::USR_UPDATE_DATE, $this->usr_update_date);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_STATUS)) {
+ $criteria->add(UsersPeer::USR_STATUS, $this->usr_status);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_COUNTRY)) {
+ $criteria->add(UsersPeer::USR_COUNTRY, $this->usr_country);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_CITY)) {
+ $criteria->add(UsersPeer::USR_CITY, $this->usr_city);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_LOCATION)) {
+ $criteria->add(UsersPeer::USR_LOCATION, $this->usr_location);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_ADDRESS)) {
+ $criteria->add(UsersPeer::USR_ADDRESS, $this->usr_address);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_PHONE)) {
+ $criteria->add(UsersPeer::USR_PHONE, $this->usr_phone);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_FAX)) {
+ $criteria->add(UsersPeer::USR_FAX, $this->usr_fax);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_CELLULAR)) {
+ $criteria->add(UsersPeer::USR_CELLULAR, $this->usr_cellular);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_ZIP_CODE)) {
+ $criteria->add(UsersPeer::USR_ZIP_CODE, $this->usr_zip_code);
+ }
+
+ if ($this->isColumnModified(UsersPeer::DEP_UID)) {
+ $criteria->add(UsersPeer::DEP_UID, $this->dep_uid);
+ }
+
+ if ($this->isColumnModified(UsersPeer::USR_POSITION)) {
+ $criteria->add(UsersPeer::USR_POSITION, $this->usr_position);
+ }
+ if ($this->isColumnModified(UsersPeer::USR_RESUME)) {
+ $criteria->add(UsersPeer::USR_RESUME, $this->usr_resume);
+ }
- /**
- * The value for the usr_update_date field.
- * @var int
- */
- protected $usr_update_date;
+ if ($this->isColumnModified(UsersPeer::USR_BIRTHDAY)) {
+ $criteria->add(UsersPeer::USR_BIRTHDAY, $this->usr_birthday);
+ }
+ if ($this->isColumnModified(UsersPeer::USR_ROLE)) {
+ $criteria->add(UsersPeer::USR_ROLE, $this->usr_role);
+ }
- /**
- * The value for the usr_status field.
- * @var string
- */
- protected $usr_status = 'ACTIVE';
+ if ($this->isColumnModified(UsersPeer::USR_REPORTS_TO)) {
+ $criteria->add(UsersPeer::USR_REPORTS_TO, $this->usr_reports_to);
+ }
+ if ($this->isColumnModified(UsersPeer::USR_REPLACED_BY)) {
+ $criteria->add(UsersPeer::USR_REPLACED_BY, $this->usr_replaced_by);
+ }
- /**
- * The value for the usr_country field.
- * @var string
- */
- protected $usr_country = '';
+ if ($this->isColumnModified(UsersPeer::USR_UX)) {
+ $criteria->add(UsersPeer::USR_UX, $this->usr_ux);
+ }
- /**
- * The value for the usr_city field.
- * @var string
- */
- protected $usr_city = '';
+ return $criteria;
+ }
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(UsersPeer::DATABASE_NAME);
- /**
- * The value for the usr_location field.
- * @var string
- */
- protected $usr_location = '';
+ $criteria->add(UsersPeer::USR_UID, $this->usr_uid);
+ return $criteria;
+ }
- /**
- * The value for the usr_address field.
- * @var string
- */
- protected $usr_address = '';
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getUsrUid();
+ }
+ /**
+ * Generic method to set the primary key (usr_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setUsrUid($key);
+ }
- /**
- * The value for the usr_phone field.
- * @var string
- */
- protected $usr_phone = '';
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of Users (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+ $copyObj->setUsrUsername($this->usr_username);
- /**
- * The value for the usr_fax field.
- * @var string
- */
- protected $usr_fax = '';
+ $copyObj->setUsrPassword($this->usr_password);
+ $copyObj->setUsrFirstname($this->usr_firstname);
- /**
- * The value for the usr_cellular field.
- * @var string
- */
- protected $usr_cellular = '';
+ $copyObj->setUsrLastname($this->usr_lastname);
+ $copyObj->setUsrEmail($this->usr_email);
- /**
- * The value for the usr_zip_code field.
- * @var string
- */
- protected $usr_zip_code = '';
+ $copyObj->setUsrDueDate($this->usr_due_date);
+ $copyObj->setUsrCreateDate($this->usr_create_date);
- /**
- * The value for the dep_uid field.
- * @var string
- */
- protected $dep_uid = '';
+ $copyObj->setUsrUpdateDate($this->usr_update_date);
+ $copyObj->setUsrStatus($this->usr_status);
- /**
- * The value for the usr_position field.
- * @var string
- */
- protected $usr_position = '';
+ $copyObj->setUsrCountry($this->usr_country);
+ $copyObj->setUsrCity($this->usr_city);
- /**
- * The value for the usr_resume field.
- * @var string
- */
- protected $usr_resume = '';
-
+ $copyObj->setUsrLocation($this->usr_location);
- /**
- * The value for the usr_birthday field.
- * @var int
- */
- protected $usr_birthday;
-
-
- /**
- * The value for the usr_role field.
- * @var string
- */
- protected $usr_role = 'PROCESSMAKER_ADMIN';
-
-
- /**
- * The value for the usr_reports_to field.
- * @var string
- */
- protected $usr_reports_to = '';
-
-
- /**
- * The value for the usr_replaced_by field.
- * @var string
- */
- protected $usr_replaced_by = '';
-
-
- /**
- * The value for the usr_ux field.
- * @var string
- */
- protected $usr_ux = 'NORMAL';
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [usr_username] column value.
- *
- * @return string
- */
- public function getUsrUsername()
- {
-
- return $this->usr_username;
- }
-
- /**
- * Get the [usr_password] column value.
- *
- * @return string
- */
- public function getUsrPassword()
- {
-
- return $this->usr_password;
- }
-
- /**
- * Get the [usr_firstname] column value.
- *
- * @return string
- */
- public function getUsrFirstname()
- {
-
- return $this->usr_firstname;
- }
-
- /**
- * Get the [usr_lastname] column value.
- *
- * @return string
- */
- public function getUsrLastname()
- {
-
- return $this->usr_lastname;
- }
-
- /**
- * Get the [usr_email] column value.
- *
- * @return string
- */
- public function getUsrEmail()
- {
-
- return $this->usr_email;
- }
-
- /**
- * Get the [optionally formatted] [usr_due_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getUsrDueDate($format = 'Y-m-d')
- {
-
- if ($this->usr_due_date === null || $this->usr_due_date === '') {
- return null;
- } elseif (!is_int($this->usr_due_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->usr_due_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [usr_due_date] as date/time value: " . var_export($this->usr_due_date, true));
- }
- } else {
- $ts = $this->usr_due_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [usr_create_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getUsrCreateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->usr_create_date === null || $this->usr_create_date === '') {
- return null;
- } elseif (!is_int($this->usr_create_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->usr_create_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [usr_create_date] as date/time value: " . var_export($this->usr_create_date, true));
- }
- } else {
- $ts = $this->usr_create_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [optionally formatted] [usr_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getUsrUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->usr_update_date === null || $this->usr_update_date === '') {
- return null;
- } elseif (!is_int($this->usr_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->usr_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [usr_update_date] as date/time value: " . var_export($this->usr_update_date, true));
- }
- } else {
- $ts = $this->usr_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [usr_status] column value.
- *
- * @return string
- */
- public function getUsrStatus()
- {
-
- return $this->usr_status;
- }
-
- /**
- * Get the [usr_country] column value.
- *
- * @return string
- */
- public function getUsrCountry()
- {
-
- return $this->usr_country;
- }
-
- /**
- * Get the [usr_city] column value.
- *
- * @return string
- */
- public function getUsrCity()
- {
-
- return $this->usr_city;
- }
-
- /**
- * Get the [usr_location] column value.
- *
- * @return string
- */
- public function getUsrLocation()
- {
-
- return $this->usr_location;
- }
-
- /**
- * Get the [usr_address] column value.
- *
- * @return string
- */
- public function getUsrAddress()
- {
-
- return $this->usr_address;
- }
-
- /**
- * Get the [usr_phone] column value.
- *
- * @return string
- */
- public function getUsrPhone()
- {
-
- return $this->usr_phone;
- }
-
- /**
- * Get the [usr_fax] column value.
- *
- * @return string
- */
- public function getUsrFax()
- {
-
- return $this->usr_fax;
- }
-
- /**
- * Get the [usr_cellular] column value.
- *
- * @return string
- */
- public function getUsrCellular()
- {
-
- return $this->usr_cellular;
- }
-
- /**
- * Get the [usr_zip_code] column value.
- *
- * @return string
- */
- public function getUsrZipCode()
- {
-
- return $this->usr_zip_code;
- }
-
- /**
- * Get the [dep_uid] column value.
- *
- * @return string
- */
- public function getDepUid()
- {
-
- return $this->dep_uid;
- }
-
- /**
- * Get the [usr_position] column value.
- *
- * @return string
- */
- public function getUsrPosition()
- {
-
- return $this->usr_position;
- }
-
- /**
- * Get the [usr_resume] column value.
- *
- * @return string
- */
- public function getUsrResume()
- {
-
- return $this->usr_resume;
- }
-
- /**
- * Get the [optionally formatted] [usr_birthday] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getUsrBirthday($format = 'Y-m-d')
- {
-
- if ($this->usr_birthday === null || $this->usr_birthday === '') {
- return null;
- } elseif (!is_int($this->usr_birthday)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->usr_birthday);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [usr_birthday] as date/time value: " . var_export($this->usr_birthday, true));
- }
- } else {
- $ts = $this->usr_birthday;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [usr_role] column value.
- *
- * @return string
- */
- public function getUsrRole()
- {
-
- return $this->usr_role;
- }
-
- /**
- * Get the [usr_reports_to] column value.
- *
- * @return string
- */
- public function getUsrReportsTo()
- {
-
- return $this->usr_reports_to;
- }
-
- /**
- * Get the [usr_replaced_by] column value.
- *
- * @return string
- */
- public function getUsrReplacedBy()
- {
-
- return $this->usr_replaced_by;
- }
-
- /**
- * Get the [usr_ux] column value.
- *
- * @return string
- */
- public function getUsrUx()
- {
-
- return $this->usr_ux;
- }
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = UsersPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [usr_username] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUsername($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_username !== $v || $v === '') {
- $this->usr_username = $v;
- $this->modifiedColumns[] = UsersPeer::USR_USERNAME;
- }
-
- } // setUsrUsername()
-
- /**
- * Set the value of [usr_password] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrPassword($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_password !== $v || $v === '') {
- $this->usr_password = $v;
- $this->modifiedColumns[] = UsersPeer::USR_PASSWORD;
- }
-
- } // setUsrPassword()
-
- /**
- * Set the value of [usr_firstname] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrFirstname($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_firstname !== $v || $v === '') {
- $this->usr_firstname = $v;
- $this->modifiedColumns[] = UsersPeer::USR_FIRSTNAME;
- }
-
- } // setUsrFirstname()
-
- /**
- * Set the value of [usr_lastname] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrLastname($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_lastname !== $v || $v === '') {
- $this->usr_lastname = $v;
- $this->modifiedColumns[] = UsersPeer::USR_LASTNAME;
- }
-
- } // setUsrLastname()
-
- /**
- * Set the value of [usr_email] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrEmail($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_email !== $v || $v === '') {
- $this->usr_email = $v;
- $this->modifiedColumns[] = UsersPeer::USR_EMAIL;
- }
-
- } // setUsrEmail()
-
- /**
- * Set the value of [usr_due_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setUsrDueDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [usr_due_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->usr_due_date !== $ts) {
- $this->usr_due_date = $ts;
- $this->modifiedColumns[] = UsersPeer::USR_DUE_DATE;
- }
-
- } // setUsrDueDate()
-
- /**
- * Set the value of [usr_create_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setUsrCreateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [usr_create_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->usr_create_date !== $ts) {
- $this->usr_create_date = $ts;
- $this->modifiedColumns[] = UsersPeer::USR_CREATE_DATE;
- }
-
- } // setUsrCreateDate()
-
- /**
- * Set the value of [usr_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setUsrUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [usr_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->usr_update_date !== $ts) {
- $this->usr_update_date = $ts;
- $this->modifiedColumns[] = UsersPeer::USR_UPDATE_DATE;
- }
-
- } // setUsrUpdateDate()
-
- /**
- * Set the value of [usr_status] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrStatus($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_status !== $v || $v === 'ACTIVE') {
- $this->usr_status = $v;
- $this->modifiedColumns[] = UsersPeer::USR_STATUS;
- }
-
- } // setUsrStatus()
-
- /**
- * Set the value of [usr_country] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrCountry($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_country !== $v || $v === '') {
- $this->usr_country = $v;
- $this->modifiedColumns[] = UsersPeer::USR_COUNTRY;
- }
-
- } // setUsrCountry()
-
- /**
- * Set the value of [usr_city] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrCity($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_city !== $v || $v === '') {
- $this->usr_city = $v;
- $this->modifiedColumns[] = UsersPeer::USR_CITY;
- }
-
- } // setUsrCity()
-
- /**
- * Set the value of [usr_location] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrLocation($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_location !== $v || $v === '') {
- $this->usr_location = $v;
- $this->modifiedColumns[] = UsersPeer::USR_LOCATION;
- }
-
- } // setUsrLocation()
-
- /**
- * Set the value of [usr_address] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrAddress($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_address !== $v || $v === '') {
- $this->usr_address = $v;
- $this->modifiedColumns[] = UsersPeer::USR_ADDRESS;
- }
-
- } // setUsrAddress()
-
- /**
- * Set the value of [usr_phone] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrPhone($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_phone !== $v || $v === '') {
- $this->usr_phone = $v;
- $this->modifiedColumns[] = UsersPeer::USR_PHONE;
- }
-
- } // setUsrPhone()
-
- /**
- * Set the value of [usr_fax] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrFax($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_fax !== $v || $v === '') {
- $this->usr_fax = $v;
- $this->modifiedColumns[] = UsersPeer::USR_FAX;
- }
-
- } // setUsrFax()
-
- /**
- * Set the value of [usr_cellular] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrCellular($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_cellular !== $v || $v === '') {
- $this->usr_cellular = $v;
- $this->modifiedColumns[] = UsersPeer::USR_CELLULAR;
- }
-
- } // setUsrCellular()
-
- /**
- * Set the value of [usr_zip_code] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrZipCode($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_zip_code !== $v || $v === '') {
- $this->usr_zip_code = $v;
- $this->modifiedColumns[] = UsersPeer::USR_ZIP_CODE;
- }
-
- } // setUsrZipCode()
-
- /**
- * Set the value of [dep_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setDepUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->dep_uid !== $v || $v === '') {
- $this->dep_uid = $v;
- $this->modifiedColumns[] = UsersPeer::DEP_UID;
- }
-
- } // setDepUid()
-
- /**
- * Set the value of [usr_position] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrPosition($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_position !== $v || $v === '') {
- $this->usr_position = $v;
- $this->modifiedColumns[] = UsersPeer::USR_POSITION;
- }
-
- } // setUsrPosition()
-
- /**
- * Set the value of [usr_resume] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrResume($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_resume !== $v || $v === '') {
- $this->usr_resume = $v;
- $this->modifiedColumns[] = UsersPeer::USR_RESUME;
- }
-
- } // setUsrResume()
-
- /**
- * Set the value of [usr_birthday] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setUsrBirthday($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [usr_birthday] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->usr_birthday !== $ts) {
- $this->usr_birthday = $ts;
- $this->modifiedColumns[] = UsersPeer::USR_BIRTHDAY;
- }
-
- } // setUsrBirthday()
-
- /**
- * Set the value of [usr_role] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrRole($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_role !== $v || $v === 'PROCESSMAKER_ADMIN') {
- $this->usr_role = $v;
- $this->modifiedColumns[] = UsersPeer::USR_ROLE;
- }
-
- } // setUsrRole()
-
- /**
- * Set the value of [usr_reports_to] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrReportsTo($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_reports_to !== $v || $v === '') {
- $this->usr_reports_to = $v;
- $this->modifiedColumns[] = UsersPeer::USR_REPORTS_TO;
- }
-
- } // setUsrReportsTo()
-
- /**
- * Set the value of [usr_replaced_by] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrReplacedBy($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
+ $copyObj->setUsrAddress($this->usr_address);
- if ($this->usr_replaced_by !== $v || $v === '') {
- $this->usr_replaced_by = $v;
- $this->modifiedColumns[] = UsersPeer::USR_REPLACED_BY;
- }
+ $copyObj->setUsrPhone($this->usr_phone);
- } // setUsrReplacedBy()
+ $copyObj->setUsrFax($this->usr_fax);
- /**
- * Set the value of [usr_ux] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUx($v)
- {
+ $copyObj->setUsrCellular($this->usr_cellular);
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
+ $copyObj->setUsrZipCode($this->usr_zip_code);
- if ($this->usr_ux !== $v || $v === 'NORMAL') {
- $this->usr_ux = $v;
- $this->modifiedColumns[] = UsersPeer::USR_UX;
- }
+ $copyObj->setDepUid($this->dep_uid);
- } // setUsrUx()
+ $copyObj->setUsrPosition($this->usr_position);
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
+ $copyObj->setUsrResume($this->usr_resume);
- $this->usr_uid = $rs->getString($startcol + 0);
+ $copyObj->setUsrBirthday($this->usr_birthday);
- $this->usr_username = $rs->getString($startcol + 1);
+ $copyObj->setUsrRole($this->usr_role);
- $this->usr_password = $rs->getString($startcol + 2);
-
- $this->usr_firstname = $rs->getString($startcol + 3);
-
- $this->usr_lastname = $rs->getString($startcol + 4);
+ $copyObj->setUsrReportsTo($this->usr_reports_to);
- $this->usr_email = $rs->getString($startcol + 5);
-
- $this->usr_due_date = $rs->getDate($startcol + 6, null);
+ $copyObj->setUsrReplacedBy($this->usr_replaced_by);
- $this->usr_create_date = $rs->getTimestamp($startcol + 7, null);
-
- $this->usr_update_date = $rs->getTimestamp($startcol + 8, null);
-
- $this->usr_status = $rs->getString($startcol + 9);
-
- $this->usr_country = $rs->getString($startcol + 10);
-
- $this->usr_city = $rs->getString($startcol + 11);
-
- $this->usr_location = $rs->getString($startcol + 12);
-
- $this->usr_address = $rs->getString($startcol + 13);
-
- $this->usr_phone = $rs->getString($startcol + 14);
-
- $this->usr_fax = $rs->getString($startcol + 15);
-
- $this->usr_cellular = $rs->getString($startcol + 16);
-
- $this->usr_zip_code = $rs->getString($startcol + 17);
-
- $this->dep_uid = $rs->getString($startcol + 18);
-
- $this->usr_position = $rs->getString($startcol + 19);
-
- $this->usr_resume = $rs->getString($startcol + 20);
-
- $this->usr_birthday = $rs->getDate($startcol + 21, null);
-
- $this->usr_role = $rs->getString($startcol + 22);
-
- $this->usr_reports_to = $rs->getString($startcol + 23);
-
- $this->usr_replaced_by = $rs->getString($startcol + 24);
-
- $this->usr_ux = $rs->getString($startcol + 25);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 26; // 26 = UsersPeer::NUM_COLUMNS - UsersPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating Users object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(UsersPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- UsersPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(UsersPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = UsersPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += UsersPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = UsersPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = UsersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getUsrUid();
- break;
- case 1:
- return $this->getUsrUsername();
- break;
- case 2:
- return $this->getUsrPassword();
- break;
- case 3:
- return $this->getUsrFirstname();
- break;
- case 4:
- return $this->getUsrLastname();
- break;
- case 5:
- return $this->getUsrEmail();
- break;
- case 6:
- return $this->getUsrDueDate();
- break;
- case 7:
- return $this->getUsrCreateDate();
- break;
- case 8:
- return $this->getUsrUpdateDate();
- break;
- case 9:
- return $this->getUsrStatus();
- break;
- case 10:
- return $this->getUsrCountry();
- break;
- case 11:
- return $this->getUsrCity();
- break;
- case 12:
- return $this->getUsrLocation();
- break;
- case 13:
- return $this->getUsrAddress();
- break;
- case 14:
- return $this->getUsrPhone();
- break;
- case 15:
- return $this->getUsrFax();
- break;
- case 16:
- return $this->getUsrCellular();
- break;
- case 17:
- return $this->getUsrZipCode();
- break;
- case 18:
- return $this->getDepUid();
- break;
- case 19:
- return $this->getUsrPosition();
- break;
- case 20:
- return $this->getUsrResume();
- break;
- case 21:
- return $this->getUsrBirthday();
- break;
- case 22:
- return $this->getUsrRole();
- break;
- case 23:
- return $this->getUsrReportsTo();
- break;
- case 24:
- return $this->getUsrReplacedBy();
- break;
- case 25:
- return $this->getUsrUx();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = UsersPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getUsrUid(),
- $keys[1] => $this->getUsrUsername(),
- $keys[2] => $this->getUsrPassword(),
- $keys[3] => $this->getUsrFirstname(),
- $keys[4] => $this->getUsrLastname(),
- $keys[5] => $this->getUsrEmail(),
- $keys[6] => $this->getUsrDueDate(),
- $keys[7] => $this->getUsrCreateDate(),
- $keys[8] => $this->getUsrUpdateDate(),
- $keys[9] => $this->getUsrStatus(),
- $keys[10] => $this->getUsrCountry(),
- $keys[11] => $this->getUsrCity(),
- $keys[12] => $this->getUsrLocation(),
- $keys[13] => $this->getUsrAddress(),
- $keys[14] => $this->getUsrPhone(),
- $keys[15] => $this->getUsrFax(),
- $keys[16] => $this->getUsrCellular(),
- $keys[17] => $this->getUsrZipCode(),
- $keys[18] => $this->getDepUid(),
- $keys[19] => $this->getUsrPosition(),
- $keys[20] => $this->getUsrResume(),
- $keys[21] => $this->getUsrBirthday(),
- $keys[22] => $this->getUsrRole(),
- $keys[23] => $this->getUsrReportsTo(),
- $keys[24] => $this->getUsrReplacedBy(),
- $keys[25] => $this->getUsrUx(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = UsersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setUsrUid($value);
- break;
- case 1:
- $this->setUsrUsername($value);
- break;
- case 2:
- $this->setUsrPassword($value);
- break;
- case 3:
- $this->setUsrFirstname($value);
- break;
- case 4:
- $this->setUsrLastname($value);
- break;
- case 5:
- $this->setUsrEmail($value);
- break;
- case 6:
- $this->setUsrDueDate($value);
- break;
- case 7:
- $this->setUsrCreateDate($value);
- break;
- case 8:
- $this->setUsrUpdateDate($value);
- break;
- case 9:
- $this->setUsrStatus($value);
- break;
- case 10:
- $this->setUsrCountry($value);
- break;
- case 11:
- $this->setUsrCity($value);
- break;
- case 12:
- $this->setUsrLocation($value);
- break;
- case 13:
- $this->setUsrAddress($value);
- break;
- case 14:
- $this->setUsrPhone($value);
- break;
- case 15:
- $this->setUsrFax($value);
- break;
- case 16:
- $this->setUsrCellular($value);
- break;
- case 17:
- $this->setUsrZipCode($value);
- break;
- case 18:
- $this->setDepUid($value);
- break;
- case 19:
- $this->setUsrPosition($value);
- break;
- case 20:
- $this->setUsrResume($value);
- break;
- case 21:
- $this->setUsrBirthday($value);
- break;
- case 22:
- $this->setUsrRole($value);
- break;
- case 23:
- $this->setUsrReportsTo($value);
- break;
- case 24:
- $this->setUsrReplacedBy($value);
- break;
- case 25:
- $this->setUsrUx($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = UsersPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setUsrUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setUsrUsername($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setUsrPassword($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setUsrFirstname($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setUsrLastname($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setUsrEmail($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setUsrDueDate($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setUsrCreateDate($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setUsrUpdateDate($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setUsrStatus($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setUsrCountry($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setUsrCity($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setUsrLocation($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setUsrAddress($arr[$keys[13]]);
- if (array_key_exists($keys[14], $arr)) $this->setUsrPhone($arr[$keys[14]]);
- if (array_key_exists($keys[15], $arr)) $this->setUsrFax($arr[$keys[15]]);
- if (array_key_exists($keys[16], $arr)) $this->setUsrCellular($arr[$keys[16]]);
- if (array_key_exists($keys[17], $arr)) $this->setUsrZipCode($arr[$keys[17]]);
- if (array_key_exists($keys[18], $arr)) $this->setDepUid($arr[$keys[18]]);
- if (array_key_exists($keys[19], $arr)) $this->setUsrPosition($arr[$keys[19]]);
- if (array_key_exists($keys[20], $arr)) $this->setUsrResume($arr[$keys[20]]);
- if (array_key_exists($keys[21], $arr)) $this->setUsrBirthday($arr[$keys[21]]);
- if (array_key_exists($keys[22], $arr)) $this->setUsrRole($arr[$keys[22]]);
- if (array_key_exists($keys[23], $arr)) $this->setUsrReportsTo($arr[$keys[23]]);
- if (array_key_exists($keys[24], $arr)) $this->setUsrReplacedBy($arr[$keys[24]]);
- if (array_key_exists($keys[25], $arr)) $this->setUsrUx($arr[$keys[25]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(UsersPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(UsersPeer::USR_UID)) $criteria->add(UsersPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(UsersPeer::USR_USERNAME)) $criteria->add(UsersPeer::USR_USERNAME, $this->usr_username);
- if ($this->isColumnModified(UsersPeer::USR_PASSWORD)) $criteria->add(UsersPeer::USR_PASSWORD, $this->usr_password);
- if ($this->isColumnModified(UsersPeer::USR_FIRSTNAME)) $criteria->add(UsersPeer::USR_FIRSTNAME, $this->usr_firstname);
- if ($this->isColumnModified(UsersPeer::USR_LASTNAME)) $criteria->add(UsersPeer::USR_LASTNAME, $this->usr_lastname);
- if ($this->isColumnModified(UsersPeer::USR_EMAIL)) $criteria->add(UsersPeer::USR_EMAIL, $this->usr_email);
- if ($this->isColumnModified(UsersPeer::USR_DUE_DATE)) $criteria->add(UsersPeer::USR_DUE_DATE, $this->usr_due_date);
- if ($this->isColumnModified(UsersPeer::USR_CREATE_DATE)) $criteria->add(UsersPeer::USR_CREATE_DATE, $this->usr_create_date);
- if ($this->isColumnModified(UsersPeer::USR_UPDATE_DATE)) $criteria->add(UsersPeer::USR_UPDATE_DATE, $this->usr_update_date);
- if ($this->isColumnModified(UsersPeer::USR_STATUS)) $criteria->add(UsersPeer::USR_STATUS, $this->usr_status);
- if ($this->isColumnModified(UsersPeer::USR_COUNTRY)) $criteria->add(UsersPeer::USR_COUNTRY, $this->usr_country);
- if ($this->isColumnModified(UsersPeer::USR_CITY)) $criteria->add(UsersPeer::USR_CITY, $this->usr_city);
- if ($this->isColumnModified(UsersPeer::USR_LOCATION)) $criteria->add(UsersPeer::USR_LOCATION, $this->usr_location);
- if ($this->isColumnModified(UsersPeer::USR_ADDRESS)) $criteria->add(UsersPeer::USR_ADDRESS, $this->usr_address);
- if ($this->isColumnModified(UsersPeer::USR_PHONE)) $criteria->add(UsersPeer::USR_PHONE, $this->usr_phone);
- if ($this->isColumnModified(UsersPeer::USR_FAX)) $criteria->add(UsersPeer::USR_FAX, $this->usr_fax);
- if ($this->isColumnModified(UsersPeer::USR_CELLULAR)) $criteria->add(UsersPeer::USR_CELLULAR, $this->usr_cellular);
- if ($this->isColumnModified(UsersPeer::USR_ZIP_CODE)) $criteria->add(UsersPeer::USR_ZIP_CODE, $this->usr_zip_code);
- if ($this->isColumnModified(UsersPeer::DEP_UID)) $criteria->add(UsersPeer::DEP_UID, $this->dep_uid);
- if ($this->isColumnModified(UsersPeer::USR_POSITION)) $criteria->add(UsersPeer::USR_POSITION, $this->usr_position);
- if ($this->isColumnModified(UsersPeer::USR_RESUME)) $criteria->add(UsersPeer::USR_RESUME, $this->usr_resume);
- if ($this->isColumnModified(UsersPeer::USR_BIRTHDAY)) $criteria->add(UsersPeer::USR_BIRTHDAY, $this->usr_birthday);
- if ($this->isColumnModified(UsersPeer::USR_ROLE)) $criteria->add(UsersPeer::USR_ROLE, $this->usr_role);
- if ($this->isColumnModified(UsersPeer::USR_REPORTS_TO)) $criteria->add(UsersPeer::USR_REPORTS_TO, $this->usr_reports_to);
- if ($this->isColumnModified(UsersPeer::USR_REPLACED_BY)) $criteria->add(UsersPeer::USR_REPLACED_BY, $this->usr_replaced_by);
- if ($this->isColumnModified(UsersPeer::USR_UX)) $criteria->add(UsersPeer::USR_UX, $this->usr_ux);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(UsersPeer::DATABASE_NAME);
-
- $criteria->add(UsersPeer::USR_UID, $this->usr_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getUsrUid();
- }
-
- /**
- * Generic method to set the primary key (usr_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setUsrUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of Users (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setUsrUsername($this->usr_username);
-
- $copyObj->setUsrPassword($this->usr_password);
-
- $copyObj->setUsrFirstname($this->usr_firstname);
-
- $copyObj->setUsrLastname($this->usr_lastname);
-
- $copyObj->setUsrEmail($this->usr_email);
-
- $copyObj->setUsrDueDate($this->usr_due_date);
-
- $copyObj->setUsrCreateDate($this->usr_create_date);
-
- $copyObj->setUsrUpdateDate($this->usr_update_date);
-
- $copyObj->setUsrStatus($this->usr_status);
-
- $copyObj->setUsrCountry($this->usr_country);
-
- $copyObj->setUsrCity($this->usr_city);
-
- $copyObj->setUsrLocation($this->usr_location);
-
- $copyObj->setUsrAddress($this->usr_address);
-
- $copyObj->setUsrPhone($this->usr_phone);
-
- $copyObj->setUsrFax($this->usr_fax);
-
- $copyObj->setUsrCellular($this->usr_cellular);
-
- $copyObj->setUsrZipCode($this->usr_zip_code);
-
- $copyObj->setDepUid($this->dep_uid);
-
- $copyObj->setUsrPosition($this->usr_position);
+ $copyObj->setUsrUx($this->usr_ux);
- $copyObj->setUsrResume($this->usr_resume);
- $copyObj->setUsrBirthday($this->usr_birthday);
+ $copyObj->setNew(true);
- $copyObj->setUsrRole($this->usr_role);
+ $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
- $copyObj->setUsrReportsTo($this->usr_reports_to);
+ }
- $copyObj->setUsrReplacedBy($this->usr_replaced_by);
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return Users Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
- $copyObj->setUsrUx($this->usr_ux);
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return UsersPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new UsersPeer();
+ }
+ return self::$peer;
+ }
+}
-
- $copyObj->setNew(true);
-
- $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return Users Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return UsersPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new UsersPeer();
- }
- return self::$peer;
- }
-
-} // BaseUsers
diff --git a/workflow/engine/classes/model/om/BaseUsersPeer.php b/workflow/engine/classes/model/om/BaseUsersPeer.php
index 631bad7ef..d4d1062e3 100755
--- a/workflow/engine/classes/model/om/BaseUsersPeer.php
+++ b/workflow/engine/classes/model/om/BaseUsersPeer.php
@@ -12,682 +12,684 @@ include_once 'classes/model/Users.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseUsersPeer {
+abstract class BaseUsersPeer
+{
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
- /** the table name for this class */
- const TABLE_NAME = 'USERS';
+ /** the table name for this class */
+ const TABLE_NAME = 'USERS';
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.Users';
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.Users';
- /** The total number of columns. */
- const NUM_COLUMNS = 26;
+ /** The total number of columns. */
+ const NUM_COLUMNS = 26;
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
- /** the column name for the USR_UID field */
- const USR_UID = 'USERS.USR_UID';
+ /** the column name for the USR_UID field */
+ const USR_UID = 'USERS.USR_UID';
- /** the column name for the USR_USERNAME field */
- const USR_USERNAME = 'USERS.USR_USERNAME';
+ /** the column name for the USR_USERNAME field */
+ const USR_USERNAME = 'USERS.USR_USERNAME';
- /** the column name for the USR_PASSWORD field */
- const USR_PASSWORD = 'USERS.USR_PASSWORD';
+ /** the column name for the USR_PASSWORD field */
+ const USR_PASSWORD = 'USERS.USR_PASSWORD';
- /** the column name for the USR_FIRSTNAME field */
- const USR_FIRSTNAME = 'USERS.USR_FIRSTNAME';
+ /** the column name for the USR_FIRSTNAME field */
+ const USR_FIRSTNAME = 'USERS.USR_FIRSTNAME';
- /** the column name for the USR_LASTNAME field */
- const USR_LASTNAME = 'USERS.USR_LASTNAME';
+ /** the column name for the USR_LASTNAME field */
+ const USR_LASTNAME = 'USERS.USR_LASTNAME';
- /** the column name for the USR_EMAIL field */
- const USR_EMAIL = 'USERS.USR_EMAIL';
+ /** the column name for the USR_EMAIL field */
+ const USR_EMAIL = 'USERS.USR_EMAIL';
- /** the column name for the USR_DUE_DATE field */
- const USR_DUE_DATE = 'USERS.USR_DUE_DATE';
+ /** the column name for the USR_DUE_DATE field */
+ const USR_DUE_DATE = 'USERS.USR_DUE_DATE';
- /** the column name for the USR_CREATE_DATE field */
- const USR_CREATE_DATE = 'USERS.USR_CREATE_DATE';
+ /** the column name for the USR_CREATE_DATE field */
+ const USR_CREATE_DATE = 'USERS.USR_CREATE_DATE';
- /** the column name for the USR_UPDATE_DATE field */
- const USR_UPDATE_DATE = 'USERS.USR_UPDATE_DATE';
+ /** the column name for the USR_UPDATE_DATE field */
+ const USR_UPDATE_DATE = 'USERS.USR_UPDATE_DATE';
- /** the column name for the USR_STATUS field */
- const USR_STATUS = 'USERS.USR_STATUS';
+ /** the column name for the USR_STATUS field */
+ const USR_STATUS = 'USERS.USR_STATUS';
- /** the column name for the USR_COUNTRY field */
- const USR_COUNTRY = 'USERS.USR_COUNTRY';
+ /** the column name for the USR_COUNTRY field */
+ const USR_COUNTRY = 'USERS.USR_COUNTRY';
+
+ /** the column name for the USR_CITY field */
+ const USR_CITY = 'USERS.USR_CITY';
+
+ /** the column name for the USR_LOCATION field */
+ const USR_LOCATION = 'USERS.USR_LOCATION';
+
+ /** the column name for the USR_ADDRESS field */
+ const USR_ADDRESS = 'USERS.USR_ADDRESS';
+
+ /** the column name for the USR_PHONE field */
+ const USR_PHONE = 'USERS.USR_PHONE';
+
+ /** the column name for the USR_FAX field */
+ const USR_FAX = 'USERS.USR_FAX';
+
+ /** the column name for the USR_CELLULAR field */
+ const USR_CELLULAR = 'USERS.USR_CELLULAR';
+
+ /** the column name for the USR_ZIP_CODE field */
+ const USR_ZIP_CODE = 'USERS.USR_ZIP_CODE';
+
+ /** the column name for the DEP_UID field */
+ const DEP_UID = 'USERS.DEP_UID';
+
+ /** the column name for the USR_POSITION field */
+ const USR_POSITION = 'USERS.USR_POSITION';
+
+ /** the column name for the USR_RESUME field */
+ const USR_RESUME = 'USERS.USR_RESUME';
+
+ /** the column name for the USR_BIRTHDAY field */
+ const USR_BIRTHDAY = 'USERS.USR_BIRTHDAY';
+
+ /** the column name for the USR_ROLE field */
+ const USR_ROLE = 'USERS.USR_ROLE';
+
+ /** the column name for the USR_REPORTS_TO field */
+ const USR_REPORTS_TO = 'USERS.USR_REPORTS_TO';
+
+ /** the column name for the USR_REPLACED_BY field */
+ const USR_REPLACED_BY = 'USERS.USR_REPLACED_BY';
+
+ /** the column name for the USR_UX field */
+ const USR_UX = 'USERS.USR_UX';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('UsrUid', 'UsrUsername', 'UsrPassword', 'UsrFirstname', 'UsrLastname', 'UsrEmail', 'UsrDueDate', 'UsrCreateDate', 'UsrUpdateDate', 'UsrStatus', 'UsrCountry', 'UsrCity', 'UsrLocation', 'UsrAddress', 'UsrPhone', 'UsrFax', 'UsrCellular', 'UsrZipCode', 'DepUid', 'UsrPosition', 'UsrResume', 'UsrBirthday', 'UsrRole', 'UsrReportsTo', 'UsrReplacedBy', 'UsrUx', ),
+ BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID, UsersPeer::USR_USERNAME, UsersPeer::USR_PASSWORD, UsersPeer::USR_FIRSTNAME, UsersPeer::USR_LASTNAME, UsersPeer::USR_EMAIL, UsersPeer::USR_DUE_DATE, UsersPeer::USR_CREATE_DATE, UsersPeer::USR_UPDATE_DATE, UsersPeer::USR_STATUS, UsersPeer::USR_COUNTRY, UsersPeer::USR_CITY, UsersPeer::USR_LOCATION, UsersPeer::USR_ADDRESS, UsersPeer::USR_PHONE, UsersPeer::USR_FAX, UsersPeer::USR_CELLULAR, UsersPeer::USR_ZIP_CODE, UsersPeer::DEP_UID, UsersPeer::USR_POSITION, UsersPeer::USR_RESUME, UsersPeer::USR_BIRTHDAY, UsersPeer::USR_ROLE, UsersPeer::USR_REPORTS_TO, UsersPeer::USR_REPLACED_BY, UsersPeer::USR_UX, ),
+ BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'USR_USERNAME', 'USR_PASSWORD', 'USR_FIRSTNAME', 'USR_LASTNAME', 'USR_EMAIL', 'USR_DUE_DATE', 'USR_CREATE_DATE', 'USR_UPDATE_DATE', 'USR_STATUS', 'USR_COUNTRY', 'USR_CITY', 'USR_LOCATION', 'USR_ADDRESS', 'USR_PHONE', 'USR_FAX', 'USR_CELLULAR', 'USR_ZIP_CODE', 'DEP_UID', 'USR_POSITION', 'USR_RESUME', 'USR_BIRTHDAY', 'USR_ROLE', 'USR_REPORTS_TO', 'USR_REPLACED_BY', 'USR_UX', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'UsrUsername' => 1, 'UsrPassword' => 2, 'UsrFirstname' => 3, 'UsrLastname' => 4, 'UsrEmail' => 5, 'UsrDueDate' => 6, 'UsrCreateDate' => 7, 'UsrUpdateDate' => 8, 'UsrStatus' => 9, 'UsrCountry' => 10, 'UsrCity' => 11, 'UsrLocation' => 12, 'UsrAddress' => 13, 'UsrPhone' => 14, 'UsrFax' => 15, 'UsrCellular' => 16, 'UsrZipCode' => 17, 'DepUid' => 18, 'UsrPosition' => 19, 'UsrResume' => 20, 'UsrBirthday' => 21, 'UsrRole' => 22, 'UsrReportsTo' => 23, 'UsrReplacedBy' => 24, 'UsrUx' => 25, ),
+ BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID => 0, UsersPeer::USR_USERNAME => 1, UsersPeer::USR_PASSWORD => 2, UsersPeer::USR_FIRSTNAME => 3, UsersPeer::USR_LASTNAME => 4, UsersPeer::USR_EMAIL => 5, UsersPeer::USR_DUE_DATE => 6, UsersPeer::USR_CREATE_DATE => 7, UsersPeer::USR_UPDATE_DATE => 8, UsersPeer::USR_STATUS => 9, UsersPeer::USR_COUNTRY => 10, UsersPeer::USR_CITY => 11, UsersPeer::USR_LOCATION => 12, UsersPeer::USR_ADDRESS => 13, UsersPeer::USR_PHONE => 14, UsersPeer::USR_FAX => 15, UsersPeer::USR_CELLULAR => 16, UsersPeer::USR_ZIP_CODE => 17, UsersPeer::DEP_UID => 18, UsersPeer::USR_POSITION => 19, UsersPeer::USR_RESUME => 20, UsersPeer::USR_BIRTHDAY => 21, UsersPeer::USR_ROLE => 22, UsersPeer::USR_REPORTS_TO => 23, UsersPeer::USR_REPLACED_BY => 24, UsersPeer::USR_UX => 25, ),
+ BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'USR_USERNAME' => 1, 'USR_PASSWORD' => 2, 'USR_FIRSTNAME' => 3, 'USR_LASTNAME' => 4, 'USR_EMAIL' => 5, 'USR_DUE_DATE' => 6, 'USR_CREATE_DATE' => 7, 'USR_UPDATE_DATE' => 8, 'USR_STATUS' => 9, 'USR_COUNTRY' => 10, 'USR_CITY' => 11, 'USR_LOCATION' => 12, 'USR_ADDRESS' => 13, 'USR_PHONE' => 14, 'USR_FAX' => 15, 'USR_CELLULAR' => 16, 'USR_ZIP_CODE' => 17, 'DEP_UID' => 18, 'USR_POSITION' => 19, 'USR_RESUME' => 20, 'USR_BIRTHDAY' => 21, 'USR_ROLE' => 22, 'USR_REPORTS_TO' => 23, 'USR_REPLACED_BY' => 24, 'USR_UX' => 25, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/UsersMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.UsersMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = UsersPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. UsersPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(UsersPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(UsersPeer::USR_UID);
+
+ $criteria->addSelectColumn(UsersPeer::USR_USERNAME);
+
+ $criteria->addSelectColumn(UsersPeer::USR_PASSWORD);
+
+ $criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
+
+ $criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
+
+ $criteria->addSelectColumn(UsersPeer::USR_EMAIL);
+
+ $criteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
+
+ $criteria->addSelectColumn(UsersPeer::USR_CREATE_DATE);
+
+ $criteria->addSelectColumn(UsersPeer::USR_UPDATE_DATE);
+
+ $criteria->addSelectColumn(UsersPeer::USR_STATUS);
+
+ $criteria->addSelectColumn(UsersPeer::USR_COUNTRY);
+
+ $criteria->addSelectColumn(UsersPeer::USR_CITY);
+
+ $criteria->addSelectColumn(UsersPeer::USR_LOCATION);
+
+ $criteria->addSelectColumn(UsersPeer::USR_ADDRESS);
+
+ $criteria->addSelectColumn(UsersPeer::USR_PHONE);
+
+ $criteria->addSelectColumn(UsersPeer::USR_FAX);
+
+ $criteria->addSelectColumn(UsersPeer::USR_CELLULAR);
+
+ $criteria->addSelectColumn(UsersPeer::USR_ZIP_CODE);
+
+ $criteria->addSelectColumn(UsersPeer::DEP_UID);
+
+ $criteria->addSelectColumn(UsersPeer::USR_POSITION);
+
+ $criteria->addSelectColumn(UsersPeer::USR_RESUME);
+
+ $criteria->addSelectColumn(UsersPeer::USR_BIRTHDAY);
+
+ $criteria->addSelectColumn(UsersPeer::USR_ROLE);
+
+ $criteria->addSelectColumn(UsersPeer::USR_REPORTS_TO);
+
+ $criteria->addSelectColumn(UsersPeer::USR_REPLACED_BY);
+
+ $criteria->addSelectColumn(UsersPeer::USR_UX);
+
+ }
+
+ const COUNT = 'COUNT(USERS.USR_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT USERS.USR_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(UsersPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(UsersPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = UsersPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return Users
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = UsersPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return UsersPeer::populateObjects(UsersPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ UsersPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = UsersPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return UsersPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a Users or Criteria object.
+ *
+ * @param mixed $values Criteria or Users object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from Users object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a Users or Criteria object.
+ *
+ * @param mixed $values Criteria or Users object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(UsersPeer::USR_UID);
+ $selectCriteria->add(UsersPeer::USR_UID, $criteria->remove(UsersPeer::USR_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the USERS table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(UsersPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a Users or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or Users object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(UsersPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof Users) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(UsersPeer::USR_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given Users object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param Users $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(Users $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(UsersPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(UsersPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ if ($obj->isNew() || $obj->isColumnModified(UsersPeer::USR_STATUS))
+ $columns[UsersPeer::USR_STATUS] = $obj->getUsrStatus();
+
+ }
+
+ return BasePeer::doValidate(UsersPeer::DATABASE_NAME, UsersPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return Users
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(UsersPeer::DATABASE_NAME);
+
+ $criteria->add(UsersPeer::USR_UID, $pk);
+
+
+ $v = UsersPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(UsersPeer::USR_UID, $pks, Criteria::IN);
+ $objs = UsersPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
- /** the column name for the USR_CITY field */
- const USR_CITY = 'USERS.USR_CITY';
-
- /** the column name for the USR_LOCATION field */
- const USR_LOCATION = 'USERS.USR_LOCATION';
-
- /** the column name for the USR_ADDRESS field */
- const USR_ADDRESS = 'USERS.USR_ADDRESS';
-
- /** the column name for the USR_PHONE field */
- const USR_PHONE = 'USERS.USR_PHONE';
-
- /** the column name for the USR_FAX field */
- const USR_FAX = 'USERS.USR_FAX';
-
- /** the column name for the USR_CELLULAR field */
- const USR_CELLULAR = 'USERS.USR_CELLULAR';
-
- /** the column name for the USR_ZIP_CODE field */
- const USR_ZIP_CODE = 'USERS.USR_ZIP_CODE';
-
- /** the column name for the DEP_UID field */
- const DEP_UID = 'USERS.DEP_UID';
-
- /** the column name for the USR_POSITION field */
- const USR_POSITION = 'USERS.USR_POSITION';
-
- /** the column name for the USR_RESUME field */
- const USR_RESUME = 'USERS.USR_RESUME';
-
- /** the column name for the USR_BIRTHDAY field */
- const USR_BIRTHDAY = 'USERS.USR_BIRTHDAY';
-
- /** the column name for the USR_ROLE field */
- const USR_ROLE = 'USERS.USR_ROLE';
-
- /** the column name for the USR_REPORTS_TO field */
- const USR_REPORTS_TO = 'USERS.USR_REPORTS_TO';
-
- /** the column name for the USR_REPLACED_BY field */
- const USR_REPLACED_BY = 'USERS.USR_REPLACED_BY';
-
- /** the column name for the USR_UX field */
- const USR_UX = 'USERS.USR_UX';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('UsrUid', 'UsrUsername', 'UsrPassword', 'UsrFirstname', 'UsrLastname', 'UsrEmail', 'UsrDueDate', 'UsrCreateDate', 'UsrUpdateDate', 'UsrStatus', 'UsrCountry', 'UsrCity', 'UsrLocation', 'UsrAddress', 'UsrPhone', 'UsrFax', 'UsrCellular', 'UsrZipCode', 'DepUid', 'UsrPosition', 'UsrResume', 'UsrBirthday', 'UsrRole', 'UsrReportsTo', 'UsrReplacedBy', 'UsrUx', ),
- BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID, UsersPeer::USR_USERNAME, UsersPeer::USR_PASSWORD, UsersPeer::USR_FIRSTNAME, UsersPeer::USR_LASTNAME, UsersPeer::USR_EMAIL, UsersPeer::USR_DUE_DATE, UsersPeer::USR_CREATE_DATE, UsersPeer::USR_UPDATE_DATE, UsersPeer::USR_STATUS, UsersPeer::USR_COUNTRY, UsersPeer::USR_CITY, UsersPeer::USR_LOCATION, UsersPeer::USR_ADDRESS, UsersPeer::USR_PHONE, UsersPeer::USR_FAX, UsersPeer::USR_CELLULAR, UsersPeer::USR_ZIP_CODE, UsersPeer::DEP_UID, UsersPeer::USR_POSITION, UsersPeer::USR_RESUME, UsersPeer::USR_BIRTHDAY, UsersPeer::USR_ROLE, UsersPeer::USR_REPORTS_TO, UsersPeer::USR_REPLACED_BY, UsersPeer::USR_UX, ),
- BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'USR_USERNAME', 'USR_PASSWORD', 'USR_FIRSTNAME', 'USR_LASTNAME', 'USR_EMAIL', 'USR_DUE_DATE', 'USR_CREATE_DATE', 'USR_UPDATE_DATE', 'USR_STATUS', 'USR_COUNTRY', 'USR_CITY', 'USR_LOCATION', 'USR_ADDRESS', 'USR_PHONE', 'USR_FAX', 'USR_CELLULAR', 'USR_ZIP_CODE', 'DEP_UID', 'USR_POSITION', 'USR_RESUME', 'USR_BIRTHDAY', 'USR_ROLE', 'USR_REPORTS_TO', 'USR_REPLACED_BY', 'USR_UX', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'UsrUsername' => 1, 'UsrPassword' => 2, 'UsrFirstname' => 3, 'UsrLastname' => 4, 'UsrEmail' => 5, 'UsrDueDate' => 6, 'UsrCreateDate' => 7, 'UsrUpdateDate' => 8, 'UsrStatus' => 9, 'UsrCountry' => 10, 'UsrCity' => 11, 'UsrLocation' => 12, 'UsrAddress' => 13, 'UsrPhone' => 14, 'UsrFax' => 15, 'UsrCellular' => 16, 'UsrZipCode' => 17, 'DepUid' => 18, 'UsrPosition' => 19, 'UsrResume' => 20, 'UsrBirthday' => 21, 'UsrRole' => 22, 'UsrReportsTo' => 23, 'UsrReplacedBy' => 24, 'UsrUx' => 25, ),
- BasePeer::TYPE_COLNAME => array (UsersPeer::USR_UID => 0, UsersPeer::USR_USERNAME => 1, UsersPeer::USR_PASSWORD => 2, UsersPeer::USR_FIRSTNAME => 3, UsersPeer::USR_LASTNAME => 4, UsersPeer::USR_EMAIL => 5, UsersPeer::USR_DUE_DATE => 6, UsersPeer::USR_CREATE_DATE => 7, UsersPeer::USR_UPDATE_DATE => 8, UsersPeer::USR_STATUS => 9, UsersPeer::USR_COUNTRY => 10, UsersPeer::USR_CITY => 11, UsersPeer::USR_LOCATION => 12, UsersPeer::USR_ADDRESS => 13, UsersPeer::USR_PHONE => 14, UsersPeer::USR_FAX => 15, UsersPeer::USR_CELLULAR => 16, UsersPeer::USR_ZIP_CODE => 17, UsersPeer::DEP_UID => 18, UsersPeer::USR_POSITION => 19, UsersPeer::USR_RESUME => 20, UsersPeer::USR_BIRTHDAY => 21, UsersPeer::USR_ROLE => 22, UsersPeer::USR_REPORTS_TO => 23, UsersPeer::USR_REPLACED_BY => 24, UsersPeer::USR_UX => 25, ),
- BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'USR_USERNAME' => 1, 'USR_PASSWORD' => 2, 'USR_FIRSTNAME' => 3, 'USR_LASTNAME' => 4, 'USR_EMAIL' => 5, 'USR_DUE_DATE' => 6, 'USR_CREATE_DATE' => 7, 'USR_UPDATE_DATE' => 8, 'USR_STATUS' => 9, 'USR_COUNTRY' => 10, 'USR_CITY' => 11, 'USR_LOCATION' => 12, 'USR_ADDRESS' => 13, 'USR_PHONE' => 14, 'USR_FAX' => 15, 'USR_CELLULAR' => 16, 'USR_ZIP_CODE' => 17, 'DEP_UID' => 18, 'USR_POSITION' => 19, 'USR_RESUME' => 20, 'USR_BIRTHDAY' => 21, 'USR_ROLE' => 22, 'USR_REPORTS_TO' => 23, 'USR_REPLACED_BY' => 24, 'USR_UX' => 25, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/UsersMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.UsersMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = UsersPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. UsersPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(UsersPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(UsersPeer::USR_UID);
-
- $criteria->addSelectColumn(UsersPeer::USR_USERNAME);
-
- $criteria->addSelectColumn(UsersPeer::USR_PASSWORD);
-
- $criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
-
- $criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
-
- $criteria->addSelectColumn(UsersPeer::USR_EMAIL);
-
- $criteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
-
- $criteria->addSelectColumn(UsersPeer::USR_CREATE_DATE);
-
- $criteria->addSelectColumn(UsersPeer::USR_UPDATE_DATE);
-
- $criteria->addSelectColumn(UsersPeer::USR_STATUS);
-
- $criteria->addSelectColumn(UsersPeer::USR_COUNTRY);
-
- $criteria->addSelectColumn(UsersPeer::USR_CITY);
-
- $criteria->addSelectColumn(UsersPeer::USR_LOCATION);
-
- $criteria->addSelectColumn(UsersPeer::USR_ADDRESS);
-
- $criteria->addSelectColumn(UsersPeer::USR_PHONE);
-
- $criteria->addSelectColumn(UsersPeer::USR_FAX);
-
- $criteria->addSelectColumn(UsersPeer::USR_CELLULAR);
-
- $criteria->addSelectColumn(UsersPeer::USR_ZIP_CODE);
-
- $criteria->addSelectColumn(UsersPeer::DEP_UID);
-
- $criteria->addSelectColumn(UsersPeer::USR_POSITION);
-
- $criteria->addSelectColumn(UsersPeer::USR_RESUME);
-
- $criteria->addSelectColumn(UsersPeer::USR_BIRTHDAY);
-
- $criteria->addSelectColumn(UsersPeer::USR_ROLE);
-
- $criteria->addSelectColumn(UsersPeer::USR_REPORTS_TO);
-
- $criteria->addSelectColumn(UsersPeer::USR_REPLACED_BY);
-
- $criteria->addSelectColumn(UsersPeer::USR_UX);
-
- }
-
- const COUNT = 'COUNT(USERS.USR_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT USERS.USR_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(UsersPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(UsersPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = UsersPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return Users
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = UsersPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return UsersPeer::populateObjects(UsersPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- UsersPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = UsersPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return UsersPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a Users or Criteria object.
- *
- * @param mixed $values Criteria or Users object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from Users object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a Users or Criteria object.
- *
- * @param mixed $values Criteria or Users object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(UsersPeer::USR_UID);
- $selectCriteria->add(UsersPeer::USR_UID, $criteria->remove(UsersPeer::USR_UID), $comparison);
-
- } else { // $values is Users object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the USERS table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(UsersPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a Users or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or Users object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(UsersPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof Users) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(UsersPeer::USR_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given Users object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param Users $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(Users $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(UsersPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(UsersPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- if ($obj->isNew() || $obj->isColumnModified(UsersPeer::USR_STATUS))
- $columns[UsersPeer::USR_STATUS] = $obj->getUsrStatus();
-
- }
-
- return BasePeer::doValidate(UsersPeer::DATABASE_NAME, UsersPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return Users
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(UsersPeer::DATABASE_NAME);
-
- $criteria->add(UsersPeer::USR_UID, $pk);
-
-
- $v = UsersPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(UsersPeer::USR_UID, $pks, Criteria::IN);
- $objs = UsersPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseUsersPeer
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseUsersPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseUsersPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/UsersMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.UsersMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/UsersMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.UsersMapBuilder');
}
+
diff --git a/workflow/engine/classes/model/om/BaseUsersProperties.php b/workflow/engine/classes/model/om/BaseUsersProperties.php
index a01e634dd..11ba46a61 100755
--- a/workflow/engine/classes/model/om/BaseUsersProperties.php
+++ b/workflow/engine/classes/model/om/BaseUsersProperties.php
@@ -16,670 +16,693 @@ include_once 'classes/model/UsersPropertiesPeer.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseUsersProperties extends BaseObject implements Persistent {
-
-
- /**
- * The Peer class.
- * Instance provides a convenient way of calling static methods on a class
- * that calling code may not be able to identify.
- * @var UsersPropertiesPeer
- */
- protected static $peer;
-
-
- /**
- * The value for the usr_uid field.
- * @var string
- */
- protected $usr_uid = '';
-
-
- /**
- * The value for the usr_last_update_date field.
- * @var int
- */
- protected $usr_last_update_date;
-
-
- /**
- * The value for the usr_logged_next_time field.
- * @var int
- */
- protected $usr_logged_next_time = 0;
-
-
- /**
- * The value for the usr_password_history field.
- * @var string
- */
- protected $usr_password_history;
-
- /**
- * Flag to prevent endless save loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInSave = false;
-
- /**
- * Flag to prevent endless validation loop, if this object is referenced
- * by another object which falls in this transaction.
- * @var boolean
- */
- protected $alreadyInValidation = false;
-
- /**
- * Get the [usr_uid] column value.
- *
- * @return string
- */
- public function getUsrUid()
- {
-
- return $this->usr_uid;
- }
-
- /**
- * Get the [optionally formatted] [usr_last_update_date] column value.
- *
- * @param string $format The date/time format string (either date()-style or strftime()-style).
- * If format is NULL, then the integer unix timestamp will be returned.
- * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
- * @throws PropelException - if unable to convert the date/time to timestamp.
- */
- public function getUsrLastUpdateDate($format = 'Y-m-d H:i:s')
- {
-
- if ($this->usr_last_update_date === null || $this->usr_last_update_date === '') {
- return null;
- } elseif (!is_int($this->usr_last_update_date)) {
- // a non-timestamp value was set externally, so we convert it
- $ts = strtotime($this->usr_last_update_date);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse value of [usr_last_update_date] as date/time value: " . var_export($this->usr_last_update_date, true));
- }
- } else {
- $ts = $this->usr_last_update_date;
- }
- if ($format === null) {
- return $ts;
- } elseif (strpos($format, '%') !== false) {
- return strftime($format, $ts);
- } else {
- return date($format, $ts);
- }
- }
-
- /**
- * Get the [usr_logged_next_time] column value.
- *
- * @return int
- */
- public function getUsrLoggedNextTime()
- {
-
- return $this->usr_logged_next_time;
- }
-
- /**
- * Get the [usr_password_history] column value.
- *
- * @return string
- */
- public function getUsrPasswordHistory()
- {
-
- return $this->usr_password_history;
- }
-
- /**
- * Set the value of [usr_uid] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrUid($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_uid !== $v || $v === '') {
- $this->usr_uid = $v;
- $this->modifiedColumns[] = UsersPropertiesPeer::USR_UID;
- }
-
- } // setUsrUid()
-
- /**
- * Set the value of [usr_last_update_date] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setUsrLastUpdateDate($v)
- {
-
- if ($v !== null && !is_int($v)) {
- $ts = strtotime($v);
- if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
- throw new PropelException("Unable to parse date/time value for [usr_last_update_date] from input: " . var_export($v, true));
- }
- } else {
- $ts = $v;
- }
- if ($this->usr_last_update_date !== $ts) {
- $this->usr_last_update_date = $ts;
- $this->modifiedColumns[] = UsersPropertiesPeer::USR_LAST_UPDATE_DATE;
- }
-
- } // setUsrLastUpdateDate()
-
- /**
- * Set the value of [usr_logged_next_time] column.
- *
- * @param int $v new value
- * @return void
- */
- public function setUsrLoggedNextTime($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->usr_logged_next_time !== $v || $v === 0) {
- $this->usr_logged_next_time = $v;
- $this->modifiedColumns[] = UsersPropertiesPeer::USR_LOGGED_NEXT_TIME;
- }
-
- } // setUsrLoggedNextTime()
-
- /**
- * Set the value of [usr_password_history] column.
- *
- * @param string $v new value
- * @return void
- */
- public function setUsrPasswordHistory($v)
- {
-
- // Since the native PHP type for this column is string,
- // we will cast the input to a string (if it is not).
- if ($v !== null && !is_string($v)) {
- $v = (string) $v;
- }
-
- if ($this->usr_password_history !== $v) {
- $this->usr_password_history = $v;
- $this->modifiedColumns[] = UsersPropertiesPeer::USR_PASSWORD_HISTORY;
- }
-
- } // setUsrPasswordHistory()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (1-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
- * @param int $startcol 1-based offset column which indicates which restultset column to start with.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
-
- $this->usr_uid = $rs->getString($startcol + 0);
-
- $this->usr_last_update_date = $rs->getTimestamp($startcol + 1, null);
-
- $this->usr_logged_next_time = $rs->getInt($startcol + 2);
-
- $this->usr_password_history = $rs->getString($startcol + 3);
-
- $this->resetModified();
-
- $this->setNew(false);
-
- // FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 4; // 4 = UsersPropertiesPeer::NUM_COLUMNS - UsersPropertiesPeer::NUM_LAZY_LOAD_COLUMNS).
-
- } catch (Exception $e) {
- throw new PropelException("Error populating UsersProperties object", $e);
- }
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param Connection $con
- * @return void
- * @throws PropelException
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- UsersPropertiesPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database. If the object is new,
- * it inserts it; otherwise an update is performed. This method
- * wraps the doSave() worker method in a transaction.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see doSave()
- */
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
- }
-
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Stores the object in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param Connection $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave($con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
-
- // If this object has been modified, then save it to the database.
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = UsersPropertiesPeer::doInsert($this, $con);
- $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
- // should always be true here (even though technically
- // BasePeer::doInsert() can insert multiple rows).
-
- $this->setNew(false);
- } else {
- $affectedRows += UsersPropertiesPeer::doUpdate($this, $con);
- }
- $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
- }
-
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- } // doSave()
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggreagated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objets otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- if (($retval = UsersPropertiesPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = UsersPropertiesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getUsrUid();
- break;
- case 1:
- return $this->getUsrLastUpdateDate();
- break;
- case 2:
- return $this->getUsrLoggedNextTime();
- break;
- case 3:
- return $this->getUsrPasswordHistory();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = UsersPropertiesPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getUsrUid(),
- $keys[1] => $this->getUsrLastUpdateDate(),
- $keys[2] => $this->getUsrLoggedNextTime(),
- $keys[3] => $this->getUsrPasswordHistory(),
- );
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = UsersPropertiesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setUsrUid($value);
- break;
- case 1:
- $this->setUsrLastUpdateDate($value);
- break;
- case 2:
- $this->setUsrLoggedNextTime($value);
- break;
- case 3:
- $this->setUsrPasswordHistory($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
- * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = UsersPropertiesPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setUsrUid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setUsrLastUpdateDate($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setUsrLoggedNextTime($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setUsrPasswordHistory($arr[$keys[3]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(UsersPropertiesPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(UsersPropertiesPeer::USR_UID)) $criteria->add(UsersPropertiesPeer::USR_UID, $this->usr_uid);
- if ($this->isColumnModified(UsersPropertiesPeer::USR_LAST_UPDATE_DATE)) $criteria->add(UsersPropertiesPeer::USR_LAST_UPDATE_DATE, $this->usr_last_update_date);
- if ($this->isColumnModified(UsersPropertiesPeer::USR_LOGGED_NEXT_TIME)) $criteria->add(UsersPropertiesPeer::USR_LOGGED_NEXT_TIME, $this->usr_logged_next_time);
- if ($this->isColumnModified(UsersPropertiesPeer::USR_PASSWORD_HISTORY)) $criteria->add(UsersPropertiesPeer::USR_PASSWORD_HISTORY, $this->usr_password_history);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(UsersPropertiesPeer::DATABASE_NAME);
-
- $criteria->add(UsersPropertiesPeer::USR_UID, $this->usr_uid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return string
- */
- public function getPrimaryKey()
- {
- return $this->getUsrUid();
- }
-
- /**
- * Generic method to set the primary key (usr_uid column).
- *
- * @param string $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setUsrUid($key);
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of UsersProperties (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false)
- {
-
- $copyObj->setUsrLastUpdateDate($this->usr_last_update_date);
-
- $copyObj->setUsrLoggedNextTime($this->usr_logged_next_time);
-
- $copyObj->setUsrPasswordHistory($this->usr_password_history);
-
-
- $copyObj->setNew(true);
-
- $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
-
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return UsersProperties Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return UsersPropertiesPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new UsersPropertiesPeer();
- }
- return self::$peer;
- }
-
-} // BaseUsersProperties
+abstract class BaseUsersProperties extends BaseObject implements Persistent
+{
+
+ /**
+ * The Peer class.
+ * Instance provides a convenient way of calling static methods on a class
+ * that calling code may not be able to identify.
+ * @var UsersPropertiesPeer
+ */
+ protected static $peer;
+
+ /**
+ * The value for the usr_uid field.
+ * @var string
+ */
+ protected $usr_uid = '';
+
+ /**
+ * The value for the usr_last_update_date field.
+ * @var int
+ */
+ protected $usr_last_update_date;
+
+ /**
+ * The value for the usr_logged_next_time field.
+ * @var int
+ */
+ protected $usr_logged_next_time = 0;
+
+ /**
+ * The value for the usr_password_history field.
+ * @var string
+ */
+ protected $usr_password_history;
+
+ /**
+ * Flag to prevent endless save loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInSave = false;
+
+ /**
+ * Flag to prevent endless validation loop, if this object is referenced
+ * by another object which falls in this transaction.
+ * @var boolean
+ */
+ protected $alreadyInValidation = false;
+
+ /**
+ * Get the [usr_uid] column value.
+ *
+ * @return string
+ */
+ public function getUsrUid()
+ {
+
+ return $this->usr_uid;
+ }
+
+ /**
+ * Get the [optionally formatted] [usr_last_update_date] column value.
+ *
+ * @param string $format The date/time format string (either date()-style or strftime()-style).
+ * If format is NULL, then the integer unix timestamp will be returned.
+ * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
+ * @throws PropelException - if unable to convert the date/time to timestamp.
+ */
+ public function getUsrLastUpdateDate($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->usr_last_update_date === null || $this->usr_last_update_date === '') {
+ return null;
+ } elseif (!is_int($this->usr_last_update_date)) {
+ // a non-timestamp value was set externally, so we convert it
+ $ts = strtotime($this->usr_last_update_date);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse value of [usr_last_update_date] as date/time value: " .
+ var_export($this->usr_last_update_date, true));
+ }
+ } else {
+ $ts = $this->usr_last_update_date;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+ /**
+ * Get the [usr_logged_next_time] column value.
+ *
+ * @return int
+ */
+ public function getUsrLoggedNextTime()
+ {
+
+ return $this->usr_logged_next_time;
+ }
+
+ /**
+ * Get the [usr_password_history] column value.
+ *
+ * @return string
+ */
+ public function getUsrPasswordHistory()
+ {
+
+ return $this->usr_password_history;
+ }
+
+ /**
+ * Set the value of [usr_uid] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrUid($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_uid !== $v || $v === '') {
+ $this->usr_uid = $v;
+ $this->modifiedColumns[] = UsersPropertiesPeer::USR_UID;
+ }
+
+ } // setUsrUid()
+
+ /**
+ * Set the value of [usr_last_update_date] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setUsrLastUpdateDate($v)
+ {
+
+ if ($v !== null && !is_int($v)) {
+ $ts = strtotime($v);
+ if ($ts === -1 || $ts === false) {
+ throw new PropelException("Unable to parse date/time value for [usr_last_update_date] from input: " .
+ var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->usr_last_update_date !== $ts) {
+ $this->usr_last_update_date = $ts;
+ $this->modifiedColumns[] = UsersPropertiesPeer::USR_LAST_UPDATE_DATE;
+ }
+
+ } // setUsrLastUpdateDate()
+
+ /**
+ * Set the value of [usr_logged_next_time] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setUsrLoggedNextTime($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->usr_logged_next_time !== $v || $v === 0) {
+ $this->usr_logged_next_time = $v;
+ $this->modifiedColumns[] = UsersPropertiesPeer::USR_LOGGED_NEXT_TIME;
+ }
+
+ } // setUsrLoggedNextTime()
+
+ /**
+ * Set the value of [usr_password_history] column.
+ *
+ * @param string $v new value
+ * @return void
+ */
+ public function setUsrPasswordHistory($v)
+ {
+
+ // Since the native PHP type for this column is string,
+ // we will cast the input to a string (if it is not).
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->usr_password_history !== $v) {
+ $this->usr_password_history = $v;
+ $this->modifiedColumns[] = UsersPropertiesPeer::USR_PASSWORD_HISTORY;
+ }
+
+ } // setUsrPasswordHistory()
+
+ /**
+ * Hydrates (populates) the object variables with values from the database resultset.
+ *
+ * An offset (1-based "start column") is specified so that objects can be hydrated
+ * with a subset of the columns in the resultset rows. This is needed, for example,
+ * for results of JOIN queries where the resultset row includes columns from two or
+ * more tables.
+ *
+ * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
+ * @param int $startcol 1-based offset column which indicates which restultset column to start with.
+ * @return int next starting column
+ * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
+ */
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->usr_uid = $rs->getString($startcol + 0);
+
+ $this->usr_last_update_date = $rs->getTimestamp($startcol + 1, null);
+
+ $this->usr_logged_next_time = $rs->getInt($startcol + 2);
+
+ $this->usr_password_history = $rs->getString($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ // FIXME - using NUM_COLUMNS may be clearer.
+ return $startcol + 4; // 4 = UsersPropertiesPeer::NUM_COLUMNS - UsersPropertiesPeer::NUM_LAZY_LOAD_COLUMNS).
+
+ } catch (Exception $e) {
+ throw new PropelException("Error populating UsersProperties object", $e);
+ }
+ }
+
+ /**
+ * Removes this object from datastore and sets delete attribute.
+ *
+ * @param Connection $con
+ * @return void
+ * @throws PropelException
+ * @see BaseObject::setDeleted()
+ * @see BaseObject::isDeleted()
+ */
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ UsersPropertiesPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database. If the object is new,
+ * it inserts it; otherwise an update is performed. This method
+ * wraps the doSave() worker method in a transaction.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update
+ * @throws PropelException
+ * @see doSave()
+ */
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Stores the object in the database.
+ *
+ * If the object is new, it inserts it; otherwise an update is performed.
+ * All related objects are also updated in this method.
+ *
+ * @param Connection $con
+ * @return int The number of rows affected by this insert/update and any referring
+ * @throws PropelException
+ * @see save()
+ */
+ protected function doSave($con)
+ {
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ // If this object has been modified, then save it to the database.
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = UsersPropertiesPeer::doInsert($this, $con);
+ $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
+ // should always be true here (even though technically
+ // BasePeer::doInsert() can insert multiple rows).
+
+ $this->setNew(false);
+ } else {
+ $affectedRows += UsersPropertiesPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
+ }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ } // doSave()
+
+ /**
+ * Array of ValidationFailed objects.
+ * @var array ValidationFailed[]
+ */
+ protected $validationFailures = array();
+
+ /**
+ * Gets any ValidationFailed objects that resulted from last call to validate().
+ *
+ *
+ * @return array ValidationFailed[]
+ * @see validate()
+ */
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+ /**
+ * Validates the objects modified field values and all objects related to this table.
+ *
+ * If $columns is either a column name or an array of column names
+ * only those columns are validated.
+ *
+ * @param mixed $columns Column name or an array of column names.
+ * @return boolean Whether all columns pass validation.
+ * @see doValidate()
+ * @see getValidationFailures()
+ */
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+ /**
+ * This function performs the validation work for complex object models.
+ *
+ * In addition to checking the current object, all related objects will
+ * also be validated. If all pass then true is returned; otherwise
+ * an aggreagated array of ValidationFailed objects will be returned.
+ *
+ * @param array $columns Array of column names to validate.
+ * @return mixed true if all validations pass;
+ array of ValidationFailed objects otherwise.
+ */
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = UsersPropertiesPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+ /**
+ * Retrieves a field from the object by name passed in as a string.
+ *
+ * @param string $name name
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return mixed Value of field.
+ */
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = UsersPropertiesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+ /**
+ * Retrieves a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @return mixed Value of field at $pos
+ */
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getUsrUid();
+ break;
+ case 1:
+ return $this->getUsrLastUpdateDate();
+ break;
+ case 2:
+ return $this->getUsrLoggedNextTime();
+ break;
+ case 3:
+ return $this->getUsrPasswordHistory();
+ break;
+ default:
+ return null;
+ break;
+ } // switch()
+ }
+
+ /**
+ * Exports the object as an array.
+ *
+ * You can specify the key type of the array by passing one of the class
+ * type constants.
+ *
+ * @param string $keyType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return an associative array containing the field names (as keys) and field values
+ */
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = UsersPropertiesPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getUsrUid(),
+ $keys[1] => $this->getUsrLastUpdateDate(),
+ $keys[2] => $this->getUsrLoggedNextTime(),
+ $keys[3] => $this->getUsrPasswordHistory(),
+ );
+ return $result;
+ }
+
+ /**
+ * Sets a field from the object by name passed in as a string.
+ *
+ * @param string $name peer name
+ * @param mixed $value field value
+ * @param string $type The type of fieldname the $name is of:
+ * one of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return void
+ */
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = UsersPropertiesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+ /**
+ * Sets a field from the object by Position as specified in the xml schema.
+ * Zero-based.
+ *
+ * @param int $pos position in xml schema
+ * @param mixed $value field value
+ * @return void
+ */
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setUsrUid($value);
+ break;
+ case 1:
+ $this->setUsrLastUpdateDate($value);
+ break;
+ case 2:
+ $this->setUsrLoggedNextTime($value);
+ break;
+ case 3:
+ $this->setUsrPasswordHistory($value);
+ break;
+ } // switch()
+ }
+
+ /**
+ * Populates the object using an array.
+ *
+ * This is particularly useful when populating an object from one of the
+ * request arrays (e.g. $_POST). This method goes through the column
+ * names, checking to see whether a matching key exists in populated
+ * array. If so the setByName() method is called for that column.
+ *
+ * You can specify the key type of the array by additionally passing one
+ * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
+ * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
+ *
+ * @param array $arr An array to populate the object from.
+ * @param string $keyType The type of keys the array uses.
+ * @return void
+ */
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = UsersPropertiesPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) {
+ $this->setUsrUid($arr[$keys[0]]);
+ }
+
+ if (array_key_exists($keys[1], $arr)) {
+ $this->setUsrLastUpdateDate($arr[$keys[1]]);
+ }
+
+ if (array_key_exists($keys[2], $arr)) {
+ $this->setUsrLoggedNextTime($arr[$keys[2]]);
+ }
+
+ if (array_key_exists($keys[3], $arr)) {
+ $this->setUsrPasswordHistory($arr[$keys[3]]);
+ }
+
+ }
+
+ /**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(UsersPropertiesPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(UsersPropertiesPeer::USR_UID)) {
+ $criteria->add(UsersPropertiesPeer::USR_UID, $this->usr_uid);
+ }
+
+ if ($this->isColumnModified(UsersPropertiesPeer::USR_LAST_UPDATE_DATE)) {
+ $criteria->add(UsersPropertiesPeer::USR_LAST_UPDATE_DATE, $this->usr_last_update_date);
+ }
+
+ if ($this->isColumnModified(UsersPropertiesPeer::USR_LOGGED_NEXT_TIME)) {
+ $criteria->add(UsersPropertiesPeer::USR_LOGGED_NEXT_TIME, $this->usr_logged_next_time);
+ }
+
+ if ($this->isColumnModified(UsersPropertiesPeer::USR_PASSWORD_HISTORY)) {
+ $criteria->add(UsersPropertiesPeer::USR_PASSWORD_HISTORY, $this->usr_password_history);
+ }
+
+
+ return $criteria;
+ }
+
+ /**
+ * Builds a Criteria object containing the primary key for this object.
+ *
+ * Unlike buildCriteria() this method includes the primary key values regardless
+ * of whether or not they have been modified.
+ *
+ * @return Criteria The Criteria object containing value(s) for primary key(s).
+ */
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(UsersPropertiesPeer::DATABASE_NAME);
+
+ $criteria->add(UsersPropertiesPeer::USR_UID, $this->usr_uid);
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the primary key for this object (row).
+ * @return string
+ */
+ public function getPrimaryKey()
+ {
+ return $this->getUsrUid();
+ }
+
+ /**
+ * Generic method to set the primary key (usr_uid column).
+ *
+ * @param string $key Primary key.
+ * @return void
+ */
+ public function setPrimaryKey($key)
+ {
+ $this->setUsrUid($key);
+ }
+
+ /**
+ * Sets contents of passed object to values from current object.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param object $copyObj An object of UsersProperties (or compatible) type.
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @throws PropelException
+ */
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setUsrLastUpdateDate($this->usr_last_update_date);
+
+ $copyObj->setUsrLoggedNextTime($this->usr_logged_next_time);
+
+ $copyObj->setUsrPasswordHistory($this->usr_password_history);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setUsrUid(''); // this is a pkey column, so set to default value
+
+ }
+
+ /**
+ * Makes a copy of this object that will be inserted as a new row in table when saved.
+ * It creates a new object filling in the simple attributes, but skipping any primary
+ * keys that are defined for the table.
+ *
+ * If desired, this method can also make copies of all associated (fkey referrers)
+ * objects.
+ *
+ * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
+ * @return UsersProperties Clone of current object.
+ * @throws PropelException
+ */
+ public function copy($deepCopy = false)
+ {
+ // we use get_class(), because this might be a subclass
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+ /**
+ * Returns a peer instance associated with this om.
+ *
+ * Since Peer classes are not to have any instance attributes, this method returns the
+ * same instance for all member of this class. The method could therefore
+ * be static, but this would prevent one from overriding the behavior.
+ *
+ * @return UsersPropertiesPeer
+ */
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new UsersPropertiesPeer();
+ }
+ return self::$peer;
+ }
+}
+
diff --git a/workflow/engine/classes/model/om/BaseUsersPropertiesPeer.php b/workflow/engine/classes/model/om/BaseUsersPropertiesPeer.php
index 528ab2b7b..00371d0c7 100755
--- a/workflow/engine/classes/model/om/BaseUsersPropertiesPeer.php
+++ b/workflow/engine/classes/model/om/BaseUsersPropertiesPeer.php
@@ -12,569 +12,571 @@ include_once 'classes/model/UsersProperties.php';
*
* @package workflow.classes.model.om
*/
-abstract class BaseUsersPropertiesPeer {
-
- /** the default database name for this class */
- const DATABASE_NAME = 'workflow';
-
- /** the table name for this class */
- const TABLE_NAME = 'USERS_PROPERTIES';
-
- /** A class that can be returned by this peer. */
- const CLASS_DEFAULT = 'classes.model.UsersProperties';
-
- /** The total number of columns. */
- const NUM_COLUMNS = 4;
-
- /** The number of lazy-loaded columns. */
- const NUM_LAZY_LOAD_COLUMNS = 0;
-
-
- /** the column name for the USR_UID field */
- const USR_UID = 'USERS_PROPERTIES.USR_UID';
-
- /** the column name for the USR_LAST_UPDATE_DATE field */
- const USR_LAST_UPDATE_DATE = 'USERS_PROPERTIES.USR_LAST_UPDATE_DATE';
-
- /** the column name for the USR_LOGGED_NEXT_TIME field */
- const USR_LOGGED_NEXT_TIME = 'USERS_PROPERTIES.USR_LOGGED_NEXT_TIME';
-
- /** the column name for the USR_PASSWORD_HISTORY field */
- const USR_PASSWORD_HISTORY = 'USERS_PROPERTIES.USR_PASSWORD_HISTORY';
-
- /** The PHP to DB Name Mapping */
- private static $phpNameMap = null;
-
-
- /**
- * holds an array of fieldnames
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
- */
- private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('UsrUid', 'UsrLastUpdateDate', 'UsrLoggedNextTime', 'UsrPasswordHistory', ),
- BasePeer::TYPE_COLNAME => array (UsersPropertiesPeer::USR_UID, UsersPropertiesPeer::USR_LAST_UPDATE_DATE, UsersPropertiesPeer::USR_LOGGED_NEXT_TIME, UsersPropertiesPeer::USR_PASSWORD_HISTORY, ),
- BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'USR_LAST_UPDATE_DATE', 'USR_LOGGED_NEXT_TIME', 'USR_PASSWORD_HISTORY', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'UsrLastUpdateDate' => 1, 'UsrLoggedNextTime' => 2, 'UsrPasswordHistory' => 3, ),
- BasePeer::TYPE_COLNAME => array (UsersPropertiesPeer::USR_UID => 0, UsersPropertiesPeer::USR_LAST_UPDATE_DATE => 1, UsersPropertiesPeer::USR_LOGGED_NEXT_TIME => 2, UsersPropertiesPeer::USR_PASSWORD_HISTORY => 3, ),
- BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'USR_LAST_UPDATE_DATE' => 1, 'USR_LOGGED_NEXT_TIME' => 2, 'USR_PASSWORD_HISTORY' => 3, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
- );
-
- /**
- * @return MapBuilder the map builder for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getMapBuilder()
- {
- include_once 'classes/model/map/UsersPropertiesMapBuilder.php';
- return BasePeer::getMapBuilder('classes.model.map.UsersPropertiesMapBuilder');
- }
- /**
- * Gets a map (hash) of PHP names to DB column names.
- *
- * @return array The PHP to DB name map for this peer
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
- */
- public static function getPhpNameMap()
- {
- if (self::$phpNameMap === null) {
- $map = UsersPropertiesPeer::getTableMap();
- $columns = $map->getColumns();
- $nameMap = array();
- foreach ($columns as $column) {
- $nameMap[$column->getPhpName()] = $column->getColumnName();
- }
- self::$phpNameMap = $nameMap;
- }
- return self::$phpNameMap;
- }
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- */
- static public function translateFieldName($name, $fromType, $toType)
- {
- $toNames = self::getFieldNames($toType);
- $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
- }
- return $toNames[$key];
- }
-
- /**
- * Returns an array of of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants TYPE_PHPNAME,
- * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
- * @return array A list of field names
- */
-
- static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, self::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
- }
- return self::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. UsersPropertiesPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(UsersPropertiesPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param criteria object containing the columns to add.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria)
- {
-
- $criteria->addSelectColumn(UsersPropertiesPeer::USR_UID);
-
- $criteria->addSelectColumn(UsersPropertiesPeer::USR_LAST_UPDATE_DATE);
-
- $criteria->addSelectColumn(UsersPropertiesPeer::USR_LOGGED_NEXT_TIME);
-
- $criteria->addSelectColumn(UsersPropertiesPeer::USR_PASSWORD_HISTORY);
-
- }
-
- const COUNT = 'COUNT(USERS_PROPERTIES.USR_UID)';
- const COUNT_DISTINCT = 'COUNT(DISTINCT USERS_PROPERTIES.USR_UID)';
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
- * @param Connection $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, $con = null)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // clear out anything that might confuse the ORDER BY clause
- $criteria->clearSelectColumns()->clearOrderByColumns();
- if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->addSelectColumn(UsersPropertiesPeer::COUNT_DISTINCT);
- } else {
- $criteria->addSelectColumn(UsersPropertiesPeer::COUNT);
- }
-
- // just in case we're grouping: add those columns to the select statement
- foreach($criteria->getGroupByColumns() as $column)
- {
- $criteria->addSelectColumn($column);
- }
-
- $rs = UsersPropertiesPeer::doSelectRS($criteria, $con);
- if ($rs->next()) {
- return $rs->getInt(1);
- } else {
- // no rows returned; we infer that means 0 matches.
- return 0;
- }
- }
- /**
- * Method to select one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param Connection $con
- * @return UsersProperties
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = UsersPropertiesPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
- return null;
- }
- /**
- * Method to do selects.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, $con = null)
- {
- return UsersPropertiesPeer::populateObjects(UsersPropertiesPeer::doSelectRS($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect()
- * method to get a ResultSet.
- *
- * Use this method directly if you want to just get the resultset
- * (instead of an array of objects).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return ResultSet The resultset object with numerically-indexed fields.
- * @see BasePeer::doSelect()
- */
- public static function doSelectRS(Criteria $criteria, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if (!$criteria->getSelectColumns()) {
- $criteria = clone $criteria;
- UsersPropertiesPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- // BasePeer returns a Creole ResultSet, set to return
- // rows indexed numerically.
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(ResultSet $rs)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = UsersPropertiesPeer::getOMClass();
- $cls = Propel::import($cls);
- // populate the object(s)
- while($rs->next()) {
-
- $obj = new $cls();
- $obj->hydrate($rs);
- $results[] = $obj;
-
- }
- return $results;
- }
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- * This uses a dot-path notation which is tranalted into a path
- * relative to a location on the PHP include_path.
- * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
- *
- * @return string path.to.ClassName
- */
- public static function getOMClass()
- {
- return UsersPropertiesPeer::CLASS_DEFAULT;
- }
-
- /**
- * Method perform an INSERT on the database, given a UsersProperties or Criteria object.
- *
- * @param mixed $values Criteria or UsersProperties object containing data that is used to create the INSERT statement.
- * @param Connection $con the connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from UsersProperties object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->begin();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch(PropelException $e) {
- $con->rollback();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Method perform an UPDATE on the database, given a UsersProperties or Criteria object.
- *
- * @param mixed $values Criteria or UsersProperties object containing data that is used to create the UPDATE statement.
- * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $selectCriteria = new Criteria(self::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(UsersPropertiesPeer::USR_UID);
- $selectCriteria->add(UsersPropertiesPeer::USR_UID, $criteria->remove(UsersPropertiesPeer::USR_UID), $comparison);
-
- } else { // $values is UsersProperties object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Method to DELETE all rows from the USERS_PROPERTIES table.
- *
- * @return int The number of affected rows (if supported by underlying database driver).
- */
- public static function doDeleteAll($con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
- $affectedRows += BasePeer::doDeleteAll(UsersPropertiesPeer::TABLE_NAME, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Method perform a DELETE on the database, given a UsersProperties or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or UsersProperties object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param Connection $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } elseif ($values instanceof UsersProperties) {
-
- $criteria = $values->buildPkeyCriteria();
- } else {
- // it must be the primary key
- $criteria = new Criteria(self::DATABASE_NAME);
- $criteria->add(UsersPropertiesPeer::USR_UID, (array) $values, Criteria::IN);
- }
-
- // Set the correct dbName
- $criteria->setDbName(self::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->begin();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given UsersProperties object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param UsersProperties $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate(UsersProperties $obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(UsersPropertiesPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(UsersPropertiesPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach($cols as $colName) {
- if ($tableMap->containsColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(UsersPropertiesPeer::DATABASE_NAME, UsersPropertiesPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param mixed $pk the primary key.
- * @param Connection $con the connection to use
- * @return UsersProperties
- */
- public static function retrieveByPK($pk, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $criteria = new Criteria(UsersPropertiesPeer::DATABASE_NAME);
-
- $criteria->add(UsersPropertiesPeer::USR_UID, $pk);
-
-
- $v = UsersPropertiesPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param Connection $con the connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(self::DATABASE_NAME);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria();
- $criteria->add(UsersPropertiesPeer::USR_UID, $pks, Criteria::IN);
- $objs = UsersPropertiesPeer::doSelect($criteria, $con);
- }
- return $objs;
- }
-
-} // BaseUsersPropertiesPeer
+abstract class BaseUsersPropertiesPeer
+{
+
+ /** the default database name for this class */
+ const DATABASE_NAME = 'workflow';
+
+ /** the table name for this class */
+ const TABLE_NAME = 'USERS_PROPERTIES';
+
+ /** A class that can be returned by this peer. */
+ const CLASS_DEFAULT = 'classes.model.UsersProperties';
+
+ /** The total number of columns. */
+ const NUM_COLUMNS = 4;
+
+ /** The number of lazy-loaded columns. */
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+ /** the column name for the USR_UID field */
+ const USR_UID = 'USERS_PROPERTIES.USR_UID';
+
+ /** the column name for the USR_LAST_UPDATE_DATE field */
+ const USR_LAST_UPDATE_DATE = 'USERS_PROPERTIES.USR_LAST_UPDATE_DATE';
+
+ /** the column name for the USR_LOGGED_NEXT_TIME field */
+ const USR_LOGGED_NEXT_TIME = 'USERS_PROPERTIES.USR_LOGGED_NEXT_TIME';
+
+ /** the column name for the USR_PASSWORD_HISTORY field */
+ const USR_PASSWORD_HISTORY = 'USERS_PROPERTIES.USR_PASSWORD_HISTORY';
+
+ /** The PHP to DB Name Mapping */
+ private static $phpNameMap = null;
+
+
+ /**
+ * holds an array of fieldnames
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
+ */
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('UsrUid', 'UsrLastUpdateDate', 'UsrLoggedNextTime', 'UsrPasswordHistory', ),
+ BasePeer::TYPE_COLNAME => array (UsersPropertiesPeer::USR_UID, UsersPropertiesPeer::USR_LAST_UPDATE_DATE, UsersPropertiesPeer::USR_LOGGED_NEXT_TIME, UsersPropertiesPeer::USR_PASSWORD_HISTORY, ),
+ BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'USR_LAST_UPDATE_DATE', 'USR_LOGGED_NEXT_TIME', 'USR_PASSWORD_HISTORY', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * holds an array of keys for quick access to the fieldnames array
+ *
+ * first dimension keys are the type constants
+ * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
+ */
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'UsrLastUpdateDate' => 1, 'UsrLoggedNextTime' => 2, 'UsrPasswordHistory' => 3, ),
+ BasePeer::TYPE_COLNAME => array (UsersPropertiesPeer::USR_UID => 0, UsersPropertiesPeer::USR_LAST_UPDATE_DATE => 1, UsersPropertiesPeer::USR_LOGGED_NEXT_TIME => 2, UsersPropertiesPeer::USR_PASSWORD_HISTORY => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'USR_LAST_UPDATE_DATE' => 1, 'USR_LOGGED_NEXT_TIME' => 2, 'USR_PASSWORD_HISTORY' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+ /**
+ * @return MapBuilder the map builder for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getMapBuilder()
+ {
+ include_once 'classes/model/map/UsersPropertiesMapBuilder.php';
+ return BasePeer::getMapBuilder('classes.model.map.UsersPropertiesMapBuilder');
+ }
+ /**
+ * Gets a map (hash) of PHP names to DB column names.
+ *
+ * @return array The PHP to DB name map for this peer
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
+ */
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = UsersPropertiesPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+ /**
+ * Translates a fieldname to another type
+ *
+ * @param string $name field name
+ * @param string $fromType One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @param string $toType One of the class type constants
+ * @return string translated name of the field.
+ */
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+ /**
+ * Returns an array of of field names.
+ *
+ * @param string $type The type of fieldnames to return:
+ * One of the class type constants TYPE_PHPNAME,
+ * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
+ * @return array A list of field names
+ */
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+ /**
+ * Convenience method which changes table.column to alias.column.
+ *
+ * Using this method you can maintain SQL abstraction while using column aliases.
+ *
+ * $c->addAlias("alias1", TablePeer::TABLE_NAME);
+ * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
+ *
+ * @param string $alias The alias for the current table.
+ * @param string $column The column name for current table. (i.e. UsersPropertiesPeer::COLUMN_NAME).
+ * @return string
+ */
+ public static function alias($alias, $column)
+ {
+ return str_replace(UsersPropertiesPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+ /**
+ * Add all the columns needed to create a new object.
+ *
+ * Note: any columns that were marked with lazyLoad="true" in the
+ * XML schema will not be added to the select list and only loaded
+ * on demand.
+ *
+ * @param criteria object containing the columns to add.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(UsersPropertiesPeer::USR_UID);
+
+ $criteria->addSelectColumn(UsersPropertiesPeer::USR_LAST_UPDATE_DATE);
+
+ $criteria->addSelectColumn(UsersPropertiesPeer::USR_LOGGED_NEXT_TIME);
+
+ $criteria->addSelectColumn(UsersPropertiesPeer::USR_PASSWORD_HISTORY);
+
+ }
+
+ const COUNT = 'COUNT(USERS_PROPERTIES.USR_UID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT USERS_PROPERTIES.USR_UID)';
+
+ /**
+ * Returns the number of rows matching criteria.
+ *
+ * @param Criteria $criteria
+ * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
+ * @param Connection $con
+ * @return int Number of matching rows.
+ */
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ // we're going to modify criteria, so copy it first
+ $criteria = clone $criteria;
+
+ // clear out anything that might confuse the ORDER BY clause
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(UsersPropertiesPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(UsersPropertiesPeer::COUNT);
+ }
+
+ // just in case we're grouping: add those columns to the select statement
+ foreach ($criteria->getGroupByColumns() as $column) {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = UsersPropertiesPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ // no rows returned; we infer that means 0 matches.
+ return 0;
+ }
+ }
+ /**
+ * Method to select one object from the DB.
+ *
+ * @param Criteria $criteria object used to create the SELECT statement.
+ * @param Connection $con
+ * @return UsersProperties
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = UsersPropertiesPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+ /**
+ * Method to do selects.
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con
+ * @return array Array of selected Objects
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return UsersPropertiesPeer::populateObjects(UsersPropertiesPeer::doSelectRS($criteria, $con));
+ }
+ /**
+ * Prepares the Criteria object and uses the parent doSelect()
+ * method to get a ResultSet.
+ *
+ * Use this method directly if you want to just get the resultset
+ * (instead of an array of objects).
+ *
+ * @param Criteria $criteria The Criteria object used to build the SELECT statement.
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ * @return ResultSet The resultset object with numerically-indexed fields.
+ * @see BasePeer::doSelect()
+ */
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ UsersPropertiesPeer::addSelectColumns($criteria);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ // BasePeer returns a Creole ResultSet, set to return
+ // rows indexed numerically.
+ return BasePeer::doSelect($criteria, $con);
+ }
+ /**
+ * The returned array will contain objects of the default type or
+ * objects that inherit from the default.
+ *
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ // set the class once to avoid overhead in the loop
+ $cls = UsersPropertiesPeer::getOMClass();
+ $cls = Propel::import($cls);
+ // populate the object(s)
+ while ($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+ /**
+ * Returns the TableMap related to this peer.
+ * This method is not needed for general use but a specific application could have a need.
+ * @return TableMap
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+ /**
+ * The class that the Peer will make instances of.
+ *
+ * This uses a dot-path notation which is tranalted into a path
+ * relative to a location on the PHP include_path.
+ * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
+ *
+ * @return string path.to.ClassName
+ */
+ public static function getOMClass()
+ {
+ return UsersPropertiesPeer::CLASS_DEFAULT;
+ }
+
+ /**
+ * Method perform an INSERT on the database, given a UsersProperties or Criteria object.
+ *
+ * @param mixed $values Criteria or UsersProperties object containing data that is used to create the INSERT statement.
+ * @param Connection $con the connection to use
+ * @return mixed The new primary key.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } else {
+ $criteria = $values->buildCriteria(); // build Criteria from UsersProperties object
+ }
+
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table (I guess, conceivably)
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+ /**
+ * Method perform an UPDATE on the database, given a UsersProperties or Criteria object.
+ *
+ * @param mixed $values Criteria or UsersProperties object containing data create the UPDATE statement.
+ * @param Connection $con The connection to use (specify Connection exert more control over transactions).
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+
+ $comparison = $criteria->getComparison(UsersPropertiesPeer::USR_UID);
+ $selectCriteria->add(UsersPropertiesPeer::USR_UID, $criteria->remove(UsersPropertiesPeer::USR_UID), $comparison);
+
+ } else {
+ $criteria = $values->buildCriteria(); // gets full criteria
+ $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
+ }
+
+ // set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+ /**
+ * Method to DELETE all rows from the USERS_PROPERTIES table.
+ *
+ * @return int The number of affected rows (if supported by underlying database driver).
+ */
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; // initialize var to track total num of affected rows
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(UsersPropertiesPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Method perform a DELETE on the database, given a UsersProperties or Criteria object OR a primary key value.
+ *
+ * @param mixed $values Criteria or UsersProperties object or primary key or array of primary keys
+ * which is used to create the DELETE statement
+ * @param Connection $con the connection to use
+ * @return int The number of affected rows (if supported by underlying database driver).
+ * This includes CASCADE-related rows
+ * if supported by native driver or if emulated using Propel.
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; // rename for clarity
+ } elseif ($values instanceof UsersProperties) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ // it must be the primary key
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(UsersPropertiesPeer::USR_UID, (array) $values, Criteria::IN);
+ }
+
+ // Set the correct dbName
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0; // initialize var to track total num of affected rows
+
+ try {
+ // use transaction because $criteria could contain info
+ // for more than one table or we could emulating ON DELETE CASCADE, etc.
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+ /**
+ * Validates all modified columns of given UsersProperties object.
+ * If parameter $columns is either a single column name or an array of column names
+ * than only those columns are validated.
+ *
+ * NOTICE: This does not apply to primary or foreign keys for now.
+ *
+ * @param UsersProperties $obj The object to validate.
+ * @param mixed $cols Column name or array of column names.
+ *
+ * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
+ */
+ public static function doValidate(UsersProperties $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(UsersPropertiesPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(UsersPropertiesPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach ($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ return BasePeer::doValidate(UsersPropertiesPeer::DATABASE_NAME, UsersPropertiesPeer::TABLE_NAME, $columns);
+ }
+
+ /**
+ * Retrieve a single object by pkey.
+ *
+ * @param mixed $pk the primary key.
+ * @param Connection $con the connection to use
+ * @return UsersProperties
+ */
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(UsersPropertiesPeer::DATABASE_NAME);
+
+ $criteria->add(UsersPropertiesPeer::USR_UID, $pk);
+
+
+ $v = UsersPropertiesPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+ /**
+ * Retrieve multiple objects by pkey.
+ *
+ * @param array $pks List of primary keys
+ * @param Connection $con the connection to use
+ * @throws PropelException Any exceptions caught during processing will be
+ * rethrown wrapped into a PropelException.
+ */
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(UsersPropertiesPeer::USR_UID, $pks, Criteria::IN);
+ $objs = UsersPropertiesPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+}
+
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
- // the MapBuilder classes register themselves with Propel during initialization
- // so we need to load them here.
- try {
- BaseUsersPropertiesPeer::getMapBuilder();
- } catch (Exception $e) {
- Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
- }
+ // the MapBuilder classes register themselves with Propel during initialization
+ // so we need to load them here.
+ try {
+ BaseUsersPropertiesPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
} else {
- // even if Propel is not yet initialized, the map builder class can be registered
- // now and then it will be loaded when Propel initializes.
- require_once 'classes/model/map/UsersPropertiesMapBuilder.php';
- Propel::registerMapBuilder('classes.model.map.UsersPropertiesMapBuilder');
+ // even if Propel is not yet initialized, the map builder class can be registered
+ // now and then it will be loaded when Propel initializes.
+ require_once 'classes/model/map/UsersPropertiesMapBuilder.php';
+ Propel::registerMapBuilder('classes.model.map.UsersPropertiesMapBuilder');
}
+
diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml
index 4f48dba98..35e958697 100755
--- a/workflow/engine/config/schema.xml
+++ b/workflow/engine/config/schema.xml
@@ -166,6 +166,7 @@
+
diff --git a/workflow/engine/methods/cases/cases_SaveData.php b/workflow/engine/methods/cases/cases_SaveData.php
index ec402a39e..d8a7315dd 100755
--- a/workflow/engine/methods/cases/cases_SaveData.php
+++ b/workflow/engine/methods/cases/cases_SaveData.php
@@ -30,18 +30,19 @@ try {
throw new Exception(G::LoadTranslation('ID_INVALID_APPLICATION_ID_MSG', array('{1}', G::LoadTranslation('ID_REOPEN'))));
}
- $oForm = new Form ( $_SESSION ['PROCESS'] . '/' . $_GET ['UID'], PATH_DYNAFORM );
- $oForm->validatePost ();
+ $oForm = new Form($_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM);
+ $oForm->validatePost();
- /* Includes */
- G::LoadClass ( 'case' );
+ //Includes
+ G::LoadClass("case");
- //load the variables
- $oCase = new Cases ( );
- $oCase->thisIsTheCurrentUser ( $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['USER_LOGGED'], 'REDIRECT', 'cases_List' );
- $Fields = $oCase->loadCase ( $_SESSION ['APPLICATION'] );
- $Fields ['APP_DATA'] = array_merge ( $Fields ['APP_DATA'], G::getSystemConstants () );
- $Fields ['APP_DATA'] = array_merge ( $Fields ['APP_DATA'], ( array ) $_POST ['form'] );
+ //Load the variables
+ $oCase = new Cases();
+ $oCase->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List");
+ $Fields = $oCase->loadCase($_SESSION["APPLICATION"]);
+
+ $Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], G::getSystemConstants());
+ $Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], $_POST["form"]);
#here we must verify if is a debug session
$trigger_debug_session = $_SESSION ['TRIGGER_DEBUG'] ['ISSET']; #here we must verify if is a debugg session
@@ -115,13 +116,13 @@ try {
} catch ( Exception $oError ) {
//Nothing
}
- }
+ }
else {
try {
// assembling the field list in order to save the data ina new record of a pm table
if (empty($newValues)){
$newValues = $aValues;
- }
+ }
else {
foreach ($aValues as $aValueKey=>$aValueCont) {
if (trim($newValues[$aValueKey])==''){
@@ -138,7 +139,7 @@ try {
}
}
}
-
+
//save data
$aData = array ();
$aData ['APP_NUMBER'] = $Fields ['APP_NUMBER'];
@@ -160,92 +161,148 @@ try {
$oAdditionalTables->saveDataInTable( $oForm->fields [$oForm->fields[$id]->pmconnection]->pmtable, $newValues);
}
}
-
- //save files
- require_once 'classes/model/AppDocument.php';
- if (isset ( $_FILES ['form'] )) {
- foreach ( $_FILES ['form'] ['name'] as $sFieldName => $vValue ) {
- if ($_FILES ['form'] ['error'] [$sFieldName] == 0) {
- $oAppDocument = new AppDocument();
-
- if ( isset ( $_POST ['INPUTS'] [$sFieldName] ) && $_POST ['INPUTS'] [$sFieldName] != '' ) {
- require_once ('classes/model/AppFolder.php');
- require_once ('classes/model/InputDocument.php');
-
- $oInputDocument = new InputDocument();
- $aID = $oInputDocument->load($_POST ['INPUTS'] [$sFieldName]);
-
- //Get the Custom Folder ID (create if necessary)
- $oFolder=new AppFolder();
- $folderId=$oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH']);
-
- //Tags
- $fileTags=$oFolder->parseTags($aID['INP_DOC_TAGS']);
-
- $aFields = array (
- 'APP_UID' => $_SESSION ['APPLICATION'],
- 'DEL_INDEX' => $_SESSION ['INDEX'],
- 'USR_UID' => $_SESSION ['USER_LOGGED'],
- 'DOC_UID' => $_POST ['INPUTS'] [$sFieldName],
- 'APP_DOC_TYPE' => 'INPUT',
- 'APP_DOC_CREATE_DATE' => date ( 'Y-m-d H:i:s' ),
- 'APP_DOC_COMMENT' => '',
- 'APP_DOC_TITLE' => '',
- 'APP_DOC_FILENAME' => $_FILES ['form'] ['name'] [$sFieldName],
- 'FOLDER_UID' => $folderId,
- 'APP_DOC_TAGS' => $fileTags
- );
- }
- else {
- $aFields = array (
- 'APP_UID' => $_SESSION ['APPLICATION'],
- 'DEL_INDEX' => $_SESSION ['INDEX'],
- 'USR_UID' => $_SESSION ['USER_LOGGED'],
- 'DOC_UID' => -1,
- 'APP_DOC_TYPE' => 'ATTACHED',
- 'APP_DOC_CREATE_DATE' => date ( 'Y-m-d H:i:s' ),
- 'APP_DOC_COMMENT' => '',
- 'APP_DOC_TITLE' => '',
- 'APP_DOC_FILENAME' => $_FILES ['form'] ['name'] [$sFieldName]
- );
- }
-
- $oAppDocument->create($aFields);
-
- $iDocVersion = $oAppDocument->getDocVersion();
- $sAppDocUid = $oAppDocument->getAppDocUid();
- $aInfo = pathinfo($oAppDocument->getAppDocFilename());
- $sExtension = (isset ( $aInfo ['extension'] ) ? $aInfo ['extension'] : '');
- $sPathName = PATH_DOCUMENT . $_SESSION ['APPLICATION'] . PATH_SEP;
- $sFileName = $sAppDocUid . '_'.$iDocVersion.'.' . $sExtension;
- G::uploadFile ( $_FILES ['form'] ['tmp_name'] [$sFieldName], $sPathName, $sFileName );
-
- //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
- $oPluginRegistry = &PMPluginRegistry::getSingleton();
- if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) {
- $triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
- $documentData = new uploadDocumentData($_SESSION["APPLICATION"], $_SESSION["USER_LOGGED"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion);
- $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
-
- if ($uploadReturn) {
- $aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
-
- if (!isset($aFields["APP_DOC_UID"])) {
- $aFields["APP_DOC_UID"] = $sAppDocUid;
+
+ //Save files
+ require_once ("classes/model/AppDocument.php");
+
+ if (isset($_FILES["form"]["name"]) && count($_FILES["form"]["name"]) > 0) {
+ $arrayField = array();
+ $arrayFileName = array();
+ $arrayFileTmpName = array();
+ $arrayFileError = array();
+ $i = 0;
+
+ foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
+ if (is_array($fieldValue)) {
+ foreach ($fieldValue as $index => $value) {
+ if (is_array($value)) {
+ foreach ($value as $grdFieldIndex => $grdFieldValue) {
+ $arrayField[$i]["grdName"] = $fieldIndex;
+ $arrayField[$i]["grdFieldName"] = $grdFieldIndex;
+ $arrayField[$i]["index"] = $index;
+
+ $arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
+ $arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
+ $arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
+ $i = $i + 1;
+ }
+ }
+ }
+ } else {
+ $arrayField[$i] = $fieldIndex;
+
+ $arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
+ $arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
+ $arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
+ $i = $i + 1;
+ }
+ }
+
+ if (count($arrayField) > 0) {
+ for ($i = 0; $i <= count($arrayField) - 1; $i++) {
+ if ($arrayFileError[$i] == 0) {
+ $indocUid = null;
+ $fieldName = null;
+
+ if (is_array($arrayField[$i])) {
+ if (isset($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]]) &&
+ !empty($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]])
+ ) {
+ $indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
+ }
+
+ $fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
+ } else {
+ if (isset($_POST["INPUTS"][$arrayField[$i]]) &&
+ !empty($_POST["INPUTS"][$arrayField[$i]])
+ ) {
+ $indocUid = $_POST["INPUTS"][$arrayField[$i]];
+ }
+
+ $fieldName = $arrayField[$i];
+ }
+
+ if ($indocUid != null) {
+ require_once ("classes/model/AppFolder.php");
+ require_once ("classes/model/InputDocument.php");
+
+ $oInputDocument = new InputDocument();
+ $aID = $oInputDocument->load($indocUid);
+
+ //Get the Custom Folder ID (create if necessary)
+ $oFolder = new AppFolder();
+
+ $aFields = array (
+ "APP_UID" => $_SESSION["APPLICATION"],
+ "DEL_INDEX" => $_SESSION["INDEX"],
+ "USR_UID" => $_SESSION["USER_LOGGED"],
+ "DOC_UID" => $indocUid,
+ "APP_DOC_TYPE" => "INPUT",
+ "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
+ "APP_DOC_COMMENT" => "",
+ "APP_DOC_TITLE" => "",
+ "APP_DOC_FILENAME" => $arrayFileName[$i],
+ "FOLDER_UID" => $oFolder->createFromPath($aID["INP_DOC_DESTINATION_PATH"]),
+ "APP_DOC_TAGS" => $oFolder->parseTags($aID["INP_DOC_TAGS"]),
+ "APP_DOC_FIELDNAME" => $fieldName
+ );
+ } else {
+ $aFields = array (
+ "APP_UID" => $_SESSION["APPLICATION"],
+ "DEL_INDEX" => $_SESSION["INDEX"],
+ "USR_UID" => $_SESSION["USER_LOGGED"],
+ "DOC_UID" => -1,
+ "APP_DOC_TYPE" => "ATTACHED",
+ "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
+ "APP_DOC_COMMENT" => "",
+ "APP_DOC_TITLE" => "",
+ "APP_DOC_FILENAME" => $arrayFileName[$i],
+ "APP_DOC_FIELDNAME" => $fieldName
+ );
+ }
+
+ $oAppDocument = new AppDocument();
+ $oAppDocument->create($aFields);
+
+ $iDocVersion = $oAppDocument->getDocVersion();
+ $sAppDocUid = $oAppDocument->getAppDocUid();
+ $aInfo = pathinfo($oAppDocument->getAppDocFilename());
+ $sExtension = ((isset($aInfo["extension"]))? $aInfo["extension"] : "");
+ $sPathName = PATH_DOCUMENT . $_SESSION ["APPLICATION"] . PATH_SEP;
+ $sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
+
+ G::uploadFile($arrayFileTmpName[$i], $sPathName, $sFileName);
+
+ //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
+ $oPluginRegistry = &PMPluginRegistry::getSingleton();
+
+ if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) {
+ $triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
+ $documentData = new uploadDocumentData($_SESSION["APPLICATION"], $_SESSION["USER_LOGGED"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion);
+ $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
+
+ if ($uploadReturn) {
+ $aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
+
+ if (!isset($aFields["APP_DOC_UID"])) {
+ $aFields["APP_DOC_UID"] = $sAppDocUid;
+ }
+
+ if (!isset($aFields["DOC_VERSION"])) {
+ $aFields["DOC_VERSION"] = $iDocVersion;
+ }
+
+ $oAppDocument->update($aFields);
+
+ unlink($sPathName . $sFileName);
+ }
+ }
}
- if (!isset($aFields["DOC_VERSION"])) {
- $aFields["DOC_VERSION"] = $iDocVersion;
- }
-
- $oAppDocument->update($aFields);
-
- unlink($sPathName . $sFileName);
}
- }
}
- }
}
- //go to the next step
+
+ //Go to the next step
$aNextStep = $oCase->getNextStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] );
if (isset ( $_GET ['_REFRESH_'] )) {
G::header ( 'location: ' . $_SERVER ['HTTP_REFERER'] );
diff --git a/workflow/engine/methods/services/upload.php b/workflow/engine/methods/services/upload.php
index 211789e04..03fa19893 100755
--- a/workflow/engine/methods/services/upload.php
+++ b/workflow/engine/methods/services/upload.php
@@ -1,156 +1,167 @@
-.
- *
- * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
- * Coral Gables, FL, 33134, USA, or email info@colosa.com.
- *
- */
-
-/**
- * @Updated Dec 14, 2009 by Erik
- *
- * The point of this application is upload the file and create the input document record
- *
- * if the post attached file has error code 0 continue in other case nothing to do. */
-
-if (isset($_FILES) && $_FILES['ATTACH_FILE']['error'] == 0) {
- try{
- G::LoadClass('case');
-
- $folderId = '';
- $fileTags = '';
-
- if (isset($_POST['DOC_UID']) && $_POST['DOC_UID'] != -1) {
- //The document is of an Specific Input Document. Get path and Tag information
- require_once ('classes/model/AppFolder.php');
- require_once ('classes/model/InputDocument.php');
-
- $oInputDocument = new InputDocument();
- $aID = $oInputDocument->load($_POST['DOC_UID']);
-
- //Get the Custom Folder ID (create if necessary)
- $oFolder = new AppFolder();
- $folderId = $oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH'], $_POST['APPLICATION']);
-
- //Tags
- $fileTags = $oFolder->parseTags($aID['INP_DOC_TAGS'], $_POST['APPLICATION']);
- }
-
- $oAppDocument = new AppDocument();
-
- if (isset($_POST['APP_DOC_UID']) && trim($_POST['APP_DOC_UID']) != '') {
- //Update
- echo '[update]';
- $aFields['APP_DOC_UID'] = $_POST['APP_DOC_UID'];
- $aFields['DOC_VERSION'] = $_POST['DOC_VERSION'];
- $aFields['APP_DOC_FILENAME'] = $_FILES['ATTACH_FILE']['name'];
-
- if (isset($_POST['APPLICATION']))
- $aFields['APP_UID'] = $_POST['APPLICATION'];
- if (isset($_POST['INDEX']))
- $aFields['DEL_INDEX'] = $_POST['INDEX'];
- if (isset($_POST['USR_UID']))
- $aFields['USR_UID'] = $_POST['USR_UID'];
- if (isset($_POST['DOC_UID']))
- $aFields['DOC_UID'] = $_POST['DOC_UID'];
- if (isset($_POST['APP_DOC_TYPE']))
- $aFields['APP_DOC_TYPE']= $_POST['APP_DOC_TYPE'];
-
- $aFields['APP_DOC_CREATE_DATE'] = date('Y-m-d H:i:s');
- $aFields['APP_DOC_COMMENT'] = isset($_POST['COMMENT'])? $_POST['COMMENT'] : '';
- $aFields['APP_DOC_TITLE'] = isset($_POST['TITLE'])? $_POST['TITLE'] : '';
-
- //$aFields['FOLDER_UID'] = $folderId,
- //$aFields['APP_DOC_TAGS']= $fileTags
- }
- else {
- //New record
- $aFields = array(
- 'APP_UID' => $_POST['APPLICATION'],
- 'DEL_INDEX' => $_POST['INDEX'],
- 'USR_UID' => $_POST['USR_UID'],
- 'DOC_UID' => $_POST['DOC_UID'],
- 'APP_DOC_TYPE' => $_POST['APP_DOC_TYPE'],
- 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
- 'APP_DOC_COMMENT' => isset($_POST['COMMENT'])? $_POST['COMMENT'] : '',
- 'APP_DOC_TITLE' => isset($_POST['TITLE'])? $_POST['TITLE'] : '',
- 'APP_DOC_FILENAME' => isset($_FILES['ATTACH_FILE']['name'])? $_FILES['ATTACH_FILE']['name'] : '',
- 'FOLDER_UID' => $folderId,
- 'APP_DOC_TAGS' => $fileTags
- );
- }
-
- $oAppDocument->create($aFields);
-
- $sAppUid = $oAppDocument->getAppUid();
- $sAppDocUid = $oAppDocument->getAppDocUid();
- $iDocVersion = $oAppDocument->getDocVersion();
- $info = pathinfo($oAppDocument->getAppDocFilename());
- $ext = isset($info['extension'])? $info['extension'] : '';
-
- //Save the file
- echo $sPathName = PATH_DOCUMENT . $sAppUid . PATH_SEP;
- echo $sFileName = $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
- print G::uploadFile($_FILES['ATTACH_FILE']['tmp_name'], $sPathName, $sFileName);
- print("* The file {$_FILES['ATTACH_FILE']['name']} was uploaded successfully in case {$sAppUid} as input document..\n");
-
- //Get current Application Fields
- $application = new Application();
- $appFields = $application->Load($_POST['APPLICATION']);
- $appFields = unserialize($appFields['APP_DATA']);
-
- $_SESSION['APPLICATION'] = $appFields['APPLICATION'];
- $_SESSION['PROCESS'] = $appFields['PROCESS'];
- $_SESSION['TASK'] = $appFields['TASK'];
- $_SESSION['INDEX'] = $appFields['INDEX'];
- $_SESSION['USER_LOGGED'] = $appFields['USER_LOGGED']; //$_POST['USR_UID']
- //$_SESSION['USR_USERNAME'] = $appFields['USR_USERNAME'];
- //$_SESSION['STEP_POSITION'] = 0;
-
- //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
- $oPluginRegistry = &PMPluginRegistry::getSingleton();
-
- if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) {
- $triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
- $documentData = new uploadDocumentData($_POST["APPLICATION"], $_POST["USR_UID"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion);
- $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
-
- if ($uploadReturn) {
- $aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
-
- if (!isset($aFields["APP_DOC_UID"])) {
- $aFields["APP_DOC_UID"] = $sAppDocUid;
- }
-
- if (!isset($aFields["DOC_VERSION"])) {
- $aFields["DOC_VERSION"] = $iDocVersion;
- }
-
- $oAppDocument->update($aFields);
-
- unlink($sPathName . $sFileName);
- }
- }
- //End plugin
- }
- catch (Exception $e) {
- print($e->getMessage());
- }
-}
+.
+ *
+ * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
+ * Coral Gables, FL, 33134, USA, or email info@colosa.com.
+ *
+ */
+
+/**
+ * @Updated Dec 14, 2009 by Erik
+ *
+ * The point of this application is upload the file and create the input document record
+ *
+ * if the post attached file has error code 0 continue in other case nothing to do.
+ */
+
+if (isset($_FILES) && $_FILES["ATTACH_FILE"]["error"] == 0) {
+ try{
+ G::LoadClass("case");
+
+ $folderId = "";
+ $fileTags = "";
+
+ if (isset($_POST["DOC_UID"]) && $_POST["DOC_UID"] != -1) {
+ //The document is of an Specific Input Document. Get path and Tag information
+ require_once ("classes/model/AppFolder.php");
+ require_once ("classes/model/InputDocument.php");
+
+ $oInputDocument = new InputDocument();
+ $aID = $oInputDocument->load($_POST["DOC_UID"]);
+
+ //Get the Custom Folder ID (create if necessary)
+ $oFolder = new AppFolder();
+ $folderId = $oFolder->createFromPath($aID["INP_DOC_DESTINATION_PATH"], $_POST["APPLICATION"]);
+
+ //Tags
+ $fileTags = $oFolder->parseTags($aID["INP_DOC_TAGS"], $_POST["APPLICATION"]);
+ }
+
+ $oAppDocument = new AppDocument();
+
+ if (isset($_POST["APP_DOC_UID"]) && trim($_POST["APP_DOC_UID"]) != "") {
+ //Update
+ echo "[update]";
+ $aFields["APP_DOC_UID"] = $_POST["APP_DOC_UID"];
+ $aFields["DOC_VERSION"] = $_POST["DOC_VERSION"];
+ $aFields["APP_DOC_FILENAME"] = $_FILES["ATTACH_FILE"]["name"];
+
+ if (isset($_POST["APPLICATION"])) {
+ $aFields["APP_UID"] = $_POST["APPLICATION"];
+ }
+
+ if (isset($_POST["INDEX"])) {
+ $aFields["DEL_INDEX"] = $_POST["INDEX"];
+ }
+
+ if (isset($_POST["USR_UID"])) {
+ $aFields["USR_UID"] = $_POST["USR_UID"];
+ }
+
+ if (isset($_POST["DOC_UID"])) {
+ $aFields["DOC_UID"] = $_POST["DOC_UID"];
+ }
+
+ if (isset($_POST["APP_DOC_TYPE"])) {
+ $aFields["APP_DOC_TYPE"] = $_POST["APP_DOC_TYPE"];
+ }
+
+ $aFields["APP_DOC_CREATE_DATE"] = date("Y-m-d H:i:s");
+ $aFields["APP_DOC_COMMENT"] = (isset($_POST["COMMENT"]))? $_POST["COMMENT"] : "";
+ $aFields["APP_DOC_TITLE"] = (isset($_POST["TITLE"]))? $_POST["TITLE"] : "";
+
+ //$aFields["FOLDER_UID"] = $folderId,
+ //$aFields["APP_DOC_TAGS"] = $fileTags
+
+ $aFields["APP_DOC_FIELDNAME"] = $_POST["APP_DOC_FIELDNAME"];
+ } else {
+ //New record
+ $aFields = array(
+ "APP_UID" => $_POST["APPLICATION"],
+ "DEL_INDEX" => $_POST["INDEX"],
+ "USR_UID" => $_POST["USR_UID"],
+ "DOC_UID" => $_POST["DOC_UID"],
+ "APP_DOC_TYPE" => $_POST["APP_DOC_TYPE"],
+ "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
+ "APP_DOC_COMMENT" => (isset($_POST["COMMENT"]))? $_POST["COMMENT"] : "",
+ "APP_DOC_TITLE" => (isset($_POST["TITLE"]))? $_POST["TITLE"] : "",
+ "APP_DOC_FILENAME" => (isset($_FILES["ATTACH_FILE"]["name"]))? $_FILES["ATTACH_FILE"]["name"] : "",
+ "FOLDER_UID" => $folderId,
+ "APP_DOC_TAGS" => $fileTags,
+ "APP_DOC_FIELDNAME" => $_POST["APP_DOC_FIELDNAME"]
+ );
+ }
+
+ $oAppDocument->create($aFields);
+
+ $sAppUid = $oAppDocument->getAppUid();
+ $sAppDocUid = $oAppDocument->getAppDocUid();
+ $iDocVersion = $oAppDocument->getDocVersion();
+ $info = pathinfo($oAppDocument->getAppDocFilename());
+ $ext = (isset($info["extension"]))? $info["extension"] : "";
+
+ //Save the file
+ echo $sPathName = PATH_DOCUMENT . $sAppUid . PATH_SEP;
+ echo $sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $ext;
+ print G::uploadFile($_FILES["ATTACH_FILE"]["tmp_name"], $sPathName, $sFileName);
+ print("* The file " . $_FILES["ATTACH_FILE"]["name"] . " was uploaded successfully in case " . $sAppUid . " as input document..\n");
+
+ //Get current Application Fields
+ $application = new Application();
+ $appFields = $application->Load($_POST["APPLICATION"]);
+ $appFields = unserialize($appFields["APP_DATA"]);
+
+ $_SESSION["APPLICATION"] = $appFields["APPLICATION"];
+ $_SESSION["PROCESS"] = $appFields["PROCESS"];
+ $_SESSION["TASK"] = $appFields["TASK"];
+ $_SESSION["INDEX"] = $appFields["INDEX"];
+ $_SESSION["USER_LOGGED"] = $appFields["USER_LOGGED"]; //$_POST["USR_UID"]
+ //$_SESSION["USR_USERNAME"] = $appFields["USR_USERNAME"];
+ //$_SESSION["STEP_POSITION"] = 0;
+
+ //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
+ $oPluginRegistry = &PMPluginRegistry::getSingleton();
+
+ if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) {
+ $triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
+ $documentData = new uploadDocumentData($_POST["APPLICATION"], $_POST["USR_UID"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion);
+ $uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
+
+ if ($uploadReturn) {
+ $aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
+
+ if (!isset($aFields["APP_DOC_UID"])) {
+ $aFields["APP_DOC_UID"] = $sAppDocUid;
+ }
+
+ if (!isset($aFields["DOC_VERSION"])) {
+ $aFields["DOC_VERSION"] = $iDocVersion;
+ }
+
+ $oAppDocument->update($aFields);
+
+ unlink($sPathName . $sFileName);
+ }
+ }
+ //End plugin
+ } catch (Exception $e) {
+ print($e->getMessage());
+ }
+}
diff --git a/workflow/engine/templates/processes/webentryPost.tpl b/workflow/engine/templates/processes/webentryPost.tpl
index c4e209e75..8efdf7c65 100755
--- a/workflow/engine/templates/processes/webentryPost.tpl
+++ b/workflow/engine/templates/processes/webentryPost.tpl
@@ -1,90 +1,149 @@
validatePost();
- ws_open ();
- $result = ws_newCase ( '{processUid}', '{taskUid}', convertFormToWSObjects($_POST['form']) );
-
+ ws_open();
+ $result = ws_newCase("{processUid}", "{taskUid}", convertFormToWSObjects($_POST["form"]));
+
if ($result->status_code == 0) {
- $caseId = $result->caseId;
- $caseNr = $result->caseNumber;
-
- {USR_VAR}
-
- if ($USR_UID == -1) {
- G::LoadClass("sessions");
-
- global $sessionId;
-
- $sessions = new Sessions();
- $session = $sessions->getSessionUser($sessionId);
-
- $USR_UID = $session["USR_UID"];
- }
-
- //Save files
- if ( isset($_FILES['form']) ) {
- foreach ($_FILES['form']['name'] as $sFieldName => $vValue) {
- if ( $_FILES['form']['error'][$sFieldName] == 0 ){
- file_put_contents(G::sys_get_temp_dir().PATH_SEP.$_FILES['form']['name'][$sFieldName], file_get_contents($_FILES['form']['tmp_name'][$sFieldName]));
- $fpath = G::sys_get_temp_dir().PATH_SEP.$_FILES['form']['name'][$sFieldName];
-
- if( isset($_POST['INPUTS'][$sFieldName]) && $_POST['INPUTS'][$sFieldName] != '' ){ #input file type
- ws_sendFile($fpath, $USR_UID, $caseId, 1, $_POST['INPUTS'][$sFieldName]);
- } else { #attached file type
- ws_sendFile($fpath, $USR_UID, $caseId);
- }
- }
+ $caseId = $result->caseId;
+ $caseNr = $result->caseNumber;
+
+ {USR_VAR}
+
+ if ($USR_UID == -1) {
+ G::LoadClass("sessions");
+
+ global $sessionId;
+
+ $sessions = new Sessions();
+ $session = $sessions->getSessionUser($sessionId);
+
+ $USR_UID = $session["USR_UID"];
}
- }
-
- $result = ws_routeCase ($caseId, 1);
- $assign = $result->message;
-
- $aMessage['MESSAGE'] = " Case created in ProcessMaker Case Number:$caseNr Case Id:$caseId Case derivated to: $assign";
-
+
+ //Save files
+ if (isset($_FILES["form"]["name"]) && count($_FILES["form"]["name"]) > 0) {
+ $arrayField = array();
+ $arrayFileName = array();
+ $arrayFileTmpName = array();
+ $arrayFileError = array();
+ $i = 0;
+
+ foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
+ if (is_array($fieldValue)) {
+ foreach ($fieldValue as $index => $value) {
+ if (is_array($value)) {
+ foreach ($value as $grdFieldIndex => $grdFieldValue) {
+ $arrayField[$i]["grdName"] = $fieldIndex;
+ $arrayField[$i]["grdFieldName"] = $grdFieldIndex;
+ $arrayField[$i]["index"] = $index;
+
+ $arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
+ $arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
+ $arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
+ $i = $i + 1;
+ }
+ }
+ }
+ } else {
+ $arrayField[$i] = $fieldIndex;
+
+ $arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
+ $arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
+ $arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
+ $i = $i + 1;
+ }
+ }
+
+ if (count($arrayField) > 0) {
+ for ($i = 0; $i <= count($arrayField) - 1; $i++) {
+ if ($arrayFileError[$i] == 0) {
+ $indocUid = null;
+ $fieldName = null;
+
+ if (is_array($arrayField[$i])) {
+ if (isset($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]]) &&
+ !empty($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]])
+ ) {
+ $indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
+ }
+
+ $fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
+ } else {
+ if (isset($_POST["INPUTS"][$arrayField[$i]]) &&
+ !empty($_POST["INPUTS"][$arrayField[$i]])
+ ) {
+ $indocUid = $_POST["INPUTS"][$arrayField[$i]];
+ }
+
+ $fieldName = $arrayField[$i];
+ }
+
+ $filePath = G::sys_get_temp_dir() . PATH_SEP . $arrayFileName[$i];
+ file_put_contents($filePath, file_get_contents($arrayFileTmpName[$i]));
+
+ if ($indocUid != null) {
+ //Input file type
+ ws_sendFile($filePath, $USR_UID, $caseId, 1, $indocUid, $fieldName);
+ } else {
+ //Attached file type
+ ws_sendFile($filePath, $USR_UID, $caseId, 1, null, $fieldName);
+ }
+ }
+ }
+ }
+ }
+
+ $result = ws_routeCase($caseId, 1);
+ $assign = $result->message;
+
+ $aMessage["MESSAGE"] = " Case created in ProcessMaker Case Number: $caseNr Case Id: $caseId Case derivated to: $assign";
} else {
- $aMessage['MESSAGE'] = 'An error occurred while the application was being processed.
- Error code: '.$result->status_code.'
- Error message: '.$result->message.'
- please contact to your system administrator.';
+ $aMessage["MESSAGE"] = "
+ An error occurred while the application was being processed.
+ Error code: " . $result->status_code . "
+ Error message: " . $result->message . "
+
+
+ Please contact to your system administrator.";
}
-
+
/**
- * by default show the case info, for the recently created case
- * you can change it or redirect to another page
- * i.e. G::header( 'Location: http://www.processmaker.com' );
+ * By default show the case info, for the recently created case
+ * you can change it or redirect to another page
+ * i.e. G::header("Location: http://www.processmaker.com");
*/
- $G_PUBLISH = new Publisher;
- $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfo', '', $aMessage );
- G::RenderPage( 'publish', 'blank' );
- }
- catch ( Exception $e ) {
- $G_PUBLISH = new Publisher;
+ $G_PUBLISH = new Publisher();
+ $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $aMessage);
+ G::RenderPage("publish", "blank");
+} catch (Exception $e) {
+ $G_PUBLISH = new Publisher();
$suggest_message = "This web entry should be regenerated, please contact to your system administrator.";
- $aMessage['MESSAGE'] = '
'.$e->getMessage().'
'.$suggest_message .'';
- $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
- G::RenderPage( 'publish', 'blank' );
- }
\ No newline at end of file
+ $aMessage["MESSAGE"] = "